Url Routing Configuration How-to Xpedite

Oct 7, 2012 at 11:24 PM
Edited Oct 7, 2012 at 11:29 PM

Good Morning,

I am using the new Xpedite.
Configuration settings made ​​at that address as indicated below.
Site work that way.
I have a problem like this.

Stuff I use the url does not work .. Route
Global.asax content using a line like this

  System.Web.Routing.RouteTable.Routes.MapPageRoute ("page", "
page/ {pagename}. html", "~ / page.aspx");

I want to access the page

"http://xxxxx.com/page/cv.html"

Xpedite is lost when using compressed css and js file references. page does not open.

What should I do to solve this problem.

Oct 8, 2012 at 2:21 PM

Hi,

Can you please clarify 'page does not open'? In order to use Xpedite with a static HTML page, you must ensure that the stand-alone CSS/JS compression modules are registered in the Web.config file.

  <system.webServer>
    <handlers>
      <add name="CssMinifier" verb="GET,HEAD" path="*.css" type="Xpedite.Handlers.CssMinificationHandler, Xpedite, PublicKeyToken=a255fab67ac3163b"/>
      <add name="JavaScriptMinifier" verb="GET,HEAD" path="*.js" type="Xpedite.Handlers.JavaScriptMinificationHandler, Xpedite, PublicKeyToken=a255fab67ac3163b"/>
    </handlers>
  </system.webServer>

If you can provide more information, I will try to help further.

Best regards,

Chris

Oct 8, 2012 at 9:34 PM

Thank you
web config and global.asax Configurations are as follows.


webconfig

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="xpedite"
            type="Xpedite.Config.ConfigSectionHandler, Xpedite, PublicKeyToken=a255fab67ac3163b"
            requirePermission="false"/>
  </configSections>
  <xpedite mode="RemoteOnly">
    <css minifier="Xpedite.Minification.YuiCompressor.YuiCompressorCssMinifier,
                   Xpedite.Minification.YuiCompressor,
                   PublicKeyToken=a5fa8a719a542eb8" />
    <javascript minifier="Xpedite.Minification.YuiCompressor.YuiCompressorJavaScriptMinifier,
                         Xpedite.Minification.YuiCompressor,
                         PublicKeyToken=a5fa8a719a542eb8" />
  </xpedite>
   <connectionStrings>
  </connectionStrings>
   <appSettings>
  </appSettings>
  <system.web>
    <httpRuntime
    executionTimeout="90"
    maxRequestLength="25600"
    useFullyQualifiedRedirectUrl="false"
    minFreeThreads="8"
    minLocalRequestFreeThreads="4"
    appRequestQueueLimit="100"
    enableVersionHeader="true"
    requestValidationMode="4.0"/>
    <httpHandlers>

    </httpHandlers>
    <pages>
      <controls>

      </controls>
    </pages>
    <httpModules>

    </httpModules>
    <customErrors mode="RemoteOnly" defaultRedirect="~/Hata.html" />
    <compilation debug="false" targetFramework="4.0"/>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="UrlRoutingModule" />
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web,Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="" />
    </modules>
    <handlers>
      <add name="CssMinifier"
         verb="GET,HEAD"
         path="*.css" type="Xpedite.Handlers.CssMinificationHandler, Xpedite, PublicKeyToken=a255fab67ac3163b"/>
      <add name="JavaScriptMinifier"
           verb="GET,HEAD" path="*.js"
           type="Xpedite.Handlers.JavaScriptMinificationHandler, Xpedite, PublicKeyToken=a255fab67ac3163b"/>
 <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
  </system.webServer>
</configuration>


global.asax

<%@ Application Language="C#" %>

<script runat="server">

    void Application_Start(object sender, EventArgs e)
    {
        System.Web.Routing.RouteTable.Routes.MapPageRoute("Fotograf", "Fotograf/Fotograf.html", "~/Fotograf/Fotograf.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("Hata", "Hata.html", "~/Hata.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("Yonetim", "Yonetim.html", "~/Yonetim/Default.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("Anasayfa", "Anasayfa.html", "~/Default.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("Sayfa", "Sayfa/{sayfa}.html","~/Sayfa.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("Urun", "urun.html", "~/Urun.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("UrunDetay", "Urun/{ad}.html", "~/Urun.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("UrunDetay2", "Urun/{no}/{ad}.html", "~/Urun.aspx");

          System.Web.Routing.RouteTable.Routes.MapPageRoute("Bimskaynak", "bimskaynak.html", "~/Bimskaynak.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("BimskaynakDetay", "Bimskaynak/{ad}.html", "~/Bimskaynak.aspx");
          System.Web.Routing.RouteTable.Routes.MapPageRoute("BimskaynakDetay2", "Bimskaynak/{no}/{ad}.html", "~/Bimskaynak.aspx");

    }
   
    void Application_End(object sender, EventArgs e)
    {
        //  Code that runs on application shutdown
    }
       
    void Application_Error(object sender, EventArgs e)
    {
        // Code that runs when an unhandled error occurs
        //if (Convert.ToBoolean(ConfigurationManager.AppSettings["HataGosterilmeDurum"]))
        //{
        //    Response.Redirect("~/Hata.html");   
        //}
    }

    void Session_Start(object sender, EventArgs e)
    {
        // Code that runs when a new session is started

    }

    void Session_End(object sender, EventArgs e)
    {
        // Code that runs when a session ends.
        // Note: The Session_End event is raised only when the sessionstate mode
        // is set to InProc in the Web.config file. If session mode is set to StateServer
        // or SQLServer, the event is not raised.

    }
      
</script>
<script>// <![CDATA[ void Application_Start(object sender, EventArgs e) { System.Web.Routing.RouteTable.Routes.MapPageRoute("Fotograf", "Fotograf/Fotograf.html", "~/Fotograf/Fotograf.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("Hata", "Hata.html", "~/Hata.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("Yonetim", "Yonetim.html", "~/Yonetim/Default.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("Anasayfa", "Anasayfa.html", "~/Default.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("Sayfa", "Sayfa/{sayfa}.html","~/Sayfa.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("Urun", "urun.html", "~/Urun.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("UrunDetay", "Urun/{ad}.html", "~/Urun.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("UrunDetay2", "Urun/{no}/{ad}.html", "~/Urun.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("Bimskaynak", "bimskaynak.html", "~/Bimskaynak.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("BimskaynakDetay", "Bimskaynak/{ad}.html", "~/Bimskaynak.aspx"); System.Web.Routing.RouteTable.Routes.MapPageRoute("BimskaynakDetay2", "Bimskaynak/{no}/{ad}.html", "~/Bimskaynak.aspx"); } void Application_End(object sender, EventArgs e) { // Code that runs on application shutdown } void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs //if (Convert.ToBoolean(ConfigurationManager.AppSettings["HataGosterilmeDurum"])) //{ // Response.Redirect("~/Hata.html"); //} } void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started } void Session_End(object sender, EventArgs e) { // Code that runs when a session ends. // Note: The Session_End event is raised only when the sessionstate mode // is set to InProc in the Web.config file. If session mode is set to StateServer // or SQLServer, the event is not raised. } // ]]></script>

Oct 9, 2012 at 12:01 AM

Hi,

To explicitly confirm, you are mapping page routes for a classic web-forms application, and those web forms are set-up using the Xpedite Web controls?

If I define a custom route based on the example shown in your sample code:

routes.MapPageRoute("Test", "Test/Default", "~/Test/Default.aspx");

using the sample Default.aspx from SampleWebApplication, everything runs as I would expect (environment is VS2010, MVC3 and .NET 4).

Perhaps the specific error message you are receiving would help.

Thank you,

Chris