Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Kershaw - 07 Jun 2007 16:04 GMT
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
Eliyahu Goldin - 07 Jun 2007 16:16 GMT
This may help you:

How to Pass Messages and Actions between Server and Client
http://usableasp.net/DeveloperPage.aspx?page=Articles/HowTo/HowToPassMessagesBet
weenServerAndClient.htm


Signature

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

> Hi,
>
[quoted text clipped - 12 lines]
> Thanks
> Steve
bruce barker - 07 Jun 2007 16:16 GMT
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)

> Hi,
>
[quoted text clipped - 12 lines]
> Thanks
> Steve
CitrusMotors.com - 07 Jun 2007 17:43 GMT
> Hi,
>
[quoted text clipped - 12 lines]
> 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;
}

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.