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

Selected Value on IE back button

2 Answers 92 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
pmessina
Top achievements
Rank 1
pmessina asked on 03 Oct 2008, 04:29 PM
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 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 06 Oct 2008, 07:21 AM
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.
0
Maria
Top achievements
Rank 1
answered on 02 Mar 2009, 09:18 AM
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.
Tags
ComboBox
Asked by
pmessina
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Maria
Top achievements
Rank 1
Share this question
or