using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
namespace WebApplication1
{
public partial class PersonInforPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label6.Text = "123456789903243563456534563456363466";
}
public static bool IsNumeric(string inputData)
{
Regex _isNumber = new Regex(@"^\d+$");
Match m = _isNumber.Match(inputData);
return m.Success;
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = TextBox1.Text;
if (IsNumeric(str))
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "test", "alert('是数字')", true);
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "test", "alert('不是数字')", true);
}
}
}
}