PopUp Windows

  • Thread starter Thread starter Herb Stull
  • Start date Start date
H

Herb Stull

Hello All,

Does anyone know of a way to display pop-up windows in ASP.NET? I'm looking
for a way to inform the user of errors encountered in a data entry form.

Thanks, Herb
 
Hi Herb,

Do you want to show a pop-up IE window or a messagebox? You can show both
of them with java script. Use window.alert() method to show a messagebox
and use window.open() method to open a popup IE window. And you can use
Page. RegisterStartupScript() method to register the client script from
code behind. For example, the following code shows a messagebox when a
Webcontrol button on the page is clicked.

private void Button1_Click(object sender, System.EventArgs e)
{
string strScript = "<script>" + "window.alert('Hello world!!!')" +
"</script>";
Page.RegisterStartupScript("Alert", strScript);
}

Please refer to the following link for more information:

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref
erence/methods/alert.asp

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref
erence/methods/open_0.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebUIPageClassRegisterStartupScriptTopic.asp
--------------------
| From: "Herb Stull" <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Subject: PopUp Windows
| Date: Thu, 16 Oct 2003 11:18:58 -0400
| Lines: 8
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| NNTP-Posting-Host: 23.pwlr1.xdsl.nauticom.net
| Message-ID: <[email protected]>
| X-Trace: news.nauticom.net 1066318139 209.195.150.152 (16 Oct 2003
11:28:59 -0400)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!skynet.be!skynet.be!newshub1.home.nl!home.nl!news2.euro.net!newshosting
.com!news-xfer2.atl.newshosting.com!129.250.35.142.MISMATCH!iad-feed.news.ve
rio.net!phl-feed.news.verio.net!news.nauticom.net!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63774
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Hello All,
|
| Does anyone know of a way to display pop-up windows in ASP.NET? I'm
looking
| for a way to inform the user of errors encountered in a data entry form.
|
| Thanks, Herb
|
|
|
 
Hey Kevin,

Thanks so much for the reply. It worked very nicely and saved me a lot
of time over hunting for an answer.

You seem to answer a lot of these posts. Nice of you to put your time
into helping those of us who are struggling to find our way through the
.NET framework.

Thanks again, Herb
 
Hi Herb,

I'm glad that I can help. Thank you for choosing MSDN Newsgroup.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: Herb Stull <[email protected]>
| References: <[email protected]>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: RE: PopUp Windows
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Date: Fri, 17 Oct 2003 10:03:27 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63895
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Hey Kevin,
|
| Thanks so much for the reply. It worked very nicely and saved me a lot
| of time over hunting for an answer.
|
| You seem to answer a lot of these posts. Nice of you to put your time
| into helping those of us who are struggling to find our way through the
| .NET framework.
|
| Thanks again, Herb
|
|
|
|
| Don't just participate in USENET...get rewarded for it!
|
 
Back
Top