Interviews15 answers
How to display Alert in JavaScript and ASP.NET
15 Answers
below mention script how to write on button click with server side confirmation in asp.net
Pratik ShirsePosted Feb 9, 2017, 10:57 PM EST
Response.Write("")
Pugal PillareePosted Jan 9, 2016, 12:01 AM EST
///
/// showAlert
///
public string showAlert(string msg)
{
string message = msg;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("");
return sb.ToString();
}
and then call above function like
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert",
showAlert("Student already admitted to this batch."));
Manish Kumar ChoudharyPosted Nov 20, 2014, 7:17 PM EST
page.registerstartupscript("sss","alert('student details not avlible')");
sreeranga prasad sanePosted Nov 20, 2014, 7:10 PM EST
Page.RegisterStartupScript("ddd", "alert('student details not avalible')");
sreeranga prasad sanePosted Nov 20, 2014, 7:09 PM EST
Page.RegisterStartupScript("ddd", "alert('student details not avalible')");
sreeranga prasad sanePosted Nov 20, 2014, 7:08 PM EST
Response.Write("alert('Duplicate files not allowed');");
Devesh SinghPosted Jun 11, 2014, 2:31 AM EDT
Response.Write("javascript:alert('Your message');");
Anil Kumar YadavPosted Apr 30, 2012, 4:38 AM EDT
alert("message");
pradeep sahuPosted Apr 25, 2012, 4:06 AM EDT
we can display alert box from asp.net code-behind that is
1. ScriptManager.RegisterStartupScript(this,GetType(),"alertmsg","alert('hahahahah');",true);
1. ScriptManager.RegisterStartupScript(this,GetType(),"alertmsg","alert('hahahahah');",true);
manoj prabakaranPosted Apr 9, 2012, 10:40 AM EDT
IN order to Show MessageBox you can add the MessageBox Class in your page and use MessageBox.Show("Your Message");
Link for MessageBox Class
Swa MPosted Mar 29, 2012, 1:28 AM EDT
#region :: Alert Messege ::
public void showalert(string msg)
{
string script = "";
if (!Page.IsStartupScriptRegistered("ClientScript"))
{
Page.RegisterStartupScript("ClientScript", script);
}
}
#endregion
piyush sardharaPosted Mar 13, 2012, 2:53 AM EDT
You need to drag script manager and then type the follwing code wherever u required
ClientScript.RegisterClientScriptBlock(typeof(Page), "test", "");
ClientScript.RegisterClientScriptBlock(typeof(Page), "test", "");
Bhupendrakumar TiwariPosted Mar 4, 2012, 7:36 PM EST
Response.Write("alert('Hello');" );sri minuPosted Feb 28, 2012, 1:23 AM EST
Write this line of code to diplay the alert message.
Response.Write("alert('Hello Puru!!!')");
Purushottam RathorePosted Feb 13, 2012, 9:00 PM EST





