Widget visibility

Topics: Controls
Nov 24, 2011 at 11:05 AM

I had create a new  widget property: a list of pages, where widget is hidden, i had modified WidgetEditors.aspx.cs and other files.

Now in OnLoad() in WidgetZone.cs I want to set visibility reading settings:

string[] selectedpages = widget.Attributes["hideinpages"].InnerText.Split(';');

and i iterate in selectedpages:

for (int i = 0; i < selectedpages.Length; i++)
                    string selectedpage = selectedpages[i];
                    if (HOWCANIKNOWCURRENTPAGE.Contains(selectedpage))
                        Visible = false;
If the page url is in list then the widget is hidden.
BUT: how can i know the url of current page?

Request.RawUrl.ToLowerInvariant().Contains(selectedpage) return error




Nov 24, 2011 at 1:37 PM

Big mistake!


problem solved.