More in this section

Forums / Developing with Sitefinity / ComboBox not working when aspx page not in url

ComboBox not working when aspx page not in url

8 posts, 0 answered
  1. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    08 Jan 2009
    Link to this post
    Here's a strange one...

    I've created a Module using a standard ascx user control. This user control is almost identical to the Rad Controls for AJAX Multiple ComboBox sample. Dropped on my page it works perfectly when the url is http://localhost/site/home.aspx  but if I go to http://localhost/site/ the page and all controls load fine, but the second combo box that needs to get it's items after the selction of the first just displays "loading..." and never gets any data. When the actual aspx page in the url everything works as it should.

    Any ideas?

    Thanks in advance,
    Phill
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Jan 2009
    Link to this post
    Hi Phill Hodgkinson,

    Thank you for using our services.

    I think that the problem could be in the client script. You could try to find the combo boxes as arrays:

    Example below:

    var combo2 = Telerik.Web.UI.RadComboBox.ComboBoxes[1];

    Telerik.Web.UI.RadComboBox.ComboBoxes is array which collects boxes on the page. You could find the following article useful Finding combobox on the client-side.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    09 Jan 2009
    Link to this post
    Hi Ivan, thanks for helping out.

    The issue isn't that the ComboBox can't be found on the client side. As per the sample with Multiple ComboBoxes I run the following JS function when the parent Combo OnClientSelectedIndexChanging is fired. 

     

    function loadDevicesByMake(sender, eventArgs) {

    var item = eventArgs.get_item();

    deviceModelsCombo.set_text("Loading Devices...");

    deviceModelsCombo.requestItems(item.get_value(), false);

    }

    This function sets the text of the last combobox to "Loading Devices...." just fine, the issue seems to be that the requestItems doesn't cause server side data retrieval to fire. Once again, it's really strange that this works perfectly when the url is http://site/page.aspx  but doesn't work when it's http://site/ 

    Thanks again for your help!

    Phill

     

  4. Simon
    Simon avatar
    1 posts
    Registered:
    17 Jan 2017
    20 Jan 2009
    Link to this post
    Hi Phill Hodgkinson,

    We tried to reproduce this issue at our side however without success. The ComboBox's load on demand mechanism may hang in the way you have described it if the Form's action points to another page (not the one hosting the ComboBox). Could you please verify whether this is happening or not at your side?

    In any case, it would be really helpful if you could isolate the issue into a small running project and send it to us to examine it thoroughly. Alternatively you could send us a UserControl where the issue could be seen, as well as the URL rewriting rules you are using.

    Finally a screenshot of the FireBug's Net tab including all requests from opening of the page to requesting the Items in the ComboBox will help a lot in investigating the issue.

    Thank you in advance for your understanding and co-operation.

    Regards,
    Simon
  5. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    30 Nov 2009
    Link to this post
    Hi there,

    Bringing back an old thread from the dead. The original issue never went away for me and I can still reproduce it, I was just pressed for time and went with a non-Telerik solution for my combo boxes to get around the issue. I'm however wishing I hadn't left it as I'm having a very similar issue again.

    I'm working on a site and for SEO purposes I have set redirectToHomePage="False" in the cms section of the web config so that when landing at the home page of the site it's just www.name.com and not www.name.com/homepage.aspx . In the original issue the combo boxes wouldn't fire if there was no page name in the url. I'm now having an issue where I use some custom controls that use Linq to SQL. When there's no page name in the url the linq DataContext object always returns null. So a simple call like this:

    public static int GetItemCount() 
        myDataContext dc = new myDataContext(); 
        int itemCount = (from t in dc.TableOfItems 
                  where t.ItemTypeID.Equals(1) 
                  select t).Count(); 
            return itemCount; 

    dc will always be null. However if I simply add the name of the page to the url it works again. I really have no idea what's going on here, it must be some Sitefinity handler as this same code works fine outside of Sitefinity, and it also works fine with a page name. What happens when there's no page name? What is Sitefinity doing different when there's no page vs. when there is a page?

    Any help would be greatly appreciated as it's driving me nuts!
    Thanks again,
    Phill
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    01 Dec 2009
    Link to this post
    Hi Phill Hodgkinson,

    Can you use a different approach for the landing page to see whether this will work. Try to remove the redirectToHomePage property from the <cms> section. Then in through VS create a homepage.aspx in the root of your site and in IIS Manager add another default document name (homepage.aspx) as in attached image.

    If this does not work can you, please do as requested before. Zip up a project and send it to us through a support ticket so that we can examine it closely.

    Regards,
    Radoslav Georgiev
    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.
  7. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    01 Dec 2009
    Link to this post
    Hi Radoslav,

    Thanks for getting back to me. If I'm not mistaken removing  redirectToHomePage from the <cms config section is the same as setting it to true. This means that it will automatically redirect to homepage.aspx (whether the physical file exists or not) and in this scenario it works. That said I did follow your steps, I added the default doc "homepage.aspx" to IIS, I added an empty physical file of the same name to the root of my site and it works. This is no surprise though as the site automatically redirects to the homepage with the redirectToHomePage removed. However my desired behaviour is to be able to land at www.sitename.com/ and not have to have "homepage.aspx" added on (or any page name). So if I add redirectToHomePage="False" back it then breaks again, regardless of having the new default doc added to IIS. So I'm not sure what this tells us, if anything.

    I can package up my project but it's a considerable size, what's the limitation for attachment in support ticket? 

    Thanks again,
    Phill
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    02 Dec 2009
    Link to this post
    Hi Phill Hodgkinson,

    Thank you for getting back to me.

    I am sorry to hear that this workaround did not work for you. I have suggested this because, if those steps are done the site lands on the home page, however the URL stays as you want it www.site.com, and not www.site.com/homepage.aspx. Any way if you set a blank project and then add your custom functionality so the issue is reproducible and zip the project there would be no problem attaching this blank project to a support ticket (I do not think we need the DB and other custom functionality that you have which does not relate to this issue). You can also ftp this zip archive to a live site and give us the URL, once we download the project we will get back to you so you can take the file offline.

    Thank you for your cooperation in advance. Looking forward for your response.

    Best wishes,
    Radoslav Georgiev
    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.
Register for webinar
8 posts, 0 answered