开发者

keeeping a checkbox open in default

i have a page with a checkbox. it has the related .cs code -->开发者_开发百科

protected void chkShowAll_CheckedChanged(object sender, EventArgs e)
{
    ctrlTime.ShowAllProjects = chkShowAll.Checked;
}

on clicking on the checkbox, a table appears. How do i keep that checkbox open by default so that the table appears WITH the page rather than checking on the box to access it?


Set the default state of the checkbox to "Checked", and set the appropriate "table load" property at page load time.

<asp:CheckBox ID="chkShowAll" runat="server" Checked="True" />

...

protected void Page_Load(object sender, EventArgs e)
{
    ctrlTime.ShowAllProjects = chkShowAll.Checked;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜