开发者

Messagebox in ASP.NET 3.5 with AJAX

I have a ASP.NET 3.5 web site with an AJAX update panel. I simply need to process some server side code and then issue a user prompt that says "Code processing complete".

I know there is supposed to be support for Msgbox-esque methods in ASP.NET but I can't find them and any other JavaScript based solutions don't work effectiv开发者_开发技巧ely when you have an update panel.

Help.


Couldn't find a direct example for this, so you can see how this is being used, and change it for your needs. On the client, there is a get_isInAsyncPostback() method to check if an updatepanel will be performing an async postback.

This link shows you how to cancel an update: http://www.asp.net/ajax/documentation/live/Tutorials/CancelAsyncPostback.aspx

Using the themes in this, instead of the beginRequest, you can tap into the endRequest event, and if an async postback, you can post an alert here. This assumes that the code works successfully, which are you adding that detection?

HTH.


MsgBox doesn't exist, but look at the javascript alert() function. That'll popup the message for you.

here is a link with more information on javascript popups

If you want to inject javascript from the server-side code, you can use this:

ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Code processing complete.');",True)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜