I am try use routing concept

∥☆過路亽.° 提交于 2019-12-12 01:35:21

问题


I am try use routing concept.I want to show url accoding to page.all pages are created by dynamic. Everypage have it's own unique id.I know about basic concerpt

I am adding global.asax file

void Application_Start(object sender, EventArgs e) 
{

    RegisterRoutes(System.Web.Routing.RouteTable.Routes);

}
void  RegisterRoutes(System.Web.Routing.RouteCollection routes)
{

    routes.MapPageRoute("Home", "home1", "~/default.aspx");
    routes.MapPageRoute("Home", "home2", "~/default2.aspx");


}

and C# coading

   RouteValueDictionary para = new RouteValueDictionary { {"","" } };
   VirtualPathData abc = RouteTable.Routes.GetVirtualPath(null,"home",para);
   hyper.NavigateUrl = abc.VirtualPath;

My question is how i get the page id from database and where i can pass this value...

来源:https://stackoverflow.com/questions/15944852/i-am-try-use-routing-concept

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!