?? news.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;
public partial class News_ascx:UserControl
{
void Page_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet ();
ds.ReadXml (Server.MapPath ("~/app_data/GlobalNews.xml"));
Repeater1.DataSource = ds;
Repeater1.DataBind ();
}
[ConnectionConsumer("Zip Code", "ZipCodeConsumer")]
public void GetIZipCodeInterface (IZipCode provider)
{
string zip = provider.GetZipCode ();
if (!String.IsNullOrEmpty (zip)) {
if (zip.StartsWith ("378"))
Headline.Text = "Oak Ridge News";
else if (zip.StartsWith ("379"))
Headline.Text = "Knoxville News";
else if (zip.StartsWith ("980"))
Headline.Text = "Redmond News";
else
Headline.Text = "Local News";
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -