我有一段代码是放在一个BUTTON事件里写的,这个button是具有runat=server功能的,但是我现在不想回传服务器,然后我就发现了button里有个属性叫OnclientClick,请问我这段代码应该怎么修改才能写在onclientclick中正确? if (c == "")
{
Response.Write("<script language = javascript>alert(\"请选择一个客户!\")</script>");
}
if (c != "")
{ Response.Write("<script type='text/javascript'>window.open('/subsystem/DDM/projectname.aspx?clientID=" + Convert.ToInt32(clientId_lb.Text) + "','win1','height=500,width=500,left=400,edge=1,center=1,resizable=1,status=0,scrollbars=yes');</script>");
//Response.Write("<script type='text/javascript'>window.showModalDialog('/subsystem/DDM/projectname.aspx?clientID=" + DropDownList2.SelectedValue + "','win1','height=500,width=500,left=400,edge=1,center=1,resizable=1,status=0,scrollbars=yes');</script>");//
}
{
Response.Write("<script language = javascript>alert(\"请选择一个客户!\")</script>");
}
if (c != "")
{ Response.Write("<script type='text/javascript'>window.open('/subsystem/DDM/projectname.aspx?clientID=" + Convert.ToInt32(clientId_lb.Text) + "','win1','height=500,width=500,left=400,edge=1,center=1,resizable=1,status=0,scrollbars=yes');</script>");
//Response.Write("<script type='text/javascript'>window.showModalDialog('/subsystem/DDM/projectname.aspx?clientID=" + DropDownList2.SelectedValue + "','win1','height=500,width=500,left=400,edge=1,center=1,resizable=1,status=0,scrollbars=yes');</script>");//
}
解决方案 »
- dataset读取xml文件,再写入数据库,这代码哪里问题呢?
- Linq to sql 如何设置要连接的数据库?
- 关于调用32位动态链接库的问题
- 关于repotrviewer的报表呈现
- ERROR [07002] [Microsoft][ODBC Excel Driver] 参数不足,期待是 3
- (WinForm)怎样判断单击TreeView节点时是否是点中了checkbox(TreeView::CheckBoxs=true)?
- PostMessage发送F5
- 讨论:这两种连接方式,哪种好一些。
- 在C#的web应用程序中,如何做html中frame那样的分页效果
- 如何实现带*,?的匹配问题,可以具体点吗?
- 一个大难题?
- 求一正则表达试.谢谢
这样OnclientClick访问不到js
if (c== "")
{
alert("请选择一个客户!");
}
else if (c!= "")
{
window.open("Default3.aspx?clientID=" + string + ",'win1','height=500,width=500,left=400,edge=1,center=1,resizable=1,status=0,scrollbars=yes'");
}
string 是在前端抓到clientId_lb.Text的值
if (c== "")
{
alert("请选择一个客户!");
}
else if (c!= "")
{
window.open("Default3.aspx?clientID=" + string + ",'win1','height=500,width=500,left=400,edge=1,center=1,resizable=1,status=0,scrollbars=yes'");
}
string 是在前端抓到clientId_lb.Text的值