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!

MSGBOX 3

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I am trying to create a msgbox that would popup if textbox1.text = ""

how do you display a simple msgbox in .NET??

Thanks
 
Try using the required field validator. There is an option on it so that it will pop up a messagebox instead of displaying text on the screen. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Mark: you need a validation summary control to do that, right?

(just checking in case I missed an even easier way to do the alert box)
:)

D
 
jfrost: your right, its a summary validator that brings up all invalid page validators in a bulleted list. I have attempted a few times to use the summary validator but it doesn't work for me, but then again, my code is a bit on the pasta side, so not surprising.
 
Ah, but Isadore: the summary validator can either display it in a bulleted list, OR a paragraph, AND add a header above (i.e. The following errors have occured: list), AND you can tell it to either display in a message box, or just on the page.

It's a really great tool to use, and I'm sure if you played around a bit more you could get it to work.

You might want to look into whether you can utilize code behind as well (although without vs.net, it can get a bit tricky...but it would still be better than Pasta code)

D
 
D'Arcy. Thanks. I'll certainly take your advice. We recently gained access to an SQL Server so I am going to into Visual Studio and onto the SQL here in a couple of weeks and get back to my French roots.

I'm really looking forward to it - reason I'm here to learn. But have to admit, up to now my little NotePad site has been quite the charm -- proof I suppose of how powerful dot NET really is -- I have seen for example, two round trips to the server (data drilling and then a call for a graphic image resulting from that drilling - Chart Director) on a 56K phone line take less than 1.5 seconds (using OLEDB Access JET 4.0).

Now that ain't bad. Can't imagine the performance improvement on the SQL. This stuff is very very powerful, and the more I'm exposed to it, the more I question anyone staying with ASP, Cold Fusion, Access, VB or whatever.

But I'm no expert, but I can say this, I sure am having a world of fun with this stuff. And specialy thanks to you, Zarcom, and Paul, for sharing your education with us little guys. It makes a big difference -- reminds me of one of my favorite sayings of all time:

"Eternity is in love with the productions of time."

W. Blake (c. 1780)

 
Yes you do need the summary validator D. I was forgot that the required field validator couldn't do that by it self.

So to answer your question dvannoy. You need to setup a required field validator and add a summary validator to your page. The summary validator has a property "ShowMessageBox" set this to true and your work is done.

Thanks for the compliment Izy. You may just surpass us all one day. It was only a few months ago I was the one asking all the questions. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Thanks guys for eveyones help, I really appreciate it.
 
np That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top