Posts

Showing posts from November, 2013

Fix Error: Only one instance of a ScriptManager can be added to the page

Use a ScriptManagerProxy on your child pages/user controls http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanagerproxy(v=vs.110).aspx If your code like this   <asp:ToolkitScriptManager ID = "ToolkitScriptManager1" runat = "server" > </asp:ToolkitScriptManager> <!-- <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>-->   Problem Solution ASP.NET ignores HTML comments just like it ignores all tags without a runat="server" on them or that don't start with <% . So, Use below code for comment <%-- < asp : ScriptManager ID = "ScriptManager1" runat = "server" > </ asp : ScriptManager > -- %>

How do make a .NET 4 thread wait for asynchronous requests to finish?

I'm currently wrapping the asynchronous calls within a List of Task objects to use Tasks.WaitAll() This is a fairly clean solution if you truly want to force these "tasks" to synchronize and block at this point. This is the main rationale behind Task.WaitAll() , and is nice since it (optionally) allows you to cancel the blocking operation after a timeout, if you so choose.