Problem with URL Anchors and Autocomplete

4 posts, 1 answers
  1. John Fetherolf
    John Fetherolf avatar
    17 posts
    Member since:
    Sep 2008

    Posted 08 Jan 2010 Link to this post

    I am seeing an issue when trying to manually auto-complete a combobox on a page that has an anchor in the URL

    My url is like EditOrder.aspx?o=10000#editedItem

    In my page I have a method:
            protected int GetQueryStringID(string qryParam) {  
                int retVal = 0;  
     
                if(Request.QueryString[qryParam] == null || Int32.TryParse(Request.QueryString[qryParam], out retVal) == false)  
                    retVal = 0;  
     
                return retVal;  
            }  
     

    From a java script call in a Rad Combobox I am
     
    //  Force the server-side populate once the combobox is fully opened.  
    function OnItemNumberOpened(sender, eventArgs) {  
        var cb = sender;  
        cb.requestItems(cb.get_text(), false);  
    }  
     

    When this call happens Request.QueryString["o"] = "10000#" causing the page to fail.  Other Ajax calls on this page are working just fine.  I have worked around it by stripping off everything after the "#", but I was just wondering if this was a know issue with the ComboBox control and if it would be fixed in an upcoming release?

    Using IE7 BTW.

    Thanks,
    Kevin M. Betts
    Web Developer
    Kimball Midwest
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 10 Jan 2010 Link to this post

    Hi John Fetherolf,

    Can you describe how the page fails in this case? Do you expect to receive the whole query string with the '#xxx' ending and does the ItemsRequested event handler logic depend on this value?

    Best wishes,
    Simon
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. John Fetherolf
    John Fetherolf avatar
    17 posts
    Member since:
    Sep 2008

    Posted 11 Jan 2010 Link to this post

    It fails because Int32.TryParse() chokes on the "#". 

    I am specifically trying to pull an integer value out of the query string parameter.  In most instances the Request.QueryParams["o"] would only return the "10000" not "10000#".  I had to put in extra code into GetQueryStringID() to strip off everything after and including the "#".

    In other words, I think the control is incorrectly sending the "#" through to the AJAX request on the postback.  As I undertand it anchors on the URL should only be a browser thing, and shouldn't be seen by the server-side code.

    Thanks,
    Kevin M. Betts
    Web Developer
    Kimball Midwest
  5. Answer
    Simon
    Admin
    Simon avatar
    2281 posts

    Posted 11 Jan 2010 Link to this post

    Hi John,

    Thank you for clarifying.

    Indeed this is a bug and I logged it in our bug-tracking system as well as updated your Telerik points for reporting it.

    All the best,
    Simon
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top