本文整理汇总了C#中HtmlMeta类的典型用法代码示例。如果您正苦于以下问题:C# HtmlMeta类的具体用法?C# HtmlMeta怎么用?C# HtmlMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlMeta类属于命名空间,在下文中一共展示了HtmlMeta类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
switch ((Page.RouteData.Values["info"] ?? "").ToString())
{
case "404":
PageHelper.ShowResultPage("您访问的页面不存在", "~/Index");
break;
default:
break;
}
if (Session["Result"] == null)
{
Session["Result"] = "未知错误";
Session["ResultRedirect"] = "~/Index".ResolveUrl();
}
object redirect = Session["ResultRedirect"];
if (redirect != null)
{
HtmlMeta autoRefresh = new HtmlMeta();
autoRefresh.HttpEquiv = "refresh";
autoRefresh.Content = "5;url=" + redirect.ToString();
Page.Header.Controls.Add(autoRefresh);
}
ctContent.Text = Session["Result"].ToString();
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Page.SmartNavigation = false;
lblType.Text = "TIRE MACHINERY";
//SELECT [item_number], [size], [style], [manufacturer] FROM [TIRE_MACHINERY] WHERE ([type] = ?)
OleDbConnection TireConnection = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" +
Server.MapPath("").ToString() + "\\App_Data\\xSobesInventoryx.mdb");
OleDbCommand TireCommand = new OleDbCommand("SELECT [item_number], [size], [style], [manufacturer] FROM [TIRE_MACHINERY] WHERE ([type] = @type)", TireConnection);
TireCommand.Parameters.Add("@type", OleDbType.Char).Value = Convert.ToString(DropDownList1.SelectedItem);
TireConnection.Open();
OleDbDataReader TireReader = TireCommand.ExecuteReader();
if (TireReader.HasRows)
{
DataList1.DataSource = TireReader;
DataList1.DataBind();
}
{
HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = "tire machinery, used tire machinery, tires, rubber machinery, used rubber machinery";
Header.Controls.Add(keywords);
HtmlMeta description = new HtmlMeta();
description.Name = "description";
description.Content = "Over 20 different types of used tire machinery";
Header.Controls.Add(description);
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string val = Request.QueryString["val"] == null ? string.Empty : Convert.ToString(Request.QueryString["val"]);
string orderId = SaveLead();
if (val == "3")
{ //Flow Ajax call: Capture ShortLEad IN DB
string returnShortLeadValue = orderId;
Response.Clear();
Response.ContentType = "text/xml";
Response.Write(returnShortLeadValue);
Response.End();
}
else
{
if (string.IsNullOrEmpty(Request.Form["redirectURL"]))
redirectURL = "Error.htm";
else
{
redirectURL = Request.Form["redirectURL"] + "?id=" + orderId;
}
HtmlMeta meta = new HtmlMeta();
meta.HttpEquiv = "refresh";
meta.Content = "0.005;url=" + redirectURL;
this.Header.Controls.Add(meta);
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
if (cookie == null)
{
cookie = new HttpCookie("BrowserDate");
cookie.Value = DateTime.Now.Date.ToString();
cookie.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie);
}
DateTime isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":").Replace("%28", "(").Replace("%29", ")"));
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":").Replace("%28", "(").Replace("%29", ")")));
HtmlMeta hm = new HtmlMeta();
HtmlMeta kw = new HtmlMeta();
HtmlMeta lg = new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
hm.Name = "Description";
hm.Content = "Feature events, locales, trips and bulletins on HippoHappenings. By making all posting entirely free, we encourage you to post all public evets, whether big, small or even just a street performance. Promote them even further by featuring your happenings.";
head.Controls.AddAt(0, hm);
kw.Name = "keywords";
kw.Content = "Feature event locale trip and bulletin on HippoHappenings";
head.Controls.AddAt(0, kw);
lg.Name = "language";
lg.Content = "English";
head.Controls.AddAt(0, lg);
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
HtmlMeta ds = new HtmlMeta();
HtmlMeta kw = new HtmlMeta();
HtmlMeta lg = new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
kw.Name = "keywords";
kw.Content = "About HippoHappenings";
head.Controls.AddAt(0, kw);
ds.Name = "description";
ds.Content = "HippoHappenings provides events and unconventional local happenings";
head.Controls.AddAt(0, ds);
lg.Name = "language";
lg.Content = "English";
head.Controls.AddAt(0, lg);
ChangeMission(MissionTimer, new EventArgs());
}
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["id"] == null)
{
Response.Redirect("~/ReadyReaders.aspx?gender=all");
}
// Gets the name of the product and put it as the title
string title = Frames.GetName(Request.QueryString["id"]) + " @ OnSiteEyewear.ca";
HtmlMeta metaTitle = new HtmlMeta();
metaTitle.Name = title;
metaTitle.Content = title;
Page.Header.Controls.Add(metaTitle);
Page.Title = metaTitle.Content;
// Add values to the ddlPower
ddlPower = (DropDownList)fvSpecificReadyReader.FindControl("ddlPower");
while (ddlPowerInt < 3)
{
ddlPowerInt = ddlPowerInt + 0.25;
ddlPower.Items.Add(new ListItem(String.Format("{0:+0.00}", ddlPowerInt), ddlPowerNum.ToString()));
ddlPowerNum++;
}
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
if (cookie == null)
{
cookie = new HttpCookie("BrowserDate");
cookie.Value = DateTime.Now.Date.ToString();
cookie.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie);
}
DateTime isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":").Replace("%28", "(").Replace("%29", ")"));
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":").Replace("%28", "(").Replace("%29", ")")));
HtmlMeta hm = new HtmlMeta();
HtmlMeta kw = new HtmlMeta();
HtmlMeta lg = new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
hm.Name = "Description";
hm.Content = "Hippo Boss and Hippo Points are your tool on HippoHappenings for "+
"promoting yourself online. It's our gift to you for having posted lots of content on our site.";
head.Controls.AddAt(0, hm);
kw.Name = "keywords";
kw.Content = "Hippo Boss and Points promote your cause";
head.Controls.AddAt(0, kw);
lg.Name = "language";
lg.Content = "English";
head.Controls.AddAt(0, lg);
}
示例8: Button2_Click
protected void Button2_Click(object sender, EventArgs e)
{
HtmlMeta meta = new HtmlMeta();
meta.HttpEquiv = "Refresh";
meta.Content = "2;URL=http://www.OdeToCode.com";
Header.Controls.Add(meta);
}
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HtmlMeta hm = new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
hm.Name = "ROBOTS";
hm.Content = "NOINDEX, FOLLOW";
head.Controls.AddAt(0, hm);
ImageButton9.OnClientClick = "javascript:Search('Group.aspx?ID=" +
Request.QueryString["ID"].ToString() + "');";
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
string groupID = Request.QueryString["ID"].ToString();
DataView dvMembers = dat.GetDataDV("SELECT * FROM Group_Members WHERE GroupID=" +
groupID + " AND MemberID=" + Session["User"].ToString());
if (bool.Parse(dvMembers[0]["SharedHosting"].ToString()))
{
HostPanel.Visible = true;
}
else
HostPanel.Visible = false;
}
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HtmlMeta description = new HtmlMeta();
description.Name = "description";
description.Content = "All rubber machinery products, excluding tire machinery, both new and used";
Header.Controls.Add(description);
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string strTitle, strDescription, strMetaTitle, strMetaDescription;
if (!string.IsNullOrEmpty(Request.QueryString["tv"]))
{
var oTuVan = new Article();
var dv = oTuVan.ArticleSelectOne(Request.QueryString["tv"]).DefaultView;
if (dv != null && dv.Count <= 0) return;
var row = dv[0];
strTitle = Server.HtmlDecode(row["ArticleTitle"].ToString());
strDescription = Server.HtmlDecode(row["Description"].ToString());
strMetaTitle = Server.HtmlDecode(row["MetaTittle"].ToString());
strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString());
//hdnSanPham.Value = progressTitle(dv[0]["ProductCategoryName"].ToString()) + "-pci-" + dv[0]["ProductCategoryID"].ToString() + ".aspx";
}
else
{
strTitle = strMetaTitle = "Tư Vấn";
strDescription = "";
strMetaDescription = "";
}
Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle;
var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription };
Header.Controls.Add(meta);
lblTitle.Text = strTitle;
lblTitle2.Text = strTitle;
}
}
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
var googleSiteVerificationMeta = new HtmlMeta { Name = "google-site-verification" };
if (Request.IsDotInfo())
{
googleSiteVerificationMeta.Content = "6M9JTp1F2QTbPqYFmcJnf06iUb8RSsA6QOc_wQ_8";
//if (!Request.IsRobot() || (Page.Request.AppRelativeCurrentExecutionFilePath.ToLower() != "~/default.aspx"))
{
var oldUri = Request.Url.AbsoluteUri.ToLower();
Response.RedirectPermanent(oldUri.Replace("jooyandeh.info", "jooyandeh.com"));
}
}
else if (Request.IsDotCom())
{
googleSiteVerificationMeta.Content = "jJh_5Te44yV12kapDQNEfYp32gejcxXdVIXEjVJIu4g";
}
else if (Request.IsOnAzureProd())
{
googleSiteVerificationMeta.Content = "leZeHIkj_1Av8w090g9O6rNaBzxgqOevyf8CpCFuiGk";
}
else if (Request.IsOnAzureDev())
{
googleSiteVerificationMeta.Content = "leZeHIkj_1Av8w090g9O6rNaBzxgqOevyf8CpCFuiGk";
}
if (googleSiteVerificationMeta.Content != string.Empty)
Page.Header.Controls.Add(googleSiteVerificationMeta);
if (Request.IsOnAzure())
{
Page.Header.Controls.Add(new HtmlMeta { Name = "robots", Content = "noindex" });
}
}
示例13: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (((DataView)odsDieuTriHo.Select()).Count <= DataPager1.PageSize)
{
DataPager1.Visible = false;
}
string strTitle, strDescription, strMetaTitle, strMetaDescription;
if (!string.IsNullOrEmpty(Request.QueryString["di"]))
{
var oArticle = new Article();
var oArticleCategory = new ArticleCategory();
var dv = oArticle.ArticleSelectOne(Request.QueryString["di"]).DefaultView;
if (dv != null && dv.Count <= 0) return;
var row = dv[0];
strTitle = Server.HtmlDecode(row["ArticleTitleEn"].ToString());
strDescription = Server.HtmlDecode(row["DescriptionEn"].ToString());
strMetaTitle = Server.HtmlDecode(row["MetaTittleEn"].ToString());
strMetaDescription = Server.HtmlDecode(row["MetaDescriptionEn"].ToString());
}
else
{
strTitle = strMetaTitle = "Cough Treatment";
strDescription = "";
strMetaDescription = "";
}
Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle;
var meta = new HtmlMeta() { Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription };
Header.Controls.Add(meta);
}
}
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HtmlMeta hm = new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
hm.Name = "ROBOTS";
hm.Content = "NOINDEX, FOLLOW";
head.Controls.AddAt(0, hm);
HttpCookie cookie = Request.Cookies["BrowserDate"];
if (cookie == null)
{
cookie = new HttpCookie("BrowserDate");
cookie.Value = DateTime.Now.ToString();
cookie.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie);
}
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataView dvGroup = dat.GetDataDV("SELECT * FROM Groups WHERE ID="+Request.QueryString["ID"].ToString());
if (dvGroup[0]["Host"].ToString() == Session["User"].ToString())
{
TheLabel.Text = "Since you are the primary host of the group, you must first designate another host for the group. Go to your group's home page and click on 'Edit Members' Prefs'.";
Button3.Visible = false;
}
}
示例15: AddDescritpintags
public static void AddDescritpintags(HtmlHead Header)
{
HtmlMeta tag = new HtmlMeta();
tag.Name = "Title";
tag.Content = "Best Car Selling Packages to Sell your Car Online at UnitedCarExchange.com";
Header.Controls.Add(tag);
}