asp.netÎı¾¿òÑéÖ¤ÊäÈë
//ʹÓÃÑéÖ¤·½·¨
if (!InputValidator(txt.Text.Trim()))
{
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "myScript", "alert('\"Îı¾¿ò\"ÊäÈëÁË·Ç·¨×Ö·û»òÊäÈ볬³¤£¡');", true);
return;
}
//ÑéÖ¤·½·¨
protected bool InputValidator(string inputStr)
{
//Ö»ÄÜÊäÈëÖÐÎÄ£¬Ó¢ÎÄ£¬Êý×Ö£¬ÖÐÓ¢Îıêµã(¹ýÂËÓ¢Îĵ¥ÒýºÅ)¡£
if (Regex.IsMatch(inputStr, "^[\u4e00-\u9fa50-9a-zA-Z_£¬¡££¿£º£»‘’£¡“”—……¡¢(£{2}) (£¨£©) (¡¾¡¿) ({}) (¡¶¡·)-,.?:;\"!`(\\-{2})(\\.{3})(\\(\\))(\\[\\])({})]{0,50}$"))
{
return true;
}
return false;
}
//js·½Ê½´¦Àí
var regExp=new RegExp("^[\u4e00-\u9fa50-9a-zA-Z_£¬¡££¿£º£»‘’£¡“”—……¡¢(£{2}) (£¨£©) (¡¾¡¿) ({}) (¡¶¡·)-,.?:;\"!`(\\-{2})(\\.{3})(\\(\\))(\\[\\])({})]{0,50}$");
if(!regExp.test(txt1.value))
{
alert('ÊäÈëÁË·Ç·¨×Ö·û»òÊäÈ볬³¤£¡');
txt1.focus();
return;
}
Ïà¹ØÎĵµ£º
ǰ̨´úÂ룺
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="articleview.aspx.cs" Inherits="articleview" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> ......
/// <summary>
/// ´´½¨Êý¾Ý¿â¡£
/// </summary>
/// <param name="srvName">±íÊ ......
Êý¾Ý²ã: Linq to sql
ÒµÎñÂß¼²ã:×Ô¼ºÊµÏÖ£¬·â×°ÒµÎñ¶ÔÏó¶ÔÊý¾Ý¿âµÄ·ÃÎÊ£¬ÎÒµÄÂß¼²ã±ÈÄãµÄ×öµÄ¹¤×÷Òª¶à£¬ÎÒ¼õÉÙÁËUI²ãµÄ´úÂëÁ¿¡£
Model²ã:ÓÃÓÚUI²ãչʾʹÓõÄModel£¬Êý¾Ý¿ÉÄÜÀ´Ô´ÓÚ¶àÕÅ±í£¬¾ßÌåÊý¾ÝÌî³äÔÚÂß¼²ãÖиºÔð
UI²ã:¸ºÔð´«µÝÊý¾Ý£¬Õ¹Ê¾Êý¾Ý
SQLµÄÖÊÁ¿ÆäʵºÍ³ÌÐòÔ±µÄˮƽÓйØ
ÕâÒ²ÊÇΪʲô΢ÈíһֱŬÁ¦Èôó ......
Dim strScript As String = "<Script Language='VBScript'>" &vbCrLf
strScript &= "opener.parent.document.location.href=""" &"../Individual/UserJobs.aspx?EntityTableID=" &Request("EntityTableID") &"&ListID=" &BLL.TableType.Entity &"&OrgID=" &Request ......
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Syste ......