void Sumbit_Form()
{
string pro_name=Request.Form["pro_name"];
string pro_kind=Request.Form["pro_kind"];
string name=Request.Form["name"];
string tel=Request.Form["tel"];
string province=Request.Form["province"];
string city=Request.Form["city"];
string address=Request.Form["address"];
string postcode=Request.Form["postcode"];
string email=Request.Form["email"];
string re=Request.Form["re"];
if (pro_name=="") Response.Write("<script language=javascript>alert('产品名称');history.go(-1)</script>");
}
</script>编译器错误信息: CS1010: 常数中有换行符源错误:
行 28: string re=Request.Form["re"];
行 29:
行 30: if (pro_name=="") Response.Write("<script language=javascript>alert('产品名称');history.go(-1)</script>");
行 31: if (pro_kind=="") Message.Text="产品类别";
行 32: if (name=="") Message.Text="定货人姓名";源文件: G:\work\b百世\www\orderonline.aspx 行: 30如果没填产品名称,我想弹出一个对话框提示,应该怎么写啊?
{
string pro_name=Request.Form["pro_name"];
string pro_kind=Request.Form["pro_kind"];
string name=Request.Form["name"];
string tel=Request.Form["tel"];
string province=Request.Form["province"];
string city=Request.Form["city"];
string address=Request.Form["address"];
string postcode=Request.Form["postcode"];
string email=Request.Form["email"];
string re=Request.Form["re"];
if (pro_name=="") Response.Write("<script language=javascript>alert('产品名称');history.go(-1)</script>");
}
</script>编译器错误信息: CS1010: 常数中有换行符源错误:
行 28: string re=Request.Form["re"];
行 29:
行 30: if (pro_name=="") Response.Write("<script language=javascript>alert('产品名称');history.go(-1)</script>");
行 31: if (pro_kind=="") Message.Text="产品类别";
行 32: if (name=="") Message.Text="定货人姓名";源文件: G:\work\b百世\www\orderonline.aspx 行: 30如果没填产品名称,我想弹出一个对话框提示,应该怎么写啊?
解决方案 »
- 来自数据源的 SqlDecimal 类型的给定值不能转换为指定目标列的类型 decimal
- 如何将memorystream内容显示到label控件中?急!
- ibatis.net
- 关于asp.net中的iframe
- 应用程序池
- ASP.net中如何做到允许用户调整的报表
- 小白又来了:推荐你觉得不错的asp.net的书!
- 放到IIS里面访问数据库就有问题哦??!!
- 求ASP.NET 强劲的学习制作网址或参考资料下载地址~~ 谢谢~!
- 程序放到网上出错??
- aspx偏僻问题:如果使得aspx文件换扩展名后能得以执行?如index.aspx换成index.gif?
- ASP.net 连接 SQLserver 2000?
if (pro_name != null && pro_name.length > 0)
Response.Write("<scr" + "ipt>al" + "ert('产品名称');history.go(-1)</scr" + "ipt>");
Response.Write("<script language=javascript>alert('产品名称');history.go(-1);</script>");
}
Page.RegisterClientScriptBlock("name",("<script language=javascript>alert('产品名称');history.go(-1);</script>")
<script language=javascript>alert('产品名称');history.go(-1);</script>
说这行“常数中有换行符”
Response.Write("<scr" + "ipt>al" + "ert('产品名称');history.go(-1);</scr" + "ipt>");
<input name="submit" type="button" id="submit" value="提交" onClick="Sumbit_Form()">
替换成
<asp:button id="Button2" runat="server" Text="提交" OnClick="Sumbit_Form"></asp:button>将
void Sumbit_Form()
替换成
void Sumbit_Form(object o, EventArgs e)