您现在的位置是:网站首页> 编程资料编程资料
asp.net Textbox服务器控件_实用技巧_
2023-05-24
244人已围观
简介 asp.net Textbox服务器控件_实用技巧_
复制代码 代码如下:
textChange的事件代码如下:
复制代码 代码如下:
protected void txtNum2_TextChanged(object sender, EventArgs e)
{
if (txtNum2.Text.Length == 0)
{
//Page.RegisterClientScriptBlock("","");
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "");
txtNum2.Focus();
}
else
{
int result;
bool n1 = Information.IsNumeric(txtNum2.Text.Trim());
if (n1)
{
result = int.Parse(txtNum2.Text.Trim()) % 2;
if (result == 0)
{
txtSum.Text = "偶数";
}
else
{
txtSum.Text = "奇数";
}
}
}
}
}
您可能感兴趣的文章:
相关内容
- SQLServer 在Visual Studio的2种连接方法_实用技巧_
- GridView使用CommandField删除列实现删除时提示确认框_实用技巧_
- DataGrid中实现超链接的3种方法_实用技巧_
- .Net下二进制形式的文件(图片)的存储与读取详细解析_实用技巧_
- DataSet.Tables[].Rows[][]的用法详细解析_实用技巧_
- 如何在asp.net中使用FreeTextBox控件_实用技巧_
- 将FreeTextBox做成控件添加到工具箱中的具体操作方法_实用技巧_
- 关于Asp.net页面Page_Load被执行两次的问题分享_实用技巧_
- ASP.NET MVC 从IHttp到页面输出的实例代码_实用技巧_
- 在子页中隐藏模板页中的div示例代码_实用技巧_
