我在这里有这个代码。选择的索引是我的C#程序中的文本框。我的问题是在将SelectedIndex的文本传送给函数之前,需要点击两次Show Popup按钮。我真的不知道它是否因为getElementByID()。innerHTML()。 Javascript getElementByID()。innerHTML()在第二次点击上工作
<asp:Button ID="Button1" runat="server" Text="Show Popup"
OnClientClick="ShowPopUp('#SelectedIndex');" onclick="Button1_Click1" />
<script type="text/javascript">
ShowPopUp = function() {
var x = document.getElementById('<%=SelectedIndex.ClientID %>').innerText;
window.showModalDialog('CopyFiles/'+x, window, 'dialogWidth:800px;dialogHeight:800px;center:yes;resizable:0;status:0;scrollbars:no;menubar:0;titlebar:no;toolbar:0;');
}
的人?谁能帮我? :X预先感谢。
糟糕的设计 - 在您按下按钮,在打开的窗口,充分回发指数变化A.您再按一次,现在你得到了A,现在的窗口中正确打开,但你有一个更多回帖。重新设计你的步骤。 – Aristos 2013-04-26 01:59:10