asp.net ÆÁ±Î Ö»ÄÜ ÊÇÊý×Ö
//Êý×Ö×Ö·û
public static string KeepNum(string str)
{
char[] tmp = new char[str.Length];
char[] s = str.ToCharArray();
for (int i = 0, j = 0; i < str.Length; i++)
{
if (s[i] >= '0' && s[i] <= '9')
{
tmp[j] = s[i];
j++;
}
}
return new string(tmp);
}
<input type="text" id="mobile" runat="server" maxlength="12" onkeyup="value=value.replace(/[^\d]/g,'')" />
Ïà¹ØÎĵµ£º
Ö»ÐèÔÚasp.netÒ³ÃæµÄPageÖ¸ÁîÖÐÉèÖÃMaintainScrollPositionOnPostback="true"¾Í¿ÉÒÔÇáËÉʵÏÖ¡£
MaintainScrollPositionOnPostbackÊôÐÔµÄĬÈÏֵΪfalse¡£
ÁíÍâasp.netµÄpage¶ÔÏó»¹ÓÐÒ»¸öSmartNavigatorÊôÐÔ£¬Õâ¸öÊôÐÔÎÒÒ²ÊÔ¹ý¡£¡£ºÃÏñ¶ÔÓÚcssÓÐÓ°Ïì¡£Ò³Ãæ²¼¾ÖÓеã±ä»¯¡£¡£²»ÊǺܺÃʹ ......
1. ÔÚASP.NETÖÐרÓÃÊôÐÔ£º
»ñÈ¡·þÎñÆ÷µçÄÔÃû£ºPage.Server.ManchineName
»ñÈ¡Óû§ÐÅÏ¢£ºPage.User
»ñÈ¡¿Í»§¶ËµçÄÔÃû£ºPage.Request.UserHostName
»ñÈ¡¿Í»§¶ËµçÄÔIP£ºPage.Request.UserHostAddress
2. ÔÚÍøÂç±à³ÌÖеÄͨÓ÷½·¨£º
»ñÈ¡µ±Ç°µçÄÔÃû£ºstatic System.Net.Dns.GetHostName()
¸ù¾ÝµçÄÔÃûÈ¡³öÈ«²¿IPµØÖ ......
½ñÌìÔÚ×öÒ»¸öÎÞË¢ÐÂÅжϹ«Ë¾Ãû³Æ£¬ÊÇ·ñÖظ´µÄʱºò£¬·¢ÏÖÒ»¸öÎÊÌâ¾ÍÊÇͨ¹ýjavascript´«µ½asp.netÒ³ÃæµÄÖµÊÇÂÒÂë¡£ÒÔǰûÓз¢ÏÖ¡£ÒòΪ ÒÔÇ°×ö²âÊÔʱ£¬¶¼ÊÇÓÃÓ¢ÎÄ×Ö·û½øÐеIJâÊÔ¡£½ñÌìÊäÈ뺺×ֺ󣬷¢ÏÖÓÐÕâÖÖÎÊÌâ¡£¸Ð¾õ¿ÉÄÜÊDZàÂëµÄÎÊÌâ¡£¾ÍÉÏÍø²éÁËһϡ£ÕÒµ½Ò»Ð©·½·¨£¬ÈçÏ£º
1.ÉèÖÃweb.configÎļþ
<system.web>
&l ......
¸üУº2007 Äê 11 Ô ¿ÉÒÔÏñ¶Ô HTML ÔªËØÄÇÑù£¬ÒÔÉùÃ÷·½Ê½Ïò ASP.NET ÍøÒ³ÉϵĿؼþÌí¼Ó¿Í»§¶Ë½Å±¾¡£»òÕߣ¬Èç¹ûʼþ»ò´úÂëÒÀÀµ½öÔÚÔËÐÐʱ¿ÉÓõÄÐÅÏ¢£¬¿ÉÒÔͨ¹ý±à³Ì·½Ê½Ïò ASP.NET Web ·þÎñÆ÷¿Ø¼þÌí¼Ó¿Í»§¶Ë½Å±¾Ê¼þ¡£ ˵Ã÷£º ¿ÉÒÔÔÚ¿Í»§¶Ë½Å±¾ÖÐͨ¹ý ID ÒýÓÿؼþ¡£Óйظü¶àÐÅÏ¢£¬Çë²Î¼û ASP.NET ÍøÒ³ÖеĿͻ§¶Ë½Å±¾¡£ Ïò ......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
/// <summary>
/// ÉùÃ÷ίÍÐ
/// </summary>
/// <param name="name"></param>
public delegate void GreetPeopleDelegate(st ......