This is a migrated thread and some comments may be shown as answers.

Problem with URL Anchors and Autocomplete

3 Answers 51 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
John Fetherolf
Top achievements
Rank 1
John Fetherolf asked on 08 Jan 2010, 08:22 PM
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

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 10 Jan 2010, 03:08 PM
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.
0
John Fetherolf
Top achievements
Rank 1
answered on 11 Jan 2010, 01:57 PM
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
0
Accepted
Simon
Telerik team
answered on 11 Jan 2010, 03:03 PM
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.
Tags
ComboBox
Asked by
John Fetherolf
Top achievements
Rank 1
Answers by
Simon
Telerik team
John Fetherolf
Top achievements
Rank 1
Share this question
or