locked
Problem with ajax CascadingDropdownlist and URLrewrite RRS feed

  • Question

  • User1913822523 posted

    I assume I shall post it here and not in Ajax forum. Some kind and smart soul PLEASE figure this out. URLrewrite works perfectly but I seem to be missing some excluding file-extention to make the ajax CascadingDropdownlist work. Now the browser freezes for about a minute and then display wrong values in dropdownlist. Without URLrewrite it works perfect. I tried to add .asmx in the first rewrite but that didnt help.

    WEB.CONFIG

    <rewriter>
        <rewrite url="^(/.*(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.axd)(\?.*)?)$" to="$1" processing="stop" />
        <rewrite url="~/(.+).aspx" to="~/$1.aspx" processing="stop" />
        <rewrite url="~/(.+)" to="~/default.aspx?category=$1" processing="stop" />
    </rewriter>

    DDL.ASPX

    <ajaxToolkit:CascadingDropDown ID="cdd" runat="server" EnableViewState="False"
                TargetControlID="ddlitem"
                Category="Items"
                LoadingText="[Loading...]"
                ServicePath="~/Dropdown.asmx"
                ServiceMethod="GetItem"
                PromptText="- select item -" />
     
            <asp:DropDownList ID="ddlitem" Width="150px" runat="server"></asp:DropDownList>

    DROPDOWN.ASMX

    <%@ WebService Language="VB" CodeBehind="~/App_Code/Dropdown.vb" %>


    DROPDOWN.VB


    Public Class Dropdown
        Inherits System.Web.Services.WebService
    
        <WebMethod()> _
        Public Function GetItem(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
            Return New CascadingDropDownNameValue() _
                {New CascadingDropDownNameValue("abc", "abc"), New CascadingDropDownNameValue("abc", "abc"), New CascadingDropDownNameValue("abc", "abc")}
        End Function
    End Class



    Saturday, October 10, 2009 4:55 PM

Answers

  • User2130758966 posted

    You could use the unless tag:

    like:

    <rewriter>
      <unless url="^/Dropdown.asmx">
        <rewrite url="^(/.*(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.axd)(\?.*)?)$" to="$1" processing="stop" />
        <rewrite url="~/(.+).aspx" to="~/$1.aspx" processing="stop" />
        <rewrite url="~/(.+)" to="~/default.aspx?category=$1" processing="stop" />
      </unless>
    </rewriter>


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 10, 2009 5:47 PM
  • User1913822523 posted

    thanks for the link!


    I think I got it now with <if url="">  so far so good. thanks!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 10, 2009 6:24 PM

All replies

  • User2130758966 posted

    You could use the unless tag:

    like:

    <rewriter>
      <unless url="^/Dropdown.asmx">
        <rewrite url="^(/.*(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.axd)(\?.*)?)$" to="$1" processing="stop" />
        <rewrite url="~/(.+).aspx" to="~/$1.aspx" processing="stop" />
        <rewrite url="~/(.+)" to="~/default.aspx?category=$1" processing="stop" />
      </unless>
    </rewriter>


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 10, 2009 5:47 PM
  • User1913822523 posted

    Sounds promising, but I get this error when trying. Any idea why?


    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The element 'unless' is not allowed.

     

    Saturday, October 10, 2009 5:53 PM
  • User1913822523 posted

    thanks for the link!


    I think I got it now with <if url="">  so far so good. thanks!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 10, 2009 6:24 PM