Javascript 打开新窗口,在aspx页面的onClientClick of按钮上传递dropdownlist的文本和值

Javascript 打开新窗口,在aspx页面的onClientClick of按钮上传递dropdownlist的文本和值,javascript,vb.net,Javascript,Vb.net,我正在使我的网站与所有浏览器兼容。为此,在一个页面上,我从dropdownlist中选择名称,单击查看(按钮),我想打开一个新窗口。我还想在新窗口上发送ddl的值和文本 所有这些我都想在onClientClick或onClick的按钮上完成 为了获取值,我尝试了以下代码: input name="button1" type="button" id="btnview" style="cursor:hand" class="Buttons" title="View" value="View" o

我正在使我的网站与所有浏览器兼容。为此,在一个页面上,我从dropdownlist中选择名称,单击查看(按钮),我想打开一个新窗口。我还想在新窗口上发送ddl的值和文本

所有这些我都想在onClientClick或onClick的按钮上完成

为了获取值,我尝试了以下代码:

 input name="button1" type="button" id="btnview" style="cursor:hand"  class="Buttons" title="View" value="View" onclick="alert(document.all('<%=ddlScheme.ClientID%>').value);" 
input name=“button1”type=“button”id=“btnview”style=“cursor:hand”class=“Buttons”title=“View”value=“View”onclick=“alert(document.all(“”).value);”
(此代码使用角括号<和/>)

我得到了一个带有值的警报。我只是想先提醒值和文本,以便在初始级别检查代码

为了获取ddl的文本,我尝试了:

onclick="alert(document.all('<%=ddlScheme.ClientID%>')(document.all('<%=ddlScheme.ClientID%>').selectedIndex).text)  
onclick=“警报(document.all(“”)(document.all(“”).selectedIndex.text)
改变只在onClick中,这里我没有得到文本。基本上我必须这样做,我不知道我是否正确

OnClick="window.open('../Reports/ReportCourtCaseDetail.aspx?SchemeId=' + document.getElementById('ddlScheme').value + "&SchemeName=" + document.all('<%=ddlScheme.ClientID%>')(document.all('<%=ddlScheme.ClientID%>').selectedIndex).text' ,'newWindow_CourtCaseDetail','location=no,fullscreen=no,menubar=no,titlebar=yes,status=no,toolbar=no,scrollbars=yes,resizable=yes');
OnClick=“window.open(”../Reports/ReportCourtCaseDetail.aspx?SchemeId=”+document.getElementById('ddlScheme').value+”&SchemeName=“+document.all(“”)(document.all(“”).selectedIndex.text’,'newWindow\u CourtCaseDetail','location=no,fullscreen=no,menubar=no,titlebar=yes,status=no,toolbar=no,scrollbars=yes');

但是通过这段代码,我没有得到任何新窗口。

要获得所选值,请尝试以下方法:

document.getElementById('<%=ddlScheme.ClientID%>').options[document.getElementById('<%=ddlScheme.ClientID%>').selectedIndex].value;
document.getElementById(“”).options[document.getElementById(“”).selectedIndex].value;