Developer forum

Forum » Development » Server.Transfer

Server.Transfer

Martin Jensen
Reply

Hi

I have used the Server.Transfer function often in DW8 projects like this:

HttpContext.Current.Server.Transfer("/Default.aspx?ID=" + pageId , true);

Now in DW9 theres no Default.aspx file so the above line throws an error. 

Is there a way to make the function work in DW9 ?


Replies

 
Nicolai Pedersen
Reply

I do not understand why you would ever do that... As I remember it, that is classic asp feature that survived to asp.net.

Transfer executes another page reusing post/querystrings. There are many other ways that are much better and more 'modern'

Why not wrap your funcionality in a method and call it?

 
Martin Jensen
Reply

nvm.. found a solution! :)

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Great! You could use the Notifications.Fields.OnBeforeRender to add your values to the form after a normal redirect.

Votes for this answer: 1
 
Anders Ebdrup
Anders Ebdrup
Reply

My suggestion will be to use the ValidateUser-observer

 

You must be logged in to post in the forum