Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

I have a aspx page within iframe on another aspx. DropDownList on the page inside iframe always return selectedindex = 1, on selectedindexchange event, on buttonclick event... I dont know what to do ... Pls help.

XML
<iframe id="frame" width="100%" height="300">
</iframe>


In JS I set src and show that iframe,
C#
var eleFrame = document.getElementById('frame');
eleFrame.src = 'TransportProvidersAddnew_ModifyExisting.aspx?operation=Add';
eleFrame.style.display = "block";


but this is not important, becuse page shiow property, TextBoxes work property (they save text on the events), but DropDown in every time has selectedindex = 1 ;
Posted

It was f. mistake of DropDown binding :
different texts ,the same values ...
 
Share this answer
 
This problem is no way related with the IFrame, this is the problem of binding DropDownList which is getting binded every time whenever the page reload.

So put the binding logic in !IsPostBack property.
 
Share this answer
 
Please check if you are re-setting the value of DropDownList somewhere in your code.
IFrame doesnot have any such issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900