How can server-side redirect the web page to last page in the explorer history?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: How can server-side redirect the web page to last page in the explorer history?

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    36

    How can server-side redirect the web page to last page in the explorer history?

    Hi there

    I have a web application and there are lots of different pages, some of which are small simple modal windows. These pages are in place for a long time, and deadline to the project is near, so I won't be able to change the architecture, (i.e. they will have to stay modal windows, at least for now anyway - I know lots of people are against modal windows use in web applications, but in my case, c'est la vie - I'm not the lead developer so i can't fight the argument as the deadline is within 3 weeks).

    Anyway, back to my scenario. When you're in a list of, say, purchase orders (POList.asp) and you double click on a row, this modal window will open with details on it (DialogPODetails.asp). Of course when I call it, I pass in some parameters, such as the PO #, amongst others. When the modal window opens, the server side code will get the PO# and fetch information about the purchase orders with some inline SQLs, and display everything on the modal window.

    So when I'm in the list, the address URL is like this:

    http://localhost/MyApp/POList.asp

    What I don't want to happen is to have some hackers that will just try to type in the name of the modal dialog in the address bar, such as

    http://localhost/MyApp/DialogPODetails.asp

    The thing is, by typing in address like that, sometimes parameters are not passed in properly. If it is the case, PO# may be NULL, and so if the server side tries to build an inline SQL and execute it, it will cause an error.

    Besides, users should never be allowed to change URL like that anyway.

    What I like to see happen, is for the server-side to check that this is illegal, and instead of trying to build the inline SQL - seeing that there are no parameters, just send a message to the client side so the client will go back to the page before.

    So if the system is now displaying POList.asp, and the user types in DIalogpODetails.asp in the address bar and hit enter, the system will then revert back to POList.asp. Don't even need to display any messages telling the users it's illegal. Just go back to POList.asp

    Is it do-able?

    I know that on client side, it is simple. On window onload, I just check to see if running window.dialogWidth will cause an error - if it does, the window is not a modal window, so just do a client-side history.back().

    I just don't know how to do it on server side.

    Thanks
    CC
    Last edited by calgarychinese; 10-13-2006 at 05:49 PM.

Similar Threads

  1. HELP!!! redirect my page....
    By dare2design in forum Web
    Replies: 1
    Last Post: 01-09-2006, 12:49 PM
  2. Replies: 3
    Last Post: 11-06-2005, 03:26 AM
  3. how do i redirect to another web page
    By joy in forum ASP.NET
    Replies: 2
    Last Post: 01-14-2003, 12:42 AM
  4. Replies: 7
    Last Post: 09-15-2000, 08:44 AM
  5. How to up load Sql server data base on web
    By Gourav Sharma in forum Database
    Replies: 8
    Last Post: 06-19-2000, 01:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center