locked
URL Routing Problem RRS feed

  • Question

  • User-2062783045 posted

     Hi Friends,

     

                      I want to use routing in my .net application.I need to redirect to another page after login succeds.I set the controller as categories so that i need to redirect to categories page.If i call categories after login page cannot be displayes error occurs.When i gave categoire.aspx page is redirected successfully.The page name is categories.aspx.How can i sort out this .aspx problem.Please help me.I need it urgently.

     

     

    Wednesday, April 1, 2009 7:27 AM

All replies

  • User2050679644 posted

     can you give a bit more info on the error?

    Wednesday, April 1, 2009 7:52 AM
  • User-2062783045 posted

     In the Global.asax i given like that

     

    Routes.Add("AdminPage", new Route("{Categories}/{Action}/{*Parameter}", new MEOSimpleRouteHandler()));

     

    I need to call Categories.aspx page after login a user.Si gave in login click event to redirect to categories.aspx page as given below:-

     

    RouteValueDictionary parameters = new RouteValueDictionary { { "Categories", "Categories" }, { "Action", "View" },{"Parameter","1"} };
                                    VirtualPathData vpd = RouteTable.Routes.GetVirtualPath(null, parameters);
                                    string url = vpd.VirtualPath;
                                    Response.Redirect(url);

     But an error of page cannot be displayed is occur.

    But when i gave  the below code it works properly

     

    RouteValueDictionary parameters = new RouteValueDictionary { { "Categories", "Categories" }, { "Action", "View" },{"Parameter","1"} };
                                    VirtualPathData vpd = RouteTable.Routes.GetVirtualPath(null, parameters);
                                    string url = vpd.VirtualPath;
                                    Response.Redirect(url);

     

    What is the reason below.I want to given only using routing Categories to redirect to categories page but it will not works.Please help me.

     

    Wednesday, April 1, 2009 8:08 AM
  • User-2062783045 posted

     Hi Friends,

                        A Very Good Morning to all.Yesterday i post a query to you people.But no reply have came now itself please i need help urgently.I need to implement routing as users need but the problem i cant give users needful name for routing it only access pagename fully.

    Wednesday, April 1, 2009 11:56 PM