在WEB程序中设置个性化,容错提示窗口
2008-04-05 08:14
309 查看
首先设计一个容错提示的窗口图像为如下:
关键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");
}
//判断当前的型号在当前订单中是否已经存在;
DataClass dc = new DataClass();
if (dc.CheckModel(lOrderName.InnerText,lbModel.SelectedValue.ToString()))
{
Response.Redirect(@"../Exceptions.aspx?ms=13");
}
//当订单类型为:“S-P”时,检测不能超出上限;
if (lOrderCategory.InnerText=="S-P")
{
if (Convert.ToInt32(tbQuantity.Text) > Convert.ToInt32(lbUpper.InnerText))
{
Response.Redirect(@"../Exceptions.aspx?ms=18");
}
}
}
==========================================
其中Exceptions.aspx就是我们刚才定义的那个容错窗口了!
关键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");
}
//判断当前的型号在当前订单中是否已经存在;
DataClass dc = new DataClass();
if (dc.CheckModel(lOrderName.InnerText,lbModel.SelectedValue.ToString()))
{
Response.Redirect(@"../Exceptions.aspx?ms=13");
}
//当订单类型为:“S-P”时,检测不能超出上限;
if (lOrderCategory.InnerText=="S-P")
{
if (Convert.ToInt32(tbQuantity.Text) > Convert.ToInt32(lbUpper.InnerText))
{
Response.Redirect(@"../Exceptions.aspx?ms=18");
}
}
}
==========================================
其中Exceptions.aspx就是我们刚才定义的那个容错窗口了!
相关文章推荐
- 在WEB程序中设置个性化,容错提示窗口
- 打开IE时,弹出对话窗口,提示“您计算机上某个程序已损坏了您对 Internet Explorer 默认搜索提供程序的设置”
- 增加工具栏提示&修改程序字体&设置文档标题&控制窗口显示&更新菜单选中/不选中状态
- VC中设置程序窗口的排列层级
- 关闭”xx程序已停止工作”提示窗口
- webparts中,此页当前禁用指定的显示模式。请确保为当前用户启用了个性化设置。
- 图解使用Win8Api进行Metro风格的程序开发五----在系统的设置窗口添加按钮
- 运行Web程序时提示无法使用调试
- ASP.NET程序中动态修改web.config中的设置项目(后台CS代码)
- JS添加可信站点、修改ActiveX安全设置,禁用弹出窗口阻止程序的方法
- VS 之 C# 通过console 调用 exe 程序,窗口隐藏设置
- windows应用开发由浅入深(三)利用注册表将程序启动时窗口位置设置为上次关闭的位置
- java web 程序---登陆验证session。提示登陆
- web-view组件的可行性使用以及小程序的导航栏设置
- Jboss-web下设置程序不用输入根目录 浏览
- IIS网站已经停止,提示服务器没有及时响应启动或控制请求!本地计算机法启动 World Wide Web Publishing 服务。提示 “错误127: 找不到指定的程序”或者“错误1721,资源不足,无法启动
- vs2008运行WEB程序时提示无法启动程序"http://localhost:12345/index.aspx".有更多数据可用
- IIS网站已经停止,提示服务器没有及时响应启动或控制请求!本地计算机法启动 World Wide Web Publishing 服务。提示 “错误127: 找不到指定的程序”或者“错误1721,资源不足,无法启动”
- Android程序:IDE Eclipse主题样式和提示设置
- 关于java web程序中数据包太大设置mysql 中max_allowed_packet变量值