Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 page first one is customer list page and second is customer page. from the home page search we got customer list page and from customer list page we go to the customer page, but when we search customer from home page will go on the customer list page but it redirect to the customer page automatically. plz ignore bad english

What I have tried:

in Global.asax file

<pre>  public static void RegisterRoutes(RouteCollection routeCollection)
        {
            routeCollection.MapPageRoute("CustomerList", "{DistrictName}/{Location}/{Code}.aspx", "~/CustomerList.aspx");
            routeCollection.MapPageRoute("Customer", "{StateName}/{DistrictName}/{CompanyName}/{UserName}", "~/Customer.aspx");

}




and from home page
Response.RedirectToRoute("CustomerList", new { DistrictName = strStateName, Location = strLocation, Code = CCode });


this redirect to customer page not on customer list page

I also use this on Customer List page to open customer page

<asp:HyperLink ID="hplCustomerLink" runat="server"  href='<%# GetRouteUrl("Customer", new {StateName = GetTitle(Eval("StateName")), DistrictName= GetTitle(Eval("DistrictName")), CompanyName= GetTitle(Eval("CompanyName")),UserName = GetTitle(Eval("UserName"))})%>' Text="View Detail"> </asp:HyperLink>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900