Selected Value on IE back button

3 posts, 0 answers
  1. pmessina
    pmessina avatar
    13 posts
    Member since:
    Feb 2007

    Posted 03 Oct 2008 Link to this post

    I'm currently working on a form for user searching and have found an interesting behavior for the radcombobox. When a user searches the value of the selected dropdown I can get the value no problem. If the user then hits the back button the correct value is selected in the dropdown but when they search again the selected value is then changed to the first value in the list. I pasted some simple code below that works as I described. Is this a bug in the control? This is not how dropdownbox performs on the back button its selected value is its selected value.

    <

    telerik:RadScriptManager ID="sadsad" runat="server"></telerik:RadScriptManager>

    <telerik:RadComboBox ID="tst" runat="server">

    <Items>

    <telerik:RadComboBoxItem Text="TESTING" Value="" />

    <telerik:RadComboBoxItem Text="TESTING2" Value="TESTING2" />

    </Items>

    </telerik:RadComboBox>

    <asp:Button ID="tstButton" runat="server" Text="TEST" OnClick="tstButton_Click" />

    protected

    void Page_Load(object sender, EventArgs e)

    {

    }

    protected void tstButton_Click(object sender, EventArgs e)

    {

    System.Diagnostics.

    Debug.Write(tst.SelectedValue);

    }

  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 06 Oct 2008 Link to this post

    Hi ,

    I understand what the problem is.

    The reason for this behavior is that the browser caches the value of the input of RadComboBox. The input represents the Text property of RadCombobox. On the other hand, the browser does not cache the Value property of RadComboBox. .

    The solution I suggest is that you use the following code:

         <script type="text/javascript">  
           function pageLoad()  
           {  
                var combo1 = $find("RadComboBox1");  
                combo1.findItemByText(combo1.get_text()).select();  
                
                 
           }  
           </script> 


    Hope this helps.

    Regards,
    Rosi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maria
    Maria avatar
    13 posts
    Member since:
    Jul 2006

    Posted 02 Mar 2009 Link to this post

    Hello,

    I'm having the same issue with the back button and this solution is working in Internet Explorer.
    However, this doesn't working for me in Mozilla.
    Do you have a idea?

    Thank you,
    Maria.
Back to Top