Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 24, 2009 10:57 AM by NC01
Mar 19, 2008 12:48 PM|LINK
I'm afraid that the only way to do that is using client-side functionality.
MsgBox will only work if you use VBScript, which will work in Internet Explorer only
If you do not want to add it as an attribute of a control, this will work:
private void someFunction()
Note that RegisterOnSubmitStatement, RegisterStartupScript, RegisterClientScriptBlock, etc have changed since version 1.1 and you will get a compiler warning with the above.
http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.aspx for more info.
Mar 20, 2008 03:50 AM|LINK
Mar 20, 2008 04:05 AM|LINK
You can try this....
Create a function like this... in ur cs file
public void CreateMessageAlert(System.Web.UI.Page aspxPage, string strMessage, string strKey)
ClientScript.RegisterStartupScript(typeof(Page), strKey, strScript);
And then call this function like this where ever you want to show your msgbox..
string strMessage = "Your message goes here";
CreateMessageAlert(this.Page, strMessage, "strKey1");
It works very nicely.
Let me know if this resolves your problem or not.
Mar 20, 2008 05:18 AM|LINK
My problem is not yet solved. I have a masterpage and an update panel. I have to show the message form this update panel. Your code work nicely in a simple page but not in my page.
Can u help me.
Mar 20, 2008 08:34 AM|LINK
if you are using Update panel try below one...
Mar 20, 2008 10:18 AM|LINK
Better way is to use AJAX tookit confirm button as I told you if you can use.
Nepster from India [Yes]
Mark this post answer if it clear your doubts.
Mar 20, 2008 10:30 AM|LINK
You are about to redirect to some other page are you sure want to do
u can put any thing in the panel like images in ur case u want to show.
hope this helps
Mar 20, 2008 10:41 AM|LINK
I have got the following error
Error: 'System.Web.UI.Page' does not contain a definition for 'ScriptManager'
Mar 20, 2008 10:56 AM|LINK
soryy .. no need for page in that...
simply use ..
Mar 20, 2008 11:00 AM|LINK
Just add the following code at the top of the code i.e;
Because for using AJAX Controls , you need to have a ScriptManager .
Hope this helps you. If not then please let me know.
TALIB ALI KHAN
MICROSOFT CERTIFIED TECHNOLOGY SPECIALIST