Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message Box in ASP.NET 1.1 1

Status
Not open for further replies.

bubberz

Programmer
Dec 23, 2004
117
US
Can you do Message Boxes like a windows app for ASP.NET 1.1? From what I remember, you couldn't in ASP 3.0.
I thought I read something that ASP.NET 2.0 will have this functionality.

Thanks!
 
Asp.NET is like Vb.NET (from code-behide) ! Write your code as in VB. Some errors may always occur (cause is web App) but the error message will be displayed in the browser.

msgbox("prompt", ..., "title")
 
That won't work for a web application....

To display a message box to the user you will need to use a javascript alert. A good article on this is:


--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
That exactly error i mean! At msgbox (unable to show modal...)
 
So why post it as a solution if it always errors?

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
MsgBox is an alias for System.Windows.Forms.MessageBox. Since this is a Windows Form class, you can't use it in an ASP.NET application -- you'll need to use a javascript alert. Or write to the NT EventLog. Or write to a log file, using something like log4net

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Sorry for posting a little late.

You can definately use the msgbox()

<script language=vbscript type=text/vbscript >
sub Show()
msgbox "Hi",vbyesno,"blabla"
end sub
</script>


-bclt
 
Yes, in vbscript you can show a message box but your original post stated to write it in the code-behind page which meant that you were calling the System.Windows.Forms.MessageBox (as chiph pointed out to you).

Therefore your second soltion is different to your original (although it now contains is a valid solution) and the original response was incorrect and will still not work.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top