안녕하세요 친구는 누구나이 문제를 해결할 수 있습니다. 저는 정말 견과를 읽었습니다. 기사와 자습서도 읽었으며 그에 따라 코딩도 완료했습니다. 점점 오류 메신저URL을 asp.net 4.0으로 재 작성
A route named 'xxxxx' ould not be found in the route collection.
Parameter name: name
글로벌 asax에게 있습니다 내가 버튼을 클릭 이벤트에 다음과 같이 아래로 코딩 한 페이지 test1
에서
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>
<script runat="server">
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("test2-testurl", "test2/{category}", "~/test2.aspx");
}
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
// Code that runs on application startup
}
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
}
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
</script>
:
protected void Button1_Click(object sender, EventArgs e)
{
string url = Page.GetRouteUrl("test2-testurl", new { category = "laptops" });
Response.RedirectToRoute(url);
}
감사 –