Click here to Skip to main content
13,004,839 members (70,127 online)
Rate this:
Please Sign up or sign in to vote.
See more:

my site url would be like this if the user gives like it should be redirected to some survey which contains questions. how can i impliment this. i need to get string from that url like questions.

in global.asax i added

       routes.MapPageRoute("route", "{Employee}", "~/Employee/test.aspx");

i am still facing this problem, help me in this aspect...

Thanks in advance..
Posted 15-Jan-13 23:20pm
Updated 13-Jun-13 0:31am
Sandeep Mewara 16-Jan-13 8:49am
You tried and what? Where exactly you need help?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

URL Patterns for the Routing should help you, and even you could use HttpModules

Please let us know if Routing worked for you

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You can use the following function in your Global.asax file

private static void RegisterRoutes(RouteCollection routes)
         //routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
             "Default", // Route name
             "{controller}/{action}/{id}", // URL with parameters
             new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults

and initialize the function in your Application_Start Event.

Hope this will work
07405 16-Jan-13 23:51pm
Thanks for ur reply...
my project does not contain folder. by giving url like this it should be redirected to questions page. if the url is like this it should be redirected to doctors page... based on the last string it should be redirected. in this way users can search whatever word they want. help me in this aspect..

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 13 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100