Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to have a error create a pop-up?

Reply
Thread Tools

How to have a error create a pop-up?

 
 
REB
Guest
Posts: n/a
 
      02-05-2004
What is the code in C# to have a pop-up when a function throws an error?

catch(Exception ex)
{
Show pop up with text from ex in it?
}


 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      02-05-2004
you'll have to pass it to a clientside call.
javascript:alert('yourError');
perhaps, or a window.open() or a window.showModalDialog()

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


"REB" <(E-Mail Removed)> wrote in message
news:uR$(E-Mail Removed)...
> What is the code in C# to have a pop-up when a function throws an error?
>
> catch(Exception ex)
> {
> Show pop up with text from ex in it?
> }
>
>



 
Reply With Quote
 
 
 
 
Earl Teigrob
Guest
Posts: n/a
 
      02-05-2004
I often use the Page.RegisterStartupScript in an event handler to write a
javascript alert that can be based on a condition allows the entire page
loads before the alert pops up...very handy for me...

(note, this method also makes the message tablerow visible and writes to a
literal control in that row)
private void UserMessage(string Message, bool Popup)

{


StatusMessage.Text=Message;

ShowMessage.Visible=true;

if (Popup)

{

Page.RegisterStartupScript("StatusMessage","<SCRIP T
LANGUAGE=\"JavaScript\">alert('"+ Message +"');</Script>");

}

}





"REB" <(E-Mail Removed)> wrote in message
news:uR$(E-Mail Removed)...
> What is the code in C# to have a pop-up when a function throws an error?
>
> catch(Exception ex)
> {
> Show pop up with text from ex in it?
> }
>
>



 
Reply With Quote
 
REB
Guest
Posts: n/a
 
      02-05-2004
Can a response.write be used to cause a pop-up?


"REB" <(E-Mail Removed)> wrote in message
news:uR$(E-Mail Removed)...
> What is the code in C# to have a pop-up when a function throws an error?
>
> catch(Exception ex)
> {
> Show pop up with text from ex in it?
> }
>
>



 
Reply With Quote
 
Curt_C [MVP]
Guest
Posts: n/a
 
      02-05-2004
no... not unless you Response.Write() some clientside script.
There is not "open a new window" option in the Response.Write, sorry.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


"REB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Can a response.write be used to cause a pop-up?
>
>
> "REB" <(E-Mail Removed)> wrote in message
> news:uR$(E-Mail Removed)...
> > What is the code in C# to have a pop-up when a function throws an error?
> >
> > catch(Exception ex)
> > {
> > Show pop up with text from ex in it?
> > }
> >
> >

>
>



 
Reply With Quote
 
REB
Guest
Posts: n/a
 
      02-05-2004
Does something like this work?

Response.Write("<SCRIPT LANGUAGE='JavaScript1.2'> alert('Error!')
</Script>");

Are there any drawbacks to using it this way?

"REB" <(E-Mail Removed)> wrote in message
news:uR$(E-Mail Removed)...
> What is the code in C# to have a pop-up when a function throws an error?
>
> catch(Exception ex)
> {
> Show pop up with text from ex in it?
> }
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
How can i create new users without utilizing the create user wizar prady ASP .Net 2 12-29-2007 10:46 PM
Can I create a Create .NET 1.1 project in VS2005? JB ASP .Net 1 12-14-2007 10:53 AM
How to create python script which can create csv we file with relationship Sonu Python 1 08-03-2007 01:08 PM
Why I have error message "not have an entry point defined"? =?Utf-8?B?ZGF2aWQ=?= ASP .Net 6 08-18-2005 11:09 AM



Advertisments