本文整理汇总了C#中Forum.LitePopulate方法的典型用法代码示例。如果您正苦于以下问题:C# Forum.LitePopulate方法的具体用法?C# Forum.LitePopulate怎么用?C# Forum.LitePopulate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forum
的用法示例。
在下文中一共展示了Forum.LitePopulate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
HtmlGenericControl _nc = (HtmlGenericControl)Master.FindControl("navForum");
_nc.Attributes.Add("class", "active");
String _forumId = Request.QueryString["forumId"];
if (!String.IsNullOrEmpty(_forumId))
{
ViewState.Add("forumId", _forumId);
Forum _frm = new Forum(this.ConnectionString);
_frm.LitePopulate(ViewState["forumId"], false);
txt_Desc.Text = _frm.Description;
txt_Title.Text = _frm.Title;
ch_Active.Checked = _frm.Active;
lbl_Header.Text = String.Format("{0}", _frm.Title);
}
else
{
lbl_Header.Text = "Add Forum";
}
}
}
示例2: Save_Click
protected void Save_Click(Object sender, EventArgs e)
{
if (IsValid)
{
Forum _frm = new Forum(this.ConnectionString);
if (ViewState["forumId"] != null)
{
_frm.LitePopulate(ViewState["forumId"], false);
}
_frm.Title = txt_Title.Text;
_frm.Description = txt_Desc.Text;
_frm.Active = ch_Active.Checked;
if (_frm.Save())
{
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", "alert('Record has been updated successfully.');self.location = 'Forums.aspx';", true);
}
else
{
lbl_Error.Text = "An unexpected error has occurred. Please try again.";
lbl_Error.Visible = true;
}
}
}
示例3: Updade_Click
protected void Updade_Click(object sender, EventArgs e)
{
Forum _st = null;
foreach (GridViewRow I in gv_Forum.Rows)
{
Label _id = (Label)I.FindControl("lbl_Id");
if (_id != null)
{
TextBox _sort = (TextBox)I.FindControl("txt_Sort");
if (Regex.IsMatch(_sort.Text, @"\d+", RegexOptions.IgnoreCase))
{
_st = new Forum(this.ConnectionString);
_st.LitePopulate(_id.Text, false);
_st.Sort = Convert.ToInt32(_sort.Text);
_st.Save();
}
}
}
BindData();
}