ASP.NET DROPDOWNLIST在iFrame中不起作用 [英] ASP.NET DROPDOWNLIST not work inside iFrame

查看:92
本文介绍了ASP.NET DROPDOWNLIST在iFrame中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.

我在iframe中的另一个aspx上有一个aspx页面.在iframe内的页面上的DropDownList总是在selectedindexchange事件,buttonclick事件上返回selectedindex = 1,...我不知道该怎么办...请帮助.

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.

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



在JS中,我设置src并显示该iframe,



In JS I set src and show that iframe,

var eleFrame = document.getElementById('frame');
eleFrame.src = 'TransportProvidersAddnew_ModifyExisting.aspx?operation=Add';
eleFrame.style.display = "block";



但这并不重要,因为页面shiow属性,TextBoxes工作属性(它们将文本保存在事件中),但是DropDown每次都具有selectedindex = 1;



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 ;

推荐答案

请检查您是否在代码中的某处重新设置了DropDownList的值.
IFrame没有任何此类问题.
Please check if you are re-setting the value of DropDownList somewhere in your code.
IFrame doesnot have any such issue.


此问题与IFrame无关,这是绑定DropDownList的问题,每次页面重新加载时,绑定DropDownList都会被绑定.

因此,将绑定逻辑放在!IsPostBack属性中.
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.


它是f. DropDown绑定错误:
不同的文本,相同的值...
It was f. mistake of DropDown binding :
different texts ,the same values ...


这篇关于ASP.NET DROPDOWNLIST在iFrame中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆