Posts

Showing posts from October, 2009

WCF: This collection already contains an address with http scheme.

User control event/viewstate missing during postback

User control event/viewstate missing during postback Question : Some of your web control's events goes missing or cannot be caught when you load it in a user control?Answer: Always use the Control.UniqueID generated for you by ASP.Net when assigning it to a NAME property of your control. The complete Control.UniqueId is available when you assess this in OnPreRender stage. Check your Control.UniqueID which is render into the NAME property of your control on a HTML page. ASP.Net keeps track of the control using Control.UniqueID which makes events / viewstate works. If you override your UniqueID (for javascript manipulation) you might get this problem.
Why does it work on your Page but not in user control? On a page, when your control is renders, it probably use name like “MyControl” but in user control this is automatically change to “ctl$_MyControl”. ASP.Net is no longer able to resolve your control id if you override your Control.ID. For example, I created a control and this is …

ASP.Net and JQuery

Anyone looking to get JQuery working on ASP.net can try this link :

http://blog.dreamlabsolutions.com/post/2009/02/24/jQuery-document-ready-and-ASP-NET-Ajax-asynchronous-postback.aspx

It describes everything you need to know to get it working together.