gymcode
gymcode

Reputation: 4623

Messagebox dialog for ASP.NET

I have tried to use console.writeline, opendialog, messagebox for my web application on visual studio 2005, but all of them seems to have a missing reference. May I know what is to be used in VS 2005 for popup message boxes?

Upvotes: 1

Views: 1033

Answers (5)

James McLachlan
James McLachlan

Reputation: 1368

An alternative is to write out to the built-in trace thing, especially if you're in the data layer opening DB connections. E.g. Debug.Write or Trace.Write, then, while debugging, look in the Output window in VS and select Show output from: Debug. You can also see the messages in http://server/yourapp/trace.axd.

More details here: http://msdn.microsoft.com/en-us/library/wwh16c6c.aspx and here: http://msdn.microsoft.com/en-us/library/y13fw6we(v=VS.85).aspx

Upvotes: 0

Hans Kesting
Hans Kesting

Reputation: 39274

Asp.net uses two separate worlds that alternate in having control:

1) the server, where you use database connections to retrieve data and prepare html for sending to the browser. Only when the server is finished, a response is sent back to the browser

2) the browser, which renders the html to show a page to the user. On some action of the user (usually), a new request is sent to the server for another round.

So you can't mix user-interaction with server-side code, the way you can with a winform application.

Upvotes: 1

petko_stankoski
petko_stankoski

Reputation: 10713

Imagine opening a web site and a message in a console to be written to you. It's not good, right? That's why you can use Response.WriteLine() in ASP.NET.

Upvotes: 0

Furion
Furion

Reputation: 68

you can try Response.Write(); to output your result on web-page

Upvotes: 1

John Saunders
John Saunders

Reputation: 161773

Console is for console applications; MessageBox is for windows forms. There is no built-in message box for web forms, other than the JavaScript alert method:

<a href="javascript:alert('this is a message');">Alert me</a>

Upvotes: 4

Related Questions