Last post Feb 16, 2010 09:57 PM by KCrow
Feb 11, 2010 11:53 PM|KCrow|LINK
I have a control that renders different children according to a property value. All works great until I add a rating control in the mix. I get the following:
Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.
any help would be greatly appreciated.
Protected Overrides Sub RenderContents(ByVal writer As System.Web.UI.HtmlTextWriter)
Select Case QuestionType
ajax rating control
Feb 12, 2010 07:30 AM|d4daud|LINK
Please add this line for top of the page tag(Page Language="C#")
Feb 12, 2010 10:39 AM|KCrow|LINK
Made no difference
Feb 16, 2010 09:35 PM|jkirkerx|LINK
writer is the collection of object, that rendercontents will render into html code. Writing a control is just like creating objects in code behind. Objects are like Label, in the case of the div tag your trying to create, that's a panel object.
You just pass writer along, you add objects to control.
If you want to create a div tag
Dim panel_div as panel = new panel
If you want to add a label to the panel
Dim lbl_status as label = new label
If you want to render the writer, you can call
Feb 16, 2010 09:57 PM|KCrow|LINK
the div is merely a way to add layout to the control collection.
Originally i just added the controls to the control collection in the CreateChildControls method this worked but only stacked the controls and did allow any layout control
my problem is not with any other controls being written just the rating control