How do I force full post-back from a button within an UpdatePanel?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
I had the same problem using an ImageButton inside a WebDataGrid.
I put the Line from EvilDr inside the preRender for the webdatagrid instead. Worked great!
Its an old question there is bit tricky approach as well, when everything is in update panels and you want to do full post back so that your Document.Ready code works on click.
1. Create a dummy button outside the update panel and click it from code behind like this
2. Define the function on front end like this
NOTE: But the best way is using trigger, the answer posted by @Thibault Falise :)
You can use the Triggers property of the UpdatePanel to register actions that trigger a full postback.
Add a PostBackTrigger object to that property, containig the ControlID of the control which needs to trigger a full postback.
From here:
Use the PostBackTrigger control to enable controls inside an UpdatePanel to cause a postback instead of performing an asynchronous postback.
Just adding this because nobody else has. It is possible to do this in code-behind in one line of code without any of the above methods. Just put this in page_load:
Visual Basic
C#