Postback And UpdatePanel
I recently learned you can do a postback from javascript using
__doPostBack('#<%=LinkButton.UniqueID%>', '')
This method worked well for me, even with updatepanels but now I added another LinkButton and tried to do a postback using the method above. It works but the page refreshes.
I added this LinkButton to an updatepanel and set a trigger. When I normally click on the LinkButton , it doesn't refresh, but when I try the java postback, it does.
*Got it to work if I write ctl00$ContentPlaceHo开发者_C百科lder1$LinkButton
But this way isnt good for me because I can't change it everytime I move the control
I notice here that you have add the # symbol. This used on jQuery, not here, just remove it and its work.
__doPostBack('<%=LinkButton.UniqueID%>', '')
Use the ClientIDMode attribute on your link button, set it to 'static'.
Should do the trick for you :-)
精彩评论