i have two buttons inside a update panel.i need to trigger update progress and show a .gif image for each button click.when i press a button1 only the associated update progress should be displayed and the other one should be invisible
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- Using :remote => true with hover event
- How to store image outside of the website's ro
- Is there a way to play audio on a mobile browser w
- 'System.Threading.ThreadAbortException' in
After a long search, trial and error, i've come up with something that worked for me.
You'll need to combine some Javascripting and dual panels in your update panel.
Please note this is done in VB.NET
Please note that my example is using masterpages
Please note that the ID's of the buttons and panels are hardcoded (not ideal)
This is the codebehind..
This is the main aspx page .
The javascript code will intercept the postback operation for the updatepanel and hide or show the respective panels accordingly.
Cssclass=Overlay and CssClass=Loader are some CSS styles to make the page opaque and postion the feedback in the middle
Pressing button1 ...
Pressing button2
You can associate the UpdateProgress control with a single UpdatePanel control by setting the progress control's AssociatedUpdatePanelID property. In that case, the UpdateProgress control displays a message only when a postback originates inside the associated UpdatePanel control.
Reference: http://msdn.microsoft.com/en-us/library/bb386421.aspx