📄 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";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -