Click here to Skip to main content
       

ASP.NET

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionProblem with MapPageRoutememberjrahma9-Nov-12 8:50 
Hi,
 
I have a contact.aspx page. I am able to go to it using this url:
 
http://www.JassimRahma.com/contact.aspx
 
but when I use this url it doesn't work:
 
http://www.JassimRahma.com/contact
 
I don't know why it's going to the message.aspx?
 
while other MapPageRoute works like home, news, etc
 
here is my global.asax:
 
routes.MapPageRoute("jassim_rahma_contact", "contact", "~/contact.aspx");
 
and I don't have anything in my Page_Load in contact.aspx.
AnswerRe: Problem with MapPageRoute PinmemberMarcus Kramer9-Nov-12 9:46 
It works both ways for me from here. Perhaps you have already fixed your issue. Smile | :)
I wasn't, now I am, then I won't be anymore.

GeneralRe: Problem with MapPageRoute Pinmemberjrahma9-Nov-12 9:50 
Yes, problem solved. here is the problem and solution.
 
This is my code:
 
public static void RegisterRoutes(RouteCollection routes)
{
    routes.MapPageRoute("jassim_default", "home", "~/Default.aspx");
    routes.MapPageRoute("jassim_default_arabic", "arabic", "~/Arabic.aspx");
    routes.MapPageRoute("jassim_cv", "cv", "~/cv.aspx");
    routes.MapPageRoute("jassim_skills", "skills", "~/skills.aspx");
    routes.MapPageRoute("jassim_projects", "projects", "~/projects.aspx");
    routes.MapPageRoute("jassim_experience", "experience", "~/experience.aspx");
    routes.MapPageRoute("jassim_news", "news", "~/news.aspx");
    routes.MapPageRoute("jassim_goto_news", "goto/{ID}", "~/goto.aspx");
    routes.MapPageRoute("jassim_goto_news_news", "news/{ID}", "~/goto.aspx");
    routes.MapPageRoute("jassim_goto_news_news_root", "{ID}", "~/goto.aspx");
    routes.MapPageRoute("jassim_tools", "tools", "~/tools.aspx");
    routes.MapPageRoute("jassim_speed", "speed", "~/netconn.aspx");
    routes.MapPageRoute("jassim_bmi", "bmi", "~/bmi.aspx");
    routes.MapPageRoute("jassim_browser", "browser", "~/browser.aspx");
    routes.MapPageRoute("jassim_myip", "myip", "~/myip.aspx");
    routes.MapPageRoute("jassim_age", "age", "~/age.aspx");
    routes.MapPageRoute("jassim_rahma_contact", "contact", "~/contact.aspx");
}
 
I just moved this line to the bottom and it worked:
 
routes.MapPageRoute("jassim_goto_news_news_root", "{ID}", "~/goto.aspx");
 
because I noticed all MapPageRoute below this line are not working.
 
I still don't know the reason for the problem but happy that my problem was solved.
 

Thanks...

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web04 | 2.6.130619.1 | Last Updated 20 Jun 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid