<%@ Application Language="C#" %> <script runat="server"> void Application_Start(object sender, EventArgs e) { // Code that runs on application startup System.Web.Routing.RouteTable.Routes.MapPageRoute("NewsDatils", "News/{pi}/{pt}", "~/ShowNews.aspx"); } void Application_End(object sender, EventArgs e) { // Code that runs on application shutdown }
بعد تو صفحه لینک اینجوری نوشتم
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# string.Format("/News/{0}/{1}",Eval("NewsID"),Eval("NewsTitle").ToString().Replace(" ","-")) %>' Text='<%# Eval("NewsTitle") %>'></asp:HyperLink>
int p = int.Parse(Page.RouteData.Values["pi"].ToString());
Cannot use a leading .. to exit above the top directory.