Last post Jun 05, 2012 11:39 AM by b471code3
Jun 05, 2012 09:55 AM|b471code3|LINK
I'm creating a custom server control which inherits the CompositeControl class with a TextBox, AJAX CalendarExtender, Image and CompareValidator and UpdatePanel controls. When I debug my code it errors out when I assign an ImageURL to the Image control.
Pretty simple code:
protected override void CreateChildControls()
image.ImageUrl = Page.ClientScript.GetWebResourceUrl(this.GetType), "ControlLibrary.Server.Custom.Resources.calendar.jpg");
If I inherit the WebControl, INamingContainer classes, it works fine although I run into issues with ViewState and persisting values on postback.
I did follow this MSDN example:
Jun 05, 2012 11:39 AM|b471code3|LINK
Had a minor syntax error and needed to place the code above in the OnPreRender event.