Lucky
Lucky

Reputation: 187

Transfering to a page in asp.net when routes are applied in webForms

I am using something like

server.transfer("~/student/Language-Certificate"); 

in a click event. but I get this error "Error executing child request for /Students/Language-Certificate."


note: from code behind something like this

MenuItem country = new MenuItem();
country.NavigateUrl = "~/Admin/Country/Add";

works fine.

how to use routes with server.transfer so that it redirects properly to the clean url address ?

Upvotes: 1

Views: 1009

Answers (1)

Lucky
Lucky

Reputation: 187

I have used

Response.RedirectToRoute("NameOfTheRoute");

and it works fine.

thanks to : http://www.dotnetfunda.com/articles/article1450-aspnet-40-routing.aspx

Upvotes: 1

Related Questions