0

I have a fileupdload control inside update panel. I have handle this upload by using following line
<Triggers> <asp:PostBackTrigger ControlID="btnSave" /> </Triggers>
But when i using it i don't get the JavaScript message i.e. i have written like this ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('File Upload Successfully!!')", true);


Now My issue is this message not showing when i use this postbacktrigger. But when i remove the trigger tag, i got the message properly.

Please tell me what is the error.

Thanks for advance

Debiprasad
  • 21
  • 5
  • Possible dupe: http://stackoverflow.com/questions/7844061/running-javascript-after-update-panel-refresh – Saturn K Jun 17 '16 at 20:46

1 Answers1

0

Since you have a postbacktrigger for "btnSave", the page will do a full postback. Since the documentation for ScriptManager.RegisterStartupScript() says that it registers a script for every "asynchronous" postback, i guess it wont work.

Try using ScriptManager.RegisterClientScriptBlock() instead

Arshad Mohammad
  • 399
  • 3
  • 7