vcsharp
  •  vcsharp
  • 88.4% (Honored)
  • YAF Commander Topic Starter
2017-10-31T16:20:52Z
I am using RadEditor in YAF. The edtior renders properly and works except when editor tries to open a dialog like image properties dialog. The URLRewriter causes the url requested for the image dialog to be redirected to the default page of YAF.

All urls for RadEditor dialog will have the following string in them: Telerik.Web.UI.DialogHandler.aspx, but url will not end with this string.

What can I do to make sure that dialog requests from RadEditor are not intercepted by URLRewriter module?
Sponsor
vcsharp
  •  vcsharp
  • 88.4% (Honored)
  • YAF Commander Topic Starter
2017-11-02T07:25:29Z
I found out how to exclude a URL containing a specific string from URL rewriting. You have to include the specific string in the last rule in UrlRewriter.config file. This rule is as below. One needs to go to the if part of this rule and include the specific string in the list. For example, if you want to exclude a URL that contains Telerik then just add |Telerik to the end of the if list i.e. just after |ckfinder in the if list.

In my case, I added the specific string |Telerik\.Web\.UI\.DialogHandler just after |ckfinder.

What this rule is saying that if the URL does NOT contain any of the strings that are separated by | (pipe) character, then do URL rewriting processing according to what's within the if rule, else go to next rule; but, since this is the last rule and there is no next rule, so effectively no URL rewrite occurs.

   <if url="^((?!\.ashx|\.asmx|\.axd|\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|install|error|auth\.aspx|default\.aspx|popup\.aspx|advanced\.aspx|digest\.aspx|ftb.imagegallery\.aspx|ckfinder|Telerik\.Web\.UI\.DialogHandler).)*$">
    <rewrite url="^~/(.+)?\?(.+)?$" to="~/Default.aspx?g=$1&amp;$2" processing="stop" />
    <rewrite url="^~/(.+)?\.aspx$" to="~/Default.aspx?g=$1" processing="stop" /> 
    <rewrite url="^~/(.+)?$" to="~/Default.aspx?g=$1" processing="stop" />
  </if>
vcsharp
  •  vcsharp
  • 88.4% (Honored)
  • YAF Commander Topic Starter
2017-11-02T11:12:15Z
My last reply to this question will solve the issue, but I found another way of making sure that URL rewriter does not rewrite a URL containing Telerik.Web.Ui.DialogHandler.aspx. Just put the following rule at the top of other rules in URLRewriter.config file.

When you mention the following for the to attribute: to="$1", then the URL rewriter effectively does not rewrite the original URL.

  <rewrite url="^(/.*(Telerik\.Web\.UI\.DialogHandler\.aspx)(\?.*)?)$" to="$1" processing="stop" />

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved