Click here to Skip to main content
11,580,580 members (69,327 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET

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
Edited 13-Jun-13 0:31am
Sandeep Mewara at 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 at 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
0 OriginalGriff 1,088
1 Sergey Alexandrovich Kryukov 750
2 Abhinav S 638
3 Suvendu Shekhar Giri 433
4 F-ES Sitecore 420

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 13 Jun 2013
Copyright © CodeProject, 1999-2015
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