473,385 Members | 1,492 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.

Strange behavior after Server.Transfer

Hi,

I am experiencing a behavior I can´t understand while building an ASP.NET 1.1 application.

I have two pages, Web1.aspx and Web2.aspx. On a button click event of Web1.aspx, I do a Server.Transfer to Web2.aspx. All is fine, since I am "passing parameters" among pages on the Context and it all works fine.

But then, on Web2.aspx I have another button, which I want to do certain things (not relevant so won´t describe them), BUT when I click on the button, before the click event handler is reached, the OnInit event is called on Web2.aspx again!!!

The problem is that on the initialization page I need code that depends on the Context from Web1.aspx, and on that second call the Context is lost so the initialization fails. I have also tried to set an attribute on the page to state when initialization is done (so as not to do it again after the first time... not pretty, I know :-), but it doesn´t work, it seems like a new Web2.aspx page is being instantiated.

I am pretty sure there is something I am not understanding about the Server.Transfer process. It may, in fact, be pretty basic, since I´m not that experienced with ASP.NET... but I´m going crazy! Any help will be MUCH appreciated.

Thanks,

Juanjo
Sep 23 '06 #1
0 979

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Justice Gray | last post by:
I have the following code encapsulated in an ascx page (user control): namespace MyCompany.Web.UserControls { string webform_namespace = this.GetType().Namespace.ToString(); } Now, when I...
3
by: marc.gibian | last post by:
I have a simple pair of ASP.NET pages, main.aspx and login.aspx. Main checks if there is an identity in the Session context, and if not does a Server.Transfer to login.aspx. So far, so good. Login...
0
by: | last post by:
Hi I am using a server.transfer trying to prevent the url of the loaded page being displayed. However, I found a strange behavior Here is the scenario step 1. page1 server.transfer to page 2...
2
by: thomson | last post by:
Hi all, I did a Server.Transfer from a page to another page, but surprisingly i could only view the quarter of the page , Only that much is rendered , the rest is the first page itself What...
0
by: js | last post by:
In my project I have both ASPX and classic ASP. Four things in question are the entry page(Main.aspx), the logon page(logon.ASP), .Net Session, legacy ASP Session. The Main.apsx contains a Logon...
1
by: Alexander Inochkin | last post by:
Hi! I found same strange behavior of ASP.NET. It is possible this is the bug. Follow the steps:
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
3
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table...
2
by: Antonio | last post by:
Good morning, everyone. Here is the strange behavior: I have a datagrid (dgPIs) with paging enabled. When I click to view any page in the grid, it runs the private void lnkIPReg method,...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.