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;
}
精彩评论