UrlRewriter and ProgressArea Conflicts

Thread is closed for posting
4 posts, 0 answers
  1. DGDev
    DGDev avatar
    42 posts
    Member since:
    Jul 2012

    Posted 19 Mar 2009 Link to this post

    Hi guys,
    I have read a few posts regarding this issue, however, there really isn't much information available.
    I'm currently working on a site within IIS7 using a modified version of urlrewriter.net's control.

    The differences mainly are that mine does not run at the BeginRequest of the HttpApplication pipeline, but rather the AuthorizeRequest.  This is done because mine is geared towards developers who would like to make use of ASP.NET forms authentication and membership/roles and offers rewriting conditionals for both.  Mine also contains an event PreRequestHandlerExecute() which sets a handler for the current Page's Page_Init event.  There is rewrites the url again so that the Form.Action is properly set automatically.

    The problem is that RadProgressArea won't display when the UrlRewriter is running. I am able to upload though.  I don't expect Telerik to really look deeply into this since it's not their problem per say, but I was hoping I could get some information as to how the RadUploadHttpModule works and how it's effected by rewriting.

    I've seen another post describing to add a new re-writing rule for Telerik.RadUploadProgressHandler.ashx
    like so:
    <rewrite url="^.*Telerik.RadUploadProgressHandler.ashx(.*)$" to="~/Telerik.RadUploadProgressHandler.ashx$1" />

    But this is not the problem with my rewriter. The website correctly finds the handler as I can see in FireBug:
    www.sitename.com/Telerik.RadUploadProgressHandler.ashx?RadUrid=93c3f63d-7407-4182-adc1-287dca70b614&RadUploadTimeStamp=1237462402048&

    However, it's response is always:
    var rawProgressData = {InProgress:false,ProgressCounters:false};

    Is there anyone who can elaborate as to what might cause this. How the RadUploadHttpModule works exactly.
    And if possible, what I should look for?
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 20 Mar 2009 Link to this post

    Hello DGDev,

    RadUpload progress module subscribes to a few events of the HttpApplication object:

            public void Init(HttpApplication app)
            {
                app.PreRequestHandlerExecute += new EventHandler(app_PreRequestHandlerExecute);
                app.PostRequestHandlerExecute += new EventHandler(app_PostRequestHandlerExecute);
                app.Error += new EventHandler(app_PostRequestHandlerExecute);
            }

    Perhaps your url rewriting module is using the same events. You can try changing the order of modules (when registering them in web.config).

    I hope this helps,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. DGDev
    DGDev avatar
    42 posts
    Member since:
    Jul 2012

    Posted 23 Mar 2009 Link to this post

    Thank you for the response, as it is much appreciated.
    After careful debugging, it seems that the ProgressArea does not like Intelligencia's UrlRewriter. (UrlRewriter.net)

    I should first note, that I prefer my url's extension-less, however, for the sake of debugging all scenarios, I tried both.

    First:
    Turned off my event handler for PreRequestHandlerExecute
    Instead I just manually modified the Form's Action url in the Page_Load
    protected void Page_Load(object sender, EventArgs e) 
        var context = HttpContext.Current; 
        MainForm.Action = String.IsNullOrEmpty(context.Request.ServerVariables["HTTP_X_ORIGINAL_URL"]) ? context.Request.RawUrl : context.Request.ServerVariables["HTTP_X_ORIGINAL_URL"]; 

    1. I tried setting my Rewriter to run at the BeginRequest() like most rewriters.
    2. Tried re-arranging the modules order within web.config.
    3. Tried rewriting using extension-less urls with runAllManagedModulesForAllRequests="true" in web.config
    Ex.
    Site.com/Library/Books   =>   Site.com/Projects/Library/Books.aspx
    4. Tried rewriting regular pages.
    Site.com/Library/Books.aspx   =>   Site.com/Projects/Library/Books.aspx

    However, if I postback the form to the actual page (non rewritten), everything works smoothly.
    It seems this might be a more difficult problem than I'd first imagined. I don't expect a follow-up from Telerik support team as i can't be positive this is a problem with the RadUpload control. But if any further help can be given, It would be more than welcome.

    Or possibly from others in the community here who make use of seo-friendly urls with Url Rewriting.
    Here is a link to my UrlRewriter if anyone would like to attempt debugging or use it.
    DGDev UrlRewriter

    A sample web.config to use it:
    NOTE: You do not need to add it to httpModules if you're using IIS7 unless you'd like the rewriter to work instide Cassini.

    <configSections> 
        <section name="rewriter" type="DGDev.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, DGDev.UrlRewriter" requirePermission="false" /> 
    </configSections> 
     
    <httpModules> 
          <add name="DGDev.UrlRewriter" type="DGDev.UrlRewriter.RewriterHttpModule, DGDev.UrlRewriter, Version=1.0.0.0, Culture=neutral" /> 
    </httpModules> 
     
    <rewriter> 
        <rewrite url="^(.*(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.axd)+(\?.*)?)$" to="$1" processing="stop" /> 
        <if url="^~/Library/?(.*)$"
          <!-- Begin Actual Pages --> 
          <rewrite url="^~/Library/Overview/?(.*)$" to="~/Projects/Library/Overview.aspx?$1" processing="stop" /> 
          <rewrite url="^~/Library/Share/?(.*)$" to="~/Projects/Library/Share.aspx?$1" processing="stop" /> 
          <!-- End Actual Pages --> 
          <!-- Begin Virtual Pages --> 
          <rewrite url="^~/Library/((.*)/){3}(.*)$" to="~/Projects/Library/Home.aspx?category=$2&amp;title=$3" processing="stop" /> 
          <rewrite url="^~/Library/((.*)/){2}(.*)$" to="~/Projects/Library/Home.aspx?category=$2&amp;title=$3" processing="stop" /> 
          <rewrite url="^~/Library/((.*)/){1}(.*)$" to="~/Projects/Library/Home.aspx?category=$2&amp;title=$3" processing="stop" /> 
          <!-- End Virtual Pages --> 
          <!-- Default --> 
          <rewrite to="~/Projects/Library/Home.aspx?$1" processing="stop" /> 
        </if> 
    </rewriter> 
     
    <system.webServer> 
        <validation validateIntegratedModeConfiguration="false" /> 
        <modules runAllManagedModulesForAllRequests="true"
          <add name="DGDev.UrlRewriter" type="DGDev.UrlRewriter.RewriterHttpModule, DGDev.UrlRewriter, Version=1.0.0.0, Culture=neutral" /> 
        </modules> 
    </system.webServer> 

  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 23 Mar 2009 Link to this post

    Hi DGDev,

    I suggest you open a support ticket and attach a running demo which demonstrates the problems you are experiencing. We will do our best to troubleshoot the web site and provide a solution. Thanks.

    All the best,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top