Hi
I used url routing in my site:
global.aspx:
static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("CustomerDetails", "Mostanad/{UrlName}", "~/mostanad.aspx");
routes.MapPageRoute("Software", "Software/{Secondclass}", "~/software.aspx");
routes.MapPageRoute("Softwareinfo", "Software/SoftwareInfo/{UrlName}", "~/softwareinfo.aspx");
routes.MapPageRoute("LearningFilm", "LearningFilm/{Secondclass}", "~/film.aspx");
routes.MapPageRoute("FilmInfo", "LearningFilm/FilmInfo/{UrlName}", "~/filminfo.aspx");
}
I define it for some pages...
and I put megamenu in pages below is code:
<li><a href="#">گرافیک و فیلم</a>
<div id="mega6">
</div>
<ul>
<asp:Repeater ID="RptZaban1" runat="server">
<ItemTemplate>
<li><a href='LearningFilm/<%#Eval("Secondclass")%>' target="_blank">
<%#Eval("Secondclass")%></a></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
</li>
in above code when I click on repeater's Item it will go to film.aspx according below code:
routes.MapPageRoute("LearningFilm", "LearningFilm/{Secondclass}", "~/film.aspx");
and url address will be:
http://localhost:26196/LearningFilm/waterfall
now in this page (film.aspx) I define other megamenu...
<li><a href="#">سیستم عامل</a>
<div id="mega7">
</div>
<ul>
<asp:Repeater ID="rptSystem" runat="server">
<ItemTemplate>
<li><a href='Software/<%#Eval("Secondclass")%>' target="_blank">
<%#Eval("Secondclass")%></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
</li>
here I want when click on Item from megamenu it go to software.aspx
routes.MapPageRoute("Software", "Software/{Secondclass}", "~/software.aspx");
so url address should be like:
localhost:26196/Software/media
but here url address is like:
localhost:26196/LearningFilm/Software/media
and make this error:
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
how I can solve it?
Best regards
Neda