Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Unnamed
Sunday, May 13th, 2012 at 12:34:22pm MDT 

  1. <%@ Application Language="C#" %>
  2. <%@ Import Namespace="System.Web.Routing" %>
  3.  
  4. <script runat="server">
  5.  
  6.         public static void RegisterRoutes(RouteCollection routes)
  7.         {
  8.                 //http://www.yazilimdevi.com/yazilimdevi/Makaleler-938-asp-net-4-0-url-routing.aspx
  9.                 routes.MapPageRoute("product", Class.Fonksiyonlar.Genel.OzelAyar("URL") + "-product/{UrunID}-{UrunKod}-{Urun}", "~/product.aspx");
  10.                 routes.MapPageRoute("tag", "tag/{Tag}", "~/products.aspx");
  11.                 routes.MapPageRoute("brand", "brand/{Brand}", "~/products.aspx");
  12.                 routes.MapPageRoute("categori", "categori/{CategoriID}-{Categori}", "~/products.aspx");
  13.                 routes.MapPageRoute("search", "search/{Kelime}", "~/search.aspx");
  14.                 routes.MapPageRoute("news", "news/{NewsID}-{news}", "~/news.aspx");
  15.         }
  16.        
  17.         void Application_Start(object sender, EventArgs e)
  18.         {
  19.                 #region Route Edilen Sayfalar
  20.                 Application.Lock();
  21.                 RegisterRoutes(RouteTable.Routes);
  22.                 Application.UnLock();
  23.                 #endregion
  24.  
  25.                 #region Route Edilen Sayfalar
  26.                 Application.Lock();
  27.                 RouteTable.Routes.Add("default", new Route(Class.Fonksiyonlar.Genel.OzelAyar("URL"), new PageRouteHandler("~/default.aspx")));
  28.                 RouteTable.Routes.Add("products", new Route(Class.Fonksiyonlar.Genel.OzelAyar("URL") + "-products", new PageRouteHandler("~/products.aspx")));
  29.                 RouteTable.Routes.Add("about", new Route("about-" + Class.Fonksiyonlar.Genel.OzelAyar("URL"), new PageRouteHandler("~/about.aspx")));
  30.                 RouteTable.Routes.Add("contact", new Route("contact-" + Class.Fonksiyonlar.Genel.OzelAyar("URL"), new PageRouteHandler("~/contact.aspx")));
  31.                 RouteTable.Routes.Add("allnews", new Route(Class.Fonksiyonlar.Genel.OzelAyar("URL") + "-news", new PageRouteHandler("~/news.aspx")));
  32.                 Application.UnLock();
  33.                 #endregion
  34.         }
  35.        
  36.         void Application_End(object sender, EventArgs e)
  37.         {
  38.         }
  39.  
  40.         void Application_Error(object sender, EventArgs e)
  41.   {
  42.   }
  43.  
  44.         void Session_Start(object sender, EventArgs e)
  45.         {
  46.         }
  47.  
  48.         void Session_End(object sender, EventArgs e)
  49.         {
  50.         }
  51.           
  52. </script>

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

fantasy-obligation