c# - jquery with update panel -
I have a problem when using the jquery context menu and the update panel I use HTMLTextWriter to render custom textbox control references in the context I'm writing JavaScript to the menu. Everything works fine, I can right click on every text box and the menu is visible.
But when I trigger a partial postback using an asp.net updatepanel, the menu will not be displayed. It seems that the bond between jquery and html is lost when the partial post is back.
Is there a better way to put dynamic javascript code apart from RenderBeginTag? How can I solve this issue?
If you are right, the update panel will remove your javascript binding.
In a postback in your update panel, re-register JavaScript in question.
Something like this:
ClientScriptManager cs = Page.ClientScript; Cs.RegisterStartupScript (typef (page), "Replication javascript", "script = type = text / javascript & gt; your javascript initthum (); ", false);
If it does not work you may need to use:
ScriptManager.RegisterStartupScript (page, typef (page), "Repeat JavaScript ", & lt; script type = text / javascript & gt; YourJavascriptInitMethod (); ", false);
Comments
Post a Comment