Пример #1
0
 // Methods
 protected void Page_Init(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string[] segments = base.Request.Url.Segments;
         int index = segments.Length - 1;
         string str = segments[index];
         string str2 = str.Replace("-", " ").Replace(".aspx", string.Empty);
         Topic topic = new Topic();
         topic.Title = str2;
         topic.PageName = str;
         if (topic.Load())
         {
             this.TopicID = topic.TopicID;
             this.lblNumView.Text = topic.NumView.ToString();
             this.lblTimeCreated.Text = topic.TimeCreated.ToShortDateString();
             this.lblTimeUpdated.Text = topic.TimeUpdated.ToShortDateString();
         }
     }
 }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CtlLogin1.WidthTextbox = 120;

            if (!this.Page.IsPostBack)
            {
                base.Keywords = "";
                base.Description = "";
                Topic oTopic = new Topic();
                this.dgMyArtical.DataSource = oTopic.LoadAll();
                this.dgMyArtical.DataBind();
            }
        }