Click to See Complete Forum and Search --> : Message Box


amitg
April 18th, 2002, 05:39 AM
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

Dize
April 22nd, 2002, 12:15 PM
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!

mikescham
April 23rd, 2002, 12:18 AM
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.

amitg
April 23rd, 2002, 03:33 AM
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

kingcd
April 23rd, 2002, 06:58 AM
write this in Page_load
button1.attribute.add("onclick","confirm(yes or no?);");

mikescham
April 23rd, 2002, 07:53 AM
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.