473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

RegisterStartupScript

Hello to all.

I have a question to make.

For example, I have to pages:

page1.aspx
page2.aspx

In page1.aspx I have one button (button1), that executes
the following code;

Dim strAlert as new stringBuilder

strAlert.Append("<script language='JavaScript'>")
strAlert.Append("window.alert('You are going to
page2.aspx');")
strAlert.Append("</script>")

In the other button (button2), I put this code:

Response.Redirect("page2.aspx")

The page2.aspx only has a picture.

I execute the project (F5).

My actions are:

First I click in button1, and it shows the alert, second
I click in the button2 to redirect to page2.aspx.

In the page2.aspx, I use the back in the browser, and go
to page1.aspx.

When I do this the alert is shown again.

I want to kwon if there is a way to prevent this
behaviour.

Thank you all.

Best wishes.

Ana Rita

Nov 22 '05 #1
0 706

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lukman | last post by:
Hi, Could you tell me about what is RegisterStartupScript, I try to understand from MSDN sample, but I still don't understand. Could you give me more simple sample ? and what is the purpose of...
6
by: Bill Jones | last post by:
I'm trying to use this.RegisterStartupScript to add some javascript to and aspx page that will run when the page is loaded. Does anyone know if this function only works in the Page_Load function? ...
11
by: Stan Sainte-Rose | last post by:
Hi, I m working on a user control. I need to use a Js file, I would like to know how to load the js file using RegisterStartupScript command from the user control. Also, if I load the same user...
3
by: Mike | last post by:
Hi, I am trying to resize a HTML table through Javascript. When the user control loads the first time, the table is resized, but then it doesn't anymore. I am using the following code in the...
2
by: Marshal Antony | last post by:
Hi, I have a problem with using Page.RegisterStartupScript to call some javascript code from ASP.NET using C# is not working in Netscape.It is working fine in Internet Explorer.Does anybody know...
0
by: rom | last post by:
my main aspx page has 3 user controls. they are all located in the same place of the page and each time i set the visibility of 2 of them to false and 1 to true. now, i want to use the...
7
by: sck10 | last post by:
Hello, I have the following sub in a class in my "App_Code" directory. The script is for setting focus on a particular control, but I get the error, "Name ClientScript Not declared". Also, I am...
3
by: MJP | last post by:
I have a button which kicks off the generation of a report after which the file will be downloaded. The report generation can take a long time, so client side onclick event of the button also...
3
by: Rob | last post by:
Hi, We've developed an ajax enabled web app which we're currently deploying to our production server. We use System.Web.UI.Page.RegisterStartupScript throughout the app, and all has worked well...
4
by: =?Utf-8?B?RHVuZTg4?= | last post by:
I've got some code that uses Page.ClientScript.RegisterStartupScript to call a javascript function from the Page_Load method in the code behind. The code works fine in IE but the javascript...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.