CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Message Box

  1. #1
    Join Date
    Oct 2001
    Location
    Chandigarh, India
    Posts
    132

    Message Box

    Hi

    I am a beginner to ASP.NET. That is why I am asking this simple question.

    I am developing ASP.NET pages. I want to display a message box on client side in C# as is done in JavaScript in ASP. How can I do that?

    Thanks

    Amit


  2. #2
    Join Date
    Apr 2002
    Location
    Iceland
    Posts
    5

    Re: Message Box

    Have you found out how to do this? Because I´m trying to display a message box in a web form application but I don´t know how to do it. So please let me know if you have the answer!


  3. #3
    Join Date
    Mar 2002
    Location
    Alpharetta, GA
    Posts
    51

    Re: Message Box

    C# is not a client side scripting language. C# code will only run on the server.

    You can include JavaScript in your aspx file to pop a message box and you can use the attributes property of a server control to add a client side event handler to call this code.

    Otherwise, this is done the same in asp.net as it was in asp.


  4. #4
    Join Date
    Oct 2001
    Location
    Chandigarh, India
    Posts
    132

    Re: Message Box


    Actually, I wanted to display query string while debugging an error. In ASP, if I put Response.Write before the line having error, it displayed it on browser. But in ASP.Net, if error occurs, it displays nothing but the error message.

    So, I want to get the query string displayed, may be using Response.Write or through some message box.

    How can I do that?

    Thanks


  5. #5
    Join Date
    Apr 2002
    Posts
    1

    Re: Message Box

    write this in Page_load
    button1.attribute.add("onclick","confirm(yes or no?);");


  6. #6
    Join Date
    Mar 2002
    Location
    Alpharetta, GA
    Posts
    51

    Re: Message Box

    use Response.Write at the beginning of the Page_Load event immediately followed by Response.End. Or set a break point at the first line of code in Page_Load or OnInit and use the immediate window, or some other debugging to get the query string.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured