how can i show a message box??
-
:confused:how can i show a message box??in asp.net using c#. i have to show one message when a specific condn satisfies..;P
If you are doing a post back you can use code like this: NOTE you need: using System.Text; private void ShowMessageBox(string aMessage) { aMessage = aMessage.Replace(vbCrLf, "\\n").Replace("\"", "'"); StringBuilder myScript = new StringBuilder(); myScript.Append(""); myScript.Append(Environment.NewLine); myScript.Append("alert(\"").Append(aMessage).Append("\");"); myScript.Append(Environment.NewLine); myScript.Append(""); Page.RegisterStartupScript("TagMessage", myScript.ToString()); } NOTE in .net 2.0 the call to registerstartupscript has changed. If you are not doing a post back you have to use javascript. Hope that helps. Ben
-
:confused:how can i show a message box??in asp.net using c#. i have to show one message when a specific condn satisfies..;P
hi.......... ex:- if(TextBox1.Text!=null && TextBox1.Text!="") MsgBox1.alert("Please input something in the text box."); else MsgBox1.confirm("Hello "+ TextBox1.Text + "! do you want to continue?", "hid_f"); hope your prob. slove........
Imagine the I.T
-
If you are doing a post back you can use code like this: NOTE you need: using System.Text; private void ShowMessageBox(string aMessage) { aMessage = aMessage.Replace(vbCrLf, "\\n").Replace("\"", "'"); StringBuilder myScript = new StringBuilder(); myScript.Append(""); myScript.Append(Environment.NewLine); myScript.Append("alert(\"").Append(aMessage).Append("\");"); myScript.Append(Environment.NewLine); myScript.Append(""); Page.RegisterStartupScript("TagMessage", myScript.ToString()); } NOTE in .net 2.0 the call to registerstartupscript has changed. If you are not doing a post back you have to use javascript. Hope that helps. Ben
-
:confused:how can i show a message box??in asp.net using c#. i have to show one message when a specific condn satisfies..;P
hi there: you can take a look at this article asp.net message box << >>
-
hi there: you can take a look at this article asp.net message box << >>