TAILIEUCHUNG - ASP.NET 4 Unleased - p 24

Using the Rich Controls protected void calSchedule_DayRender(object sender, DayRenderEventArgs e) { if (().Length 0) = ; } Calendar Database | 204 CHAPTER 4 Using the Rich Controls protected void calSchedule_DayRender object sender DayRenderEventArgs e if .Length 0 script html xmlns http 1999 xhtml head id Head1 runat server title Calendar Database title head body form id form1 runat server div asp Calendar id calSchedule OnDayRender calSchedule_DayRender Runat server br asp FormView id frmSchedule AllowPaging True DataKeyNames EntryDate DataSourceID srcSchedule Runat server EmptyDataTemplate asp LinkButton id btnNew Text Add Entry CommandName New Runat server EmptyDataTemplate ItemTemplate h1 Eval EntryDate 0 D h1 Eval Entry br br asp LinkButton Id btnEdit Text Edit Entry CommandName Edit Runat server asp LinkButton Id lnkDelete From the Library of Wow eBook Displaying a Calendar 205 Text Delete Entry CcmmandName Delete OnClientClick return ccnfirm Delete entry Runat server ItemTemplate EditItemTemplate asp Label id lblEntry Text Entry AsscciatedCcntrclID txtEntry Runat server br asp TextBcx id txtEntry Text Bind Entry TextMcde MultiLine Cclumns 40 Rcws 8 Runat server br asp LinkButtcn id btnUpdate Text Update CcmmandName Update Runat server EditItemTemplate InsertItemTemplate asp Label id lblEntry Text Entry AsscciatedCcntrclID txtEntry Runat server br asp TextBcx id txtEntry Text Bind Entry TextMcde MultiLine Cclumns 40 Rcws 8 Runat server br asp Buttcn id btnInsert Text Insert CcmmandName Insert Runat server 4 From the Library of Wow eBook 206 CHAPTER 4 Using the Rich Controls InsertItemTemplate asp FormView asp SqlDataSource id srcSchedule ConnectionString Server . SQLExpress Integrated Security True AttachDbFileName DataDirectory User Instance True SelectCommand SELECT EntryDate Entry FROM Schedule WHERE EntryDate @EntryDate InsertCommand INSERT Schedule EntryDate Entry VALUES @EntryDate @Entry UpdateCommand UPDATE Schedule SET Entry @Entry WHERE EntryDate @EntryDate DELETECommand DELETE Schedule .