下拉框选中某一项后,比如我选中“新建”,怎么弹出新窗体,并把下拉框的名字传给新的窗体?
解决方案 »
- 如何循环读取自动生成的text控件的值
- AJAX 调用WCF问题
- 请教CKEditor编辑时自动加上 的问题
- 关于IIS中挂网站的问题
- 在ASP.NET的Web Service中不能使用SESSION?
- asp.net让人很崩溃javascript的问题
- -----------有谁知道www.163.com的SMTP服务器呀?------------------------
- 可否直接从VS.NET 2002升级到VS.NET 2003
- “visual web developer 2005”写的ASP.NET 2.0程序如何才能变成1.1呢??
- ASP.NET中的函数怎么用??
- 页面回转后如何控制JS角本
- 自己写的.net站点和DVBBS的统一登录
下拉框的名字传给新窗体 只是变量传递的问题了。
windows.open() 也可以。
window.showmodaldialog
都可以
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if(DropDownList1.SelectedValue.ToString()=="新建")
{
Response.Write("<script>window.open('你弹出的窗口.aspx?id='"+DropDownList1.SelectedValue.ToString()+"'','newwindow','height=300,width=500,top='+(screen.AvailHeight-300)/2+',left='+(screen.AvailWidth-300)/2+',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')</script>;")
}
}
<asp:DropDownList ID="dd1" runat="server" onchange="showform(this);" Width="100px">
<asp:ListItem>asdfasdf</asp:ListItem>
</asp:DropDownList>.js
function showform(obj)
{
var n = obj.selectedIndex;
var txt = obj.options[n].text;
var value = obj.options[n].value
if(tx == "新建")
{
window.showmodaldialog(url + "?id=" + obj.id);
}
}