最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
在WEB程序中设置个性化,容错提示窗口
时间:2022-07-02 11:26:27 编辑:袖梨 来源:一聚教程网
首先设计一个容错提示的窗口图像为如下:
关键HTML文本如下:
“原因:<%=content[Int32.Parse(Request.QueryString["ms"])]%>”
然后在代码编辑窗口中添加如下不分:
public class WebForm1 : System.Web.UI.Page
{
public string[] content;
private void Page_Load(object sender, System.EventArgs e)
{
content=new string[10];
content[1]=".提示1.";
content[2]="提示2";
... ...
}
===========================================
在容错的网页中这样调用:
[/*以下是一个示例!*/]
public void Check()
{//检测用户输入的合法性;
//检测[订单号][类型]是否为空白;
if (lOrderName.InnerText.Trim() == "" || lOrderCategory.InnerText.Trim() == "")
{
Response.Redirect(@"..Exceptions.aspx?ms=11");
}
//判断用户输入的数量是否正确;
try
{
int i = Convert.ToInt16(tbQuantity.Text);
if (i ==0)
{
Response.Redirect(@"..Exceptions.aspx?ms=12");
}
}
catch
{
Response.Redirect(@"..Exceptions.aspx?ms=12");
}
//判断日期是否正确;
try
{
Convert.ToDateTime(tbTerm.Text);
}
catch
{
Response.Redirect(@"..Exceptions.aspx?ms=9");
}
//判断交货期必须大于开单日期;
if (Convert.ToDateTime(tbTerm.Text) < Convert.ToDateTime(Request.Cookies["Order"].Values["Date"]))
{
Response.Redirect(@"..Exceptions.aspx?ms=14");
关键HTML文本如下:
“原因:<%=content[Int32.Parse(Request.QueryString["ms"])]%>”
然后在代码编辑窗口中添加如下不分:
public class WebForm1 : System.Web.UI.Page
{
public string[] content;
private void Page_Load(object sender, System.EventArgs e)
{
content=new string[10];
content[1]=".提示1.";
content[2]="提示2";
... ...
}
===========================================
在容错的网页中这样调用:
[/*以下是一个示例!*/]
public void Check()
{//检测用户输入的合法性;
//检测[订单号][类型]是否为空白;
if (lOrderName.InnerText.Trim() == "" || lOrderCategory.InnerText.Trim() == "")
{
Response.Redirect(@"..Exceptions.aspx?ms=11");
}
//判断用户输入的数量是否正确;
try
{
int i = Convert.ToInt16(tbQuantity.Text);
if (i ==0)
{
Response.Redirect(@"..Exceptions.aspx?ms=12");
}
}
catch
{
Response.Redirect(@"..Exceptions.aspx?ms=12");
}
//判断日期是否正确;
try
{
Convert.ToDateTime(tbTerm.Text);
}
catch
{
Response.Redirect(@"..Exceptions.aspx?ms=9");
}
//判断交货期必须大于开单日期;
if (Convert.ToDateTime(tbTerm.Text) < Convert.ToDateTime(Request.Cookies["Order"].Values["Date"]))
{
Response.Redirect(@"..Exceptions.aspx?ms=14");
相关文章
- jm漫画-在线观看最新入口 02-28
- Deepseek网页版免费入口-deepseek在线极速体验 02-28
- 哔咔-picacg核心区别 02-28
- 歪歪漫画-免费看歪歪漫画 02-28
- z-libirary软件-强大功能与独特特点 02-28
- 漫蛙manwa2最新版本下载官方正版入口-下载安装教程及常见问题解答 02-28