displaying alert box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pearlgod
    New Member
    • Sep 2011
    • 1

    displaying alert box

    hi,

    plz can any one say how to display the value of a particular varible in c# alert box?

    for eg, if int x = 10
    then
    response.write( "alert('wha t should i write to display the value of x')");
  • snehasismishra1
    New Member
    • Aug 2011
    • 18

    #2
    Hi,
    Please find the below code.

    Code:
    int x = 10;
    string script = "<script> alert('" + x + "')</script>";
    Response.Write(script);
    Thanks,
    Snehasis

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      You should check out the article about How to use JavaScript in ASP.NET

      -Frinny
      Last edited by Frinavale; Sep 8 '11, 01:38 AM.

      Comment

      Working...