How to disable autopostback on button
I've got some dynamic created buttons in my GridView (adding them OnDataBound), but when I click some button in makes a strange PostBack and all my added button desappears... Also Click event doesn't happens.
How to :
1) Make my dynamic Button inside GridView do not disappear after clicking one of them.
2) Make this click methode works somehow ...
Im making it this way :
B.Click+=EventHandler(fun(_,_) : void { this.LabelCurrentCategory.Text="AAAA"; });
开发者_Python百科But It makes no sense... Only hides dynamic elements :(
On a postback any dynamic page elements will be lost. *
Can you not stick to client-side code, and use jquery ajax to call a pagemethod on your code-behind page?
EDIT: *Unless you recreate them on the page-load.
精彩评论