本文整理汇总了C#中Data.MakeNiceName方法的典型用法代码示例。如果您正苦于以下问题:C# Data.MakeNiceName方法的具体用法?C# Data.MakeNiceName怎么用?C# Data.MakeNiceName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.MakeNiceName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
BeginingLiteral.Text = "<div style=\"background-color:" +
color + "; width: " + width.ToString() + "px; padding: 3px; margin-bottom: 3px;\">";
SearchLabel.Text = searchLabel;
//search = true is disabled here
if (windowT)
{
SearchLabel.Attributes.Add("onclick", "CloseWindow('" + "../" + dat.MakeNiceName(searchLabel) + "_" + adID + "_Ad" + "');");
}
else
{
SearchLabel.NavigateUrl = "../" + dat.MakeNiceName(searchLabel) + "_" + adID + "_Ad";
}
string begining = "<a style=\"color: #b1a812; font-family: Arial; font-size: 11px;\">";
string end = "</a>";
dat.TAG_TYPE = Data.tagType.AD;
string tags = dat.getTags(dat.GetData("SELECT C.ID, C.Name AS CategoryName, ACM.tagSize FROM Ad_Category_Mapping ACM, AdCategories C WHERE ACM.CategoryID=C.ID AND ACM.AdID=" + adID), false, windowT);
TagsLiteral.Text = "<span style=\"color: #b1a812; line-height: 10px; font-size: 11px;\" >" + tags + "</span>";
}
示例2: DrawEvents
protected void DrawEvents(DataView dvEvents, int cutOff)
{
string eventID = GetEventID();
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);
}
DateTime isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
Literal lit = new Literal();
int count = 0;
DataView dvEvent;
string contentSub = "";
foreach (DataRowView row in dvEvents)
{
if (count > cutOff - 1)
{
break;
}
else
{
contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
"").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
"").Replace("<br />", "").Replace("<BR />", ""));
if (dat.stripHTML(row["Content"].ToString().Replace("<br>",
"").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
"").Replace("<br />", "").Replace("<BR />", "")).Length > 100)
contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
"").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
"").Replace("<br />", "").Replace("<BR />", "")).Substring(0, 100);
dvEvent = dat.GetDataDV("SELECT * FROM Events E, Event_Occurance EO WHERE E.ID=EO.EventID AND E.ID=" + row["EventID"].ToString());
lit.Text += "<div class=\"SimilarSide\">";
lit.Text += "<a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
"_" + row["EventID"].ToString() + "_Event\">" + row["Header"].ToString() +
"</a> at " + "<a class=\"Green12LinkNF\" href=\"" + dat.MakeNiceName(row["Name"].ToString()) +
"_" + row["Venue"].ToString() + "_Venue\">" + row["Name"].ToString() + "</a> on " +
DateTime.Parse(dvEvent[0]["DateTimeStart"].ToString()).ToShortDateString() +
". " + dat.BreakUpString(contentSub, 30) +
"... <a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
"_" + row["EventID"].ToString() + "_Event\">Read More</a>";
lit.Text += "</div>";
count++;
}
}
OtherEventsPanel.Controls.Add(lit);
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Data dat = new Data(DateTime.Now);
DayLabel.Text = day;
MonthLabel.Text = month;
DayNumberLabel.Text = daynumber;
EventNameLabel.Text = eventname;
theTable.Attributes.Add("onclick", "window.location = '" + dat.MakeNiceName(eventname) + "_" + eventID + "_Event'");
EventNameLabel.NavigateUrl = "~/" + dat.MakeNiceName(eventname) + "_" + eventID + "_Event";
SummaryLabel.Text = summary;
ReadMoreLink.NavigateUrl = "~/" + dat.MakeNiceName(eventname) + "_" + eventID + "_Event";
//ReadMoreLink.NavigateUrl = "~/Event.aspx?EventID="+eventID;
}
示例4: DrawBulletins
protected void DrawBulletins(DataView dvEvents, int cutOff)
{
string eventID = Request.QueryString["AdID"];
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);
}
DateTime isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
Literal lit = new Literal();
int count = 0;
DataView dvEvent;
string contentSub = "";
foreach (DataRowView row in dvEvents)
{
if (count > cutOff - 1)
{
break;
}
else
{
contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
"").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
"").Replace("<br />", "").Replace("<BR />", ""));
if (dat.stripHTML(row["Content"].ToString().Replace("<br>",
"").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
"").Replace("<br />", "").Replace("<BR />", "")).Length > 100)
contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
"").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
"").Replace("<br />", "").Replace("<BR />", "")).Substring(0, 100);
lit.Text += "<div class=\"SimilarSide\">";
lit.Text += "<a class=\"Green12LinkNF\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
"_" + row["AdID"].ToString() + "_Ad\">" + row["Header"].ToString() +
"</a>. " + dat.BreakUpString(contentSub, 30) +
"... <a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
"_" + row["AdID"].ToString() + "_Ad\">Read More</a>";
lit.Text += "</div>";
count++;
}
}
OtherAdsPanel.Controls.Add(lit);
}
示例5: 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);
}
//Ajax.Utility.RegisterTypeForAjax(typeof(Delete));
if (!IsPostBack)
{
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataView dvEvent = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" +
Request.QueryString["ID"].ToString());
string groupID = dvEvent[0]["GroupID"].ToString();
DataView dvGroup = dat.GetDataDV("SELECT * FROM Groups WHERE ID=" + groupID);
ImageButton9.OnClientClick = "Search('" + dat.MakeNiceName(dvGroup[0]["Header"].ToString()) + "_" + groupID + "_Group');";
TextLabel.Text = "Are you sure you want to delete the event '" + dvEvent[0]["Name"].ToString() +
"' from the group '" + dvGroup[0]["Header"].ToString() + "'";
}
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
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"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataView dvGroupEvent = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" + Request.QueryString["ID"].ToString());
ImageButton9.OnClientClick = "javascript:Search('" +
dat.MakeNiceName(dvGroupEvent[0]["Name"].ToString()) + "_" + Request.QueryString["O"].ToString() + "_" +
Request.QueryString["ID"].ToString() + "_GroupEvent');";
string groupID = Request.QueryString["ID"].ToString();
string command = "SELECT * FROM Group_Members WHERE GroupID=" +
dvGroupEvent[0]["GroupID"].ToString() + " AND MemberID=" + Session["User"].ToString();
DataView dvMembers = dat.GetDataDV(command);
if (bool.Parse(dvMembers[0]["SharedHosting"].ToString()))
{
HostPanel.Visible = true;
}
else
HostPanel.Visible = false;
}
catch (Exception ex)
{
ErrorLabel.Text = ex.ToString();
}
}
示例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.ToString();
cookie.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie);
}
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
if (Session["User"] == null)
{
Response.Redirect("~/Home.aspx");
}
if (Request.QueryString["ID"] == null)
Response.Redirect("Home.aspx");
if (dat.HasEventPassed(Request.QueryString["ID"].ToString()))
{
DataView dvName = dat.GetDataDV("SELECT * FROM Events WHERE ID="+
Request.QueryString["ID"].ToString());
Response.Redirect(dat.MakeNiceName(dvName[0]["Header"].ToString()) + "_" +
Request.QueryString["ID"].ToString() + "_Event");
}
}
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
TitleLabel.Text = title;
TitleLabel.NavigateUrl = "../" + dat.MakeNiceName(title) + "_" + eventID + "_Event";
summary = summary.Replace("<br/>", " ");
if (summary.Length > 70)
summary = dat.BreakUpString(summary.Substring(0, 70), 35) + "...";
OtherEventSummaryLabel.Text = summary;
PresentedByLabel.Text = "presented on " + presentedBy;
}
示例9: SubmitIt
protected void SubmitIt(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
if (UpdateText.Text.Trim() != "")
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
conn.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO EventUpdates (modifierID, EventID, eventChange) "+
"VALUES("+Session["User"].ToString()+", "+Request.QueryString["ID"].ToString()+", @p3)", conn);
cmd.Parameters.Add("@p3", SqlDbType.NVarChar).Value = UpdateText.Text;
cmd.ExecuteNonQuery();
conn.Close();
string ID = Request.QueryString["ID"].ToString();
Encryption encrypt = new Encryption();
DataSet dsEvent = dat.GetData("SELECT * FROM Events WHERE ID=" + ID);
//send email to users who have this event in their calendar and selected their preferences
string emailBody = "<br/><br/>Updates have been made to an event in your calendar: Event '\"" + dsEvent.Tables[0].Rows[0]["Header"].ToString() +
"\"'. <br/><br/> To view these updates, please go to this event's <a href=\"http://hippohappenings.com/" + dat.MakeNiceName(dsEvent.Tables[0].Rows[0]["Header"].ToString())+
"_" + ID + "_Event\">page</a> and click on the updates drop down. " +
"<br/><br/><br/>Have a Hippo Happening Day!<br/><br/> <a href=\"http://HippoHappenings.com\">Happening Hippo</a>";
DataSet dsAllUsers = dat.GetData("SELECT * FROM User_Calendar UC, Users U, UserPreferences UP WHERE U.User_ID=UP.UserID AND UP.EmailPrefs LIKE '%C%' AND U.User_ID=UC.UserID AND UC.EventID=" + ID);
DataView dv = new DataView(dsAllUsers.Tables[0], "", "", DataViewRowState.CurrentRows);
if (dv.Count > 0)
{
for (int i = 0; i < dv.Count; i++)
{
dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString(),
System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
dv[i]["Email"].ToString(), emailBody,
"Event '" + dsEvent.Tables[0].Rows[0]["Header"].ToString() + "' has been modified");
}
}
Session["Message"] = "Your update has been posted successfully<br/><br/> Here are your next steps. <br/><br/>";
Session["Message"] += "<br/><br/>" + "-Go to <a class=\"AddLink\" onclick=\"Search('" +
dat.MakeNiceName(dsEvent.Tables[0].Rows[0]["Header"].ToString()) + "_" + ID + "_Event');\">this event's</a> home page.<br/><br/> -<a class=\"AddLink\" onclick=\"Search('RateExperience.aspx?Type=E&ID=" + ID + "');\" >Rate </a>your user experience posting this event.";
MessageRadWindow.NavigateUrl = "Message.aspx?message=" + encrypt.encrypt(Session["Message"].ToString() +
"<br/><br/><img onclick=\"Search('Home.aspx');\" onmouseover=\"this.src='image/DoneSonButtonSelected.png'\" onmouseout=\"this.src='image/DoneSonButton.png'\" src=\"image/DoneSonButton.png\"/><br/>");
MessageRadWindow.Visible = true;
MessageRadWindowManager.VisibleOnPageLoad = true;
}
else
{
ErrorLabel.Text = "Please enter an Update.";
}
}
示例10: 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"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataView dvGroupEvent = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" +
Request.QueryString["ID"].ToString());
ImageButton9.OnClientClick = "javascript:Search('" +
dat.MakeNiceName(dvGroupEvent[0]["Name"].ToString()) + "_" + Request.QueryString["O"].ToString() + "_" +
Request.QueryString["ID"].ToString() + "_GroupEvent');";
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Data dat = new Data(DateTime.Now);
if(Request.QueryString["ID"] == null)
Response.Redirect("../home");
string theID = Request.QueryString["ID"].ToString();
DataView dv = dat.GetDataDV("SELECT * FROM HippoBlogContent WHERE ID=" + theID);
TitleLiteral.Text = dv[0]["Title"].ToString();
TagLineLiteral.Text = dv[0]["TagLine"].ToString();
MainContentLiteral.Text = dv[0]["MainContent"].ToString();
MainImage.Visible = false;
if (dv[0]["MainImage"].ToString() != "")
{
MainImage.ImageUrl = dv[0]["MainImage"].ToString();
MainImage.Visible = true;
}
Page.Title = dat.MakeNiceName(dv[0]["Title"].ToString());
}
示例12: GetEmailString
protected string GetEmailString(string header, string picture, string ID, string description,
string userName, ref int normalAdCount, string templateID)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
DateTime isn = DateTime.Now;
if (!DateTime.TryParse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"), out isn))
isn = DateTime.Now;
DateTime isNow = isn;
Data dat = new Data(isn); string adtitle = "style=\"color: #7c7a7a;font-size: 14px;font-weight: bold;text-decoration: none;\"";
string adbody = "style=\"color: #7c7a7a;font-size: 12px;font-weight: normal;\"";
string readmorelink = "style=\"color: #09718F;text-decoration: none;cursor: pointer;\"";
string email = "";
string w = "";
string h = "";
if (normalAdCount % 2 == 0)
{
email += "<tr><td>";
}
else
{
email += "<td>";
}
email += "<div align=\"center\" style=\"position: relative;float: left;width: 198px; height: 262px;border: solid 1px #d9d6d6; " +
"margin-right: 2px; " +
"\">";
if (picture == null)
{
email += "<div style=\"padding-top: 10px; clear: both; padding-left: 1px;\">";
}
else
{
GetAdSize(out w, out h, picture, templateID);
if (templateID == "1")
{
email += "<div style=\"padding-top: 10px; clear: both; padding-left: 1px;\"><div style=\"float: left;padding-right: 2px;\"><table width=\"100px\" height=\"100px\" " +
"cellpadding=\"0\" cellspacing=\"0\"><tbody align=\"center\"><tr><td valign=\"middle\">";
}
else if (templateID == "2")
{
email += "<div style=\"padding-top: 10px; clear: both;\"><div style=\"float: left;padding-right: 2px;\"><table width=\"198px\" height=\"140px\" " +
"cellpadding=\"0\" cellspacing=\"0\"><tbody align=\"center\"><tr><td valign=\"middle\"> ";
}
else
{
email += "<div style=\"clear: both;\"><div center=\"float\" style=\"float: left;\"><table width=\"198px\" height=\"262px\" " +
"cellpadding=\"0\" cellspacing=\"0\"><tbody align=\"center\"><tr><td valign=\"middle\"> ";
}
if (ID == null)
{
email += "<img alt=\"" + header + "\" " +
"name=\"" + header + "\" width='" + w + "px' height='" + h + "px' src=\"./UserFiles/" +
userName + "/" + picture + "\" /></td></tr></tbody></table></div>";
}
else
{
email += "<a href=\"http://HippoHappenings.com/" + dat.MakeNiceName(header) + "_" + ID + "_Ad" +
"\" ><img style='border: 0;' alt=\"" + header + "\" " +
"name=\"" + header + "\" width='" + w + "px' height='" + h + "px' src=\"http://hippohappenings.com/UserFiles/" +
userName + "/" + picture + "\" /></a></td></tr></tbody></table></div>";
}
}
if (ID == null)
{
if (templateID == "1")
{
email += "<div><a class=\"Text14\">" + dat.BreakUpString(header, 10) +
"</a></div></div>" +
"<div align=\"center\" style=\"clear: both; padding-left: 2px; padding-right: 2px;" +
"padding-top: 1px;\"> " +
"<span class=\"Text12\">" +
dat.BreakUpString(description, 21) + "</span>" +
"</div>" +
"<div style=\"clear: none;\"><a class=\"ReadMoreHome2\">Read More</a>" +
"</div></div>";
}
else if (templateID == "2")
{
email += "</div><div style=\"padding-top: 5px; clear: both; padding-right: 4px;padding-left: 4px;\"><a class=\"Text14\">" +
dat.BreakUpString(header, 21) +
"</a></div>" +
"<div align=\"center\" style=\"clear: both; padding-left: 4px; padding-right: 4px;\"> " +
"<span class=\"Text12\">" +
dat.BreakUpString(description, 21) + "</span>" +
"</div>" +
"<div style=\"clear: none;\"><a class=\"ReadMoreHome2\">Read More</a>" +
"</div></div>";
}
}
else
//.........这里部分代码省略.........
示例13: GetAds
protected void GetAds()
{
AdPanel.Controls.Clear();
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataSet dsAds = dat.GetData("SELECT * FROM Ads WHERE User_ID=" + Session["User"].ToString() + " ORDER BY Header");
DataView dvAdds = new DataView(dsAds.Tables[0], "", "", DataViewRowState.CurrentRows);
Panel panel;
ASP.controls_pager_ascx pagerPanel = new ASP.controls_pager_ascx();
if (dvAdds.Count > 0)
{
pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 10;
pagerPanel.WIDTH = 576;
pagerPanel.NUMBER_OF_VISIBLE_PAGES = 4;
ArrayList a = new ArrayList(dvAdds.Count);
int pagecount = 1;
for (int i = 0; i < dvAdds.Count; i++)
{
string featured = "False";
if (bool.Parse(dvAdds[i]["Featured"].ToString()))
featured = "True";
Literal label = new Literal();
label.Text = "<tr><td><a class=\"AddGreyLinkAlt\" style=\"padding-left: 10px;\" " +
"href=\"" + dat.MakeNiceName(dvAdds[i]["Header"].ToString()) + "_" +
dvAdds[i]["Ad_ID"].ToString() + "_Ad\">" + dvAdds[i]["Header"].ToString() +
"</a></td><td><label class=\"AddGreenLink\">" + featured + "</label></td>";
string disableStr = "";
if (bool.Parse(dvAdds[i]["LIVE"].ToString()))
{
disableStr = "<td><a class=\"PageButtons\" onclick=\"OpenRadDeleteAd(" + dvAdds[i]["Ad_ID"].ToString() +
")\">Disable</a></td>";
}
else
{
disableStr = "<td><a class=\"PageButtons\" onclick=\"OpenRadEnableAd(" + dvAdds[i]["Ad_ID"].ToString() +
")\">Enable</a></td>";
}
if (featured == "True")
{
label.Text += "<td><a class=\"AddGreyLinkAlt\" href=\"AdStatistics.aspx?Ad=" +
dvAdds[i]["Ad_ID"].ToString() + "\">View Statistics</a></td><td width=\"50px\"><a " +
"class=\"PageButtons\" href=\"PostAnAd.aspx?copy=true&ID=" +
dvAdds[i]["Ad_ID"].ToString() + "\">Copy</a></td>"+disableStr+"</tr>";
}
else
{
label.Text += "<td></td><td width=\"50px\"><a " +
"class=\"PageButtons\" href=\"PostAnAd.aspx?copy=true&ID=" +
dvAdds[i]["Ad_ID"].ToString() + "\">Copy</a></td>"+disableStr+"</tr>";
}
//panel = new Panel();
//Literal lNew = new Literal();
if ((i % pagerPanel.NUMBER_OF_ITEMS_PER_PAGE) == 0)
{
label.Text = "<table width=\"576px\"><tbody style=\"opacity: .7; filter: alpha(opacity = 70);background-color: #603E6A;\"><tr><td width=\"400px\"><label>Ad Name</label></td><td><label>Featured?</label></td><td></td><td></td><td></td></tr>"
+ label.Text;
//panel.Controls.Add(lNew);
}
//Literal lOld = new Literal();
//panel.Controls.Add(label);
if ((i + 1) == 10 * pagecount || i == dvAdds.Count - 1)
{
label.Text = label.Text + "</tbody></table>";
pagecount++;
//panel.Controls.Add(lOld);
}
a.Add(label);
}
pagerPanel.DATA = a;
pagerPanel.DataBind2();
AdPanel.Controls.Add(pagerPanel);
}
else
{
pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 1;
pagerPanel.WIDTH = 576;
pagerPanel.NUMBER_OF_VISIBLE_PAGES = 1;
ArrayList a = new ArrayList(1);
Literal lit = new Literal();
lit.Text = "<label>You are not an owner of any ads. To post ads go to <a href=\"PostAnAd.aspx\" class=\"AddLink\">Post An Ad page</a>.</label>";
a.Add(lit);
pagerPanel.DATA = a;
pagerPanel.DataBind2();
AdPanel.Controls.Add(pagerPanel);
}
}
示例14: GetVenues
protected void GetVenues()
{
VenuesPanel.Controls.Clear();
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataSet dsAds = dat.GetData("SELECT * FROM Venues WHERE Owner=" + Session["User"].ToString() + " ORDER BY Name");
DataView dvAdds = new DataView(dsAds.Tables[0], "", "", DataViewRowState.CurrentRows);
ASP.controls_pager_ascx pagerPanel = new ASP.controls_pager_ascx();
if (dvAdds.Count > 0)
{
pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 10;
pagerPanel.WIDTH = 576;
pagerPanel.NUMBER_OF_VISIBLE_PAGES = 4;
ArrayList a = new ArrayList(dvAdds.Count);
int pagecount = 1;
for (int i = 0; i < dvAdds.Count; i++)
{
Literal label = new Literal();
//label.CssClass = "AddLink";
if (i % 10 == 0)
label.Text = "<table width=\"576px\"><tbody style=\"opacity: .8; filter: alpha(opacity = 80);background-color: #603E6A;\">";
label.Text += "<tr><td><a class=\"AddGreyLinkAlt\" style=\"padding-left: 10px;\" href=\"" +
dat.MakeNiceName(dvAdds[i]["Name"].ToString()) + "_" + dvAdds[i]["ID"].ToString() +
"_Venue\">" +
dvAdds[i]["Name"].ToString() + "</a></td></tr>";
if ((i + 1) == 10 * pagecount || i == dvAdds.Count - 1)
{
label.Text += "</tbody></table>";
pagecount++;
}
//panel = new Panel();
//panel.Controls.Add(label);
a.Add(label);
}
pagerPanel.DATA = a;
pagerPanel.DataBind2();
VenuesPanel.Controls.Add(pagerPanel);
}
else
{
pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 1;
pagerPanel.WIDTH = 576;
pagerPanel.NUMBER_OF_VISIBLE_PAGES = 1;
ArrayList a = new ArrayList(1);
Literal lit = new Literal();
lit.Text = "<label>You are not an owner of any venues. To post venues go to <a href=\"EnterVenueIntro.aspx\" class=\"AddLink\">Post A Venue page</a>.</label>";
a.Add(lit);
pagerPanel.DATA = a;
pagerPanel.DataBind2();
VenuesPanel.Controls.Add(pagerPanel);
}
}
示例15: GetEvents
protected void GetEvents()
{
EventsPanel.Controls.Clear();
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataSet dsAds = dat.GetData("SELECT * FROM Events WHERE Owner=" + Session["User"].ToString() + " ORDER BY Header");
DataView dvAdds = new DataView(dsAds.Tables[0], "", "", DataViewRowState.CurrentRows);
Panel panel;
ASP.controls_pager_ascx pagerPanel = new ASP.controls_pager_ascx();
if (dvAdds.Count > 0)
{
pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 10;
pagerPanel.WIDTH = 576;
pagerPanel.NUMBER_OF_VISIBLE_PAGES = 4;
ArrayList a = new ArrayList(dvAdds.Count);
int pagecount = 1;
for (int i = 0; i < dvAdds.Count; i++)
{
Literal label = new Literal();
//label.CssClass = "AddLink";
string disableStr = "";
if (bool.Parse(dvAdds[i]["LIVE"].ToString()))
{
disableStr = "<td width=\"50px\"><a class=\"PageButtons\" onclick=\"OpenRadDeleteEvent(" + dvAdds[i]["ID"].ToString() +
")\">Disable</a></td>";
}
else
{
disableStr = "<td width=\"50px\"><a class=\"PageButtons\" onclick=\"OpenRadEnableEvent(" + dvAdds[i]["ID"].ToString() +
")\">Enable</a></td>";
}
if (i % 10 == 0)
label.Text = "<table width=\"576px\"><tbody style=\"background-color: #628E02;opacity: .8; filter:alpha(opacity = 80);\">";
label.Text += "<tr><td><a class=\"AddGreyLinkAlt\" style=\"padding-left: 10px;\" href=\"" +
dat.MakeNiceName(dvAdds[i]["Header"].ToString()) + "_" + dvAdds[i]["ID"].ToString() + "_Event\">" +
dvAdds[i]["Header"].ToString() + "</a></td><td width=\"50px\"><a style=\"font-family: Arial; font-size: 14px;text-decoration: none; color: #cccccc; font-weight: bold;\" href=\"BlogEvent.aspx?copy=true&ID=" +
dvAdds[i]["ID"].ToString() + "\">Copy</a></td>"+disableStr+"</tr>";
if ((i + 1) == 10 * pagecount || i == dvAdds.Count - 1)
{
label.Text += "</tbody></table>";
pagecount++;
}
//panel = new Panel();
//panel.Controls.Add(label);
a.Add(label);
}
pagerPanel.DATA = a;
pagerPanel.DataBind2();
EventsPanel.Controls.Add(pagerPanel);
}
else
{
pagerPanel.NUMBER_OF_ITEMS_PER_PAGE = 1;
pagerPanel.WIDTH = 576;
pagerPanel.NUMBER_OF_VISIBLE_PAGES = 1;
ArrayList a = new ArrayList(1);
Literal lit = new Literal();
lit.Text = "<label>You are not an owner of any events. To post events go to <a href=\"EnterEvent.aspx\" class=\"AddLink\">Post An Event page</a>.</label>";
a.Add(lit);
pagerPanel.DATA = a;
pagerPanel.DataBind2();
EventsPanel.Controls.Add(pagerPanel);
}
}