Problem with RegisterStartupScript

  • Thread starter Thread starter Lloyd Sheen
  • Start date Start date
L

Lloyd Sheen

I have the following situation. The user has reports that they want to view
in a seperate IE. I am using the RegisterStartupScript to open a new window
when they request the page. This works fine.

Now they close the window and request lets say an edit. A response.redirect
is issued and that works fine. Now the problem.

If the user clicks the "Back to Navigator" button (my app) there is no
problem but if they click the Back button on the IE toolbar it then reopens
the report since the javascript is still there. Is there someway to get rid
of the registered startup code?

Lloyd Sheen
 
Ok, here is the sequence.

1. User is on naviagation page.
2. Select project from dropdown.
3. Click print button
4. On the Click handler I register the startup script.
5. The navigation page stays and a new window (print page) pops up, asks
the user to confirm printing, upon printing the page closes (sometimes with
user confirmation sometimes without)
6. At this point the user will normally see the navigation page.
7. User selects project and clicks Edit button.
8. Edit screen pops up and user can edit project details.

This is the point at which things get ...

9. If the user clicks the "Back to Navigator" button I do a redirect to
the page and all is good.
10. If the user uses the GoBack IE toolbar button then the print page
loads with user confirmation about print. The page closes (again sometimes
with confirmation sometimes not).
11. If at any time the "Back to Navigator" button is clicked on any page
causing the redirect back to the page things go back to ok.

The problem is that I cannot get rid of the registered startup code.

Lloyd Sheen


the RegisterStartupScript to open a new window
when they request the page.

Can you clarify exactly how the users request a report and how you are
using RegisterStartupScript to open a new window?
 
Ok I understand now

When the user goes back to a page on their browser using the back button they are loading that page from their cache and js code that belongs to it. At that point you have no control over that code unless you can tell they came to that page by clicking the back button

If user clicking the back button is a big problem for you then re-evaluate your design. Mainly the print button click event. This sounds like a submit button. Are you doing anything else in the click event handler besides creating the Javascript to register

Is there anyway that you can make the print button click event to be handled only on the client

Suresh


----- Lloyd Sheen wrote: ----

Ok, here is the sequence

1. User is on naviagation page
2. Select project from dropdown
3. Click print butto
4. On the Click handler I register the startup script
5. The navigation page stays and a new window (print page) pops up, ask
the user to confirm printing, upon printing the page closes (sometimes wit
user confirmation sometimes without
6. At this point the user will normally see the navigation page
7. User selects project and clicks Edit button
8. Edit screen pops up and user can edit project details

This is the point at which things get ..

9. If the user clicks the "Back to Navigator" button I do a redirect t
the page and all is good
10. If the user uses the GoBack IE toolbar button then the print pag
loads with user confirmation about print. The page closes (again sometime
with confirmation sometimes not)
11. If at any time the "Back to Navigator" button is clicked on any pag
causing the redirect back to the page things go back to ok

The problem is that I cannot get rid of the registered startup code

Lloyd Shee


the RegisterStartupScript to open a new windo
 
I took the javascript and HTML button route. The register startup seems
like too much trouble to implement.

Thanks for the help.

Lloyd Sheen
Suresh said:
Ok I understand now.

When the user goes back to a page on their browser using the back button
they are loading that page from their cache and js code that belongs to it.
At that point you have no control over that code unless you can tell they
came to that page by clicking the back button.
If user clicking the back button is a big problem for you then re-evaluate
your design. Mainly the print button click event. This sounds like a
submit button. Are you doing anything else in the click event handler
besides creating the Javascript to register?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top