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;
                        return;
                    }  
                }     
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


thanks.

IngD
 

 

Nov 24, 2011 at 1:37 PM

Big mistake!

Page.Request.RawUrl.Contains(selectedpage)

problem solved.

IngD