?? weather.ascx.cs
字號:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions;
public partial class Weather_ascx : UserControl, IZipCode
{
string _zip = String.Empty;
[Personalizable]
public string ZipCode
{
get { return _zip; }
set { _zip = value; }
}
void Page_Load (Object sender, EventArgs e)
{
if (!IsPostBack)
Zip.Text = _zip;
}
public void Button1_Click (object sender, EventArgs e)
{
string zip = Zip.Text;
if (zip.Length == 5 && Regex.IsMatch (zip, @"^\d{5}$"))
_zip = zip;
else
Zip.Text = String.Empty;
}
[ConnectionProvider ("Zip Code", "ZipCodeProvider")]
public IZipCode GetZipCodeInterface ()
{
return this;
}
public string GetZipCode ()
{
return _zip;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -