15
Reply

How to display Alert in JavaScript and ASP.NET

Purushottam Rathore

Purushottam Rathore

Feb 14, 2012
51.7k
0

    we can display alert box from asp.net code-behind that is

    1. ScriptManager.RegisterStartupScript(this,GetType(),"alertmsg","alert('hahahahah');",true);





    manoj prabakaran
    April 09, 2012
    1

     #region :: Alert Messege ::
        public void showalert(string msg)
        {
            string script = "";
            if (!Page.IsStartupScriptRegistered("ClientScript"))
            {
                Page.RegisterStartupScript("ClientScript", script);
            }
        }
        #endregion

    piyush sardhara
    March 13, 2012
    1

    below mention script how to write on button click with server side confirmation in asp.net

    Pratik Shirse
    February 10, 2017
    0

    Response.Write("")

    Pugal Pillaree
    January 09, 2016
    0

    ///

    /// 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 likeClientScript.RegisterClientScriptBlock(this.GetType(), "alert",showAlert("Student already admitted to this batch."));

    Manish Kumar Choudhary
    November 21, 2014
    0

    page.registerstartupscript("sss","alert('student details not avlible')");

    sreeranga prasad sane
    November 21, 2014
    0

    Page.RegisterStartupScript("ddd", "alert('student details not avalible')");

    sreeranga prasad sane
    November 21, 2014
    0

    Page.RegisterStartupScript("ddd", "alert('student details not avalible')");

    sreeranga prasad sane
    November 21, 2014
    0

    Response.Write("alert('Duplicate files not allowed');");

    Devesh Singh
    June 11, 2014
    0

    Response.Write("javascript:alert('Your message');");

    Anil Kumar Yadav
    April 30, 2012
    0

    alert("message");

    pradeep sahu
    April 25, 2012
    0

     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 M
    March 29, 2012
    0

    You need to drag script manager and then type the follwing code wherever u required

    ClientScript.RegisterClientScriptBlock(typeof(Page), "test", "");

    Bhupendrakumar Tiwari
    March 05, 2012
    0

    Response.Write("alert('Hello');");

    sri minu
    February 28, 2012
    0

    Write this line of code to diplay the alert message. Response.Write("alert('Hello Puru!!!')");

    Purushottam Rathore
    February 14, 2012
    0