473,387 Members | 1,510 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,387 software developers and data experts.

Server.Transfer

I have a server.transfer question. I have a page that
utilizes the server.transfer method. On the page that is
transfered to - lets say page 2, I want to do another
server.transfer. This gives me the error:
System.InvalidCastException: Specified cast is not valid.

What is the proper way to do this type of page
navigation? Thanks - Drew
Nov 15 '05 #1
4 2459
Hi Drew,

I just did a test with 3 pages : webform1.aspx -- > webform2.aspx --<
webform3.aspx

where in the Page_Load of both webform1.aspx and webform2.aspx I do a
Server.Transfer and it worked fine, could you post part of the code where
the exception is risen,

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Drew" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
I have a server.transfer question. I have a page that
utilizes the server.transfer method. On the page that is
transfered to - lets say page 2, I want to do another
server.transfer. This gives me the error:
System.InvalidCastException: Specified cast is not valid.

What is the proper way to do this type of page
navigation? Thanks - Drew

Nov 15 '05 #2
"Drew" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
I have a server.transfer question. I have a page that
utilizes the server.transfer method. On the page that is
transfered to - lets say page 2, I want to do another
server.transfer. This gives me the error:
System.InvalidCastException: Specified cast is not valid.


It doesn't sound like a Server.Transfer problem so much as a type conversion
issue. By the way, I can conceive of no well-designed scenario where you
would actually want to do this. Server.Transfer should not be used to break
up code or control program flow - a terribly expensive way to do things. If
you need less code in your classes, then you should either use regions, or
abstract some of the code out to other classes.

R/
Nov 15 '05 #3
I am away from my home computer - I'll post the code
shortly.

But you can do server.transfer to go to multiple pages?

p1 -> -> p2 -> -> p3 -> -> p4

doing a server.transfer on each one.

Is that the proper practice for navigating web pages in c#?

Thanks.
-----Original Message-----
"Drew" <an*******@discussions.microsoft.com> wrote in messagenews:02****************************@phx.gbl...
I have a server.transfer question. I have a page that
utilizes the server.transfer method. On the page that is transfered to - lets say page 2, I want to do another
server.transfer. This gives me the error:
System.InvalidCastException: Specified cast is not
valid.
It doesn't sound like a Server.Transfer problem so much as a type conversionissue. By the way, I can conceive of no well-designed scenario where youwould actually want to do this. Server.Transfer should not be used to breakup code or control program flow - a terribly expensive way to do things. Ifyou need less code in your classes, then you should either use regions, orabstract some of the code out to other classes.

R/
.

Nov 15 '05 #4
Hi Drew ,

But you can do server.transfer to go to multiple pages?

p1 -> -> p2 -> -> p3 -> -> p4

doing a server.transfer on each one.
Yes, you can, I did that yesterday testing your problem
Is that the proper practice for navigating web pages in c#?


No, it's not, What are you trying to do?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Nov 15 '05 #5

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

Similar topics

6
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web...
4
by: Harsh Thakur | last post by:
Hi, I'd like to know the performance related differences between Response.Redirect and Server.Transfer. I'd like to redirect the user to a different page. I can either do a...
5
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user...
9
by: Mark | last post by:
Hello I'm trying to use a Server.Transfer in a try-catch (I cannot put it outside the Try-Catch as it is nested deep within a component that is called in a try-catch loop) The problem is that the...
5
by: Guadala Harry | last post by:
I've been reading up on Server.Transfer as well as doing some testing, and it appears to always raise the ThreadAbortException error. On one hand I've read a bunch of promotional-type material...
11
by: Alexander Bosch | last post by:
Hi, I'm having a problem similar to the one that's stated in this KB http://support.microsoft.com/default.aspx?scid=kb;en-us;839521 When I'm posting a page to itself with the bool value as true it...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
6
by: n# | last post by:
A Basic Question in ASP.NEt 1.1 In Page_Load Event I am doing a Server.Transfer. But it throws an error on the browser windows showing "Server Application Not Found" Pls help me
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
2
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi, I'm using Threads, and when I try to do Server.Transfer, I recieved an error. (child object does not exist...) My Code: Dim t As New Thread(AddressOf Hilo) Private Sub Hilo()...
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:
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.