PC Review


Reply
Thread Tools Rate Thread

ASP.NET - How to display a concurrent seperate page?

 
 
Steve Kershaw
Guest
Posts: n/a
 
      7th Jun 2007
Hi,

I need to display a seperate error page (off a try...catch block) in
ASP.NET.
Response.Redirect and Server.Transfer won't work in this case because
they replace the
old page with a new one and I want both pages to be displayed (error
page on top of course).

An alternate question is; how can I call a javascript function from an
ASP.NET method?
That way I can simply use the window.alert("error message here");
javascript function.

Thanks
Steve

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      7th Jun 2007
This may help you:

How to Pass Messages and Actions between Server and Client
http://usableasp.net/DeveloperPage.a...rAndClient.htm


--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Steve Kershaw" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I need to display a seperate error page (off a try...catch block) in
> ASP.NET.
> Response.Redirect and Server.Transfer won't work in this case because
> they replace the
> old page with a new one and I want both pages to be displayed (error
> page on top of course).
>
> An alternate question is; how can I call a javascript function from an
> ASP.NET method?
> That way I can simply use the window.alert("error message here");
> javascript function.
>
> Thanks
> Steve
>



 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      7th Jun 2007
this can only be done in javascript. you need to understand the web
model. the browser request a page, asp.net process the request and sends
back an html document. the doc header can contain a redirect command,
but there is no open window command. your return document can contain
inline javascript that is executed when the browser renders the page.

<script>window.alert('hi');</script>

in the old days before popup blockers, the inline javascript could open
a window.


-- bruce (sqlwork.com)

Steve Kershaw wrote:
> Hi,
>
> I need to display a seperate error page (off a try...catch block) in
> ASP.NET.
> Response.Redirect and Server.Transfer won't work in this case because
> they replace the
> old page with a new one and I want both pages to be displayed (error
> page on top of course).
>
> An alternate question is; how can I call a javascript function from an
> ASP.NET method?
> That way I can simply use the window.alert("error message here");
> javascript function.
>
> Thanks
> Steve
>

 
Reply With Quote
 
CitrusMotors.com
Guest
Posts: n/a
 
      7th Jun 2007
On Jun 7, 8:04 am, Steve Kershaw <steve_kers...@yahoo.com> wrote:
> Hi,
>
> I need to display a seperate error page (off a try...catch block) in
> ASP.NET.
> Response.Redirect and Server.Transfer won't work in this case because
> they replace the
> old page with a new one and I want both pages to be displayed (error
> page on top of course).
>
> An alternate question is; how can I call a javascript function from an
> ASP.NET method?
> That way I can simply use the window.alert("error message here");
> javascript function.
>
> Thanks
> Steve


You could always display the error, then auto-redirect after x
seconds, or a user click

in side js block...
function redirTimer( sURL, iSecondsDelay){
self.setTimeout("self.location.href='" + sURL + "';",
iSecondsDelay);
//show(false,'testJava');
}

or

open a new window after page load (pop up blockers could be
problematic like bruce mentioned.


function popWin1(url, thePreference)
{
// Create offset
if (document.all) {
xMax = screen.width;
yMax = screen.height;
}
else {
if (document.layers) {
xMax = window.outerWidth;
yMax = window.outerHeight;
}
else {
xMax = 400;
yMax=480;
}
}
var xOffset = (xMax - 586)/2;
var yOffset = (yMax - 700)/2;

thePreference = thePreference + ',screenX='+xOffset
+',screenY='+yOffset+',top='+yOffset+',left='+xOffset
+'resizable=true,scrollbars=yes';

// alert("Preference = " + thePreference);
if (typeof(popupWin) != "object"){
popupWin = window.open(url, 'window2', thePreference);
}
if (popupWin.closed){
popupWin = window.open(url, 'window2', thePreference);
}
if( popupWin.opener == window) {
popupWin.focus();
return;
}
return;
}

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Seperate validation for seperate user controls on same page moondaddy Microsoft ASP .NET 2 16th Oct 2006 05:03 AM
How do I start a new page in front page seperate from my existing =?Utf-8?B?RHVrZQ==?= Microsoft Frontpage 3 12th Apr 2005 02:09 PM
concurrent display Ken Lotterman Windows XP General 4 30th Dec 2004 06:48 PM
RE: concurrent appointments - can outlook display more than 6? =?Utf-8?B?SG93YXJkIFdpbGxpYW1z?= Microsoft Outlook Calendar 0 12th Dec 2003 08:56 PM
How to use Server Side Includes SSI with FP2k to display seperate ftp'd file on FP web page? tmb Microsoft Frontpage 2 21st Sep 2003 04:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:31 AM.