How can I use a Calendar Control to show specific dates highlighted and display relevant data for that date

<asp:Calendar id=’Calendar1′ OnDayRender =’CalDayRender’ runat=’server’></asp:Calendar> Dim ds As DataSet Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ’Put user code to initialize the page here ’Fill the DataSet End Sub Protected Sub CalDayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs) Dim strName As New StringBuilder strName.Append(‘ ‘) Dim theDay As DateTime = e.Day.Date Dim sql As String = ‘hiredate=’’ + DateTime.Parse(theDay.ToString(‘d’)) + ‘’ ‘ Dim dr As DataRow() = ds.Tables(0).Select(sql) Dim drRow As DataRow For Each drRow In dr strName.Append(‘’<a href=empdetails.aspx?id=’ + drRow(‘Employeeid’).ToString() + ‘>’ + drRow(‘FirstName’).ToString() + ‘ ‘ + drRow(‘LastName’).ToString() + ‘</a><br>’’) e.Cell.BackColor = Color.Teal e.Cell.ForeColor = Color.Wheat Next drRow strName.Append(”) e.Cell.Controls.Add(New LiteralControl(strName.ToString())) End Sub ’CalDayRender C# DataSet ds ; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here //Populate the DataSet } protected void CalDayRender(object sender, DayRenderEventArgs e) { StringBuilder strName = new StringBuilder(); strName.Append(‘ ‘); DateTime theDay = e.Day.Date; string sql =’hiredate=’’ + DateTime.Parse ( theDay.ToString(‘d’)) + ‘’ ‘; DataRow [] dr = ds.Tables[0].Select(sql); foreach(DataRow drRow in dr) { strName.Append(‘’<a href=empdetails.aspx?id=’ + drRow(‘Employeeid’).ToString() + ‘>’ + drRow(‘FirstName’).ToString() + ‘ ‘ + drRow(‘LastName’).ToString() + ‘</a><br>’’) e.Cell.BackColor = Color.Teal; e.Cell.ForeColor = Color.Wheat; } strName.Append(”); e.Cell.Controls.Add(new LiteralControl(strName.ToString())); }

Why doesn’t my Collection Properties get saved in the aspx file properly during design-time?

Some common mistakes that will cause the designer to choke while persisting collection properties are: The corresponding collection type cannot have multiple (overloaded) indexers. You should always define a single indexer of the type ‘public SomeType this[object obj]{…}‘. Otherwise the changes will be persisted but the control will not load in the designer. You will see a ‘Ambiguous match found’ error. If the collection property has the PersistenceMode attribute set to InnerProperty then the property should not include a set method.

How can MultiView Control be created in 2.0?

A MultiView is a non-visual control that provides a pallette where a several view Controls can be placed. A view control is another non-visual control where you can place the user interface controls.It is simillar to that of a Tab control.The below code demonstrate how MultiView can be created, <div> <asp:Button id=’Button1′ runat=’server’ Text=’View 1′ OnClick=’Button1_Click’ /> <asp:Button id=’Button2′ runat=’server’ Text=’View 2′ OnClick=’Button2_Click’ /> <asp:Button id=’Button3′ runat=’server’ Text=’View 3′ OnClick=’Button3_Click’ /> <br /> <br /> <asp:MultiView id=’MultiView1′ runat=’server’ ActiveViewIndex=0> <asp:View id=’View1′ runat=’server’> Content Here (View 1)… <asp:BulletedList ID=’BulletedList1′ runat=’server’> <asp:ListItem>My Schedule On 1st Week</asp:ListItem> <asp:ListItem>My Schedule On 2nd Week</asp:ListItem> <asp:ListItem>My Schedule On 3rd Week</asp:ListItem> <asp:ListItem>My Schedule On 4th Week</asp:ListItem> </asp:BulletedList> </asp:View> <asp:View id=’View2′ runat=’server’> Content Here (View 2)… <asp:Calendar ID=’Calendar1′ runat=’server’ BackColor=’#FFFFCC’ BorderColor=’#FFCC66′ BorderWidth=’1px’ DayNameFormat=’Shortest’ Font-Names=’Verdana’ Font-Size=’8pt’ ForeColor=’#663399′ Height=’200px’ ShowGridLines=’True’ Width=’220px’> <SelectedDayStyle BackColor=’#CCCCFF’ Font-Bold=’True’ /> <TodayDayStyle BackColor=’#FFCC66′ ForeColor=’White’ /> <SelectorStyle BackColor=’#FFCC66′ /> <OtherMonthDayStyle ForeColor=’#CC9966′ /> <NextPrevStyle Font-Size=’9pt’ ForeColor=’#FFFFCC’ /> <DayHeaderStyle BackColor=’#FFCC66′ Font-Bold=’True’ Height=’1px’ /> <TitleStyle BackColor=’#990000′ Font-Bold=’True’ Font-Size=’9pt’ ForeColor=’#FFFFCC’ /> </asp:Calendar> </asp:View> <asp:View id=’View3′ runat=’server’> Content Here (View 3)… <br /> <asp:Label ID=’Label1′ runat=’server’ Text=’Schedule Details’></asp:Label> </asp:View> </asp:MultiView> </div>

What is an Validation Groups in 2.0 and how can u create them?

Validation Groups allows the different section of the webpage to be validated seperately. All the ASP.NET 2.0 Validation controls,interactive form controls like TextBox,list controls Button and other controls that are used to submit a webform have validationGroup property. The default value of this property is the empty string. When a button with a ValidationGroup property is clicked all of the validation controls on the page with the same ValidationGroup property value are executed. On postback, the Page.IsValid property checks the validity of all of the validation controls. Programmatically it can be checked by the Validate() Method. <html> <head runat=’server’> <title>Validation Groups</title> <script runat=’server’> void Group1Click(Object s, EventArgs e) { if (Page.IsValid) { lblResult.Text = ‘Name Validated & Submitted’; } } void Group2Click(Object s, EventArgs e) { if (Page.IsValid) { lblResult.Text = ‘Age Validated & Submitted’; } } </script> </head> <body> <form id=’form1′ runat=’server’> <div> <asp:Label ID=’lblResult’ Runat=’Server’ /> <fieldset style=’padding:20px’> <legend>Name</legend> <asp:Label ID=’Name’ runat=’server’ Text=’Name:’></asp:Label> <asp:TextBox id=’TextBox1′ Runat=’Server’/> <asp:Button ID=’Button1′ ValidationGroup=’Group1′ Text=’Submit’ OnClick=’Group1Click’ Runat=’Server’ /> <asp:RequiredFieldValidator ID=’RequiredFieldValidator1′ ValidationGroup=’Group1′ ControlToValidate=’TextBox1′ Text=’Field Cannot Be Empty’ Runat=’Server’ /> </fieldset> <fieldset style=’padding:20px’> <legend>Age</legend> <asp:Label ID=’Label1′ runat=’server’ Text=’Age:’></asp:Label> <asp:TextBox id=’TextBox2′ Runat=’Server’ /> <asp:Button ID=’Button2′ ValidationGroup=’Group2′ Text=’Submit’ OnClick=’Group2Click’ Runat=’Server’ /> <asp:RangeValidator ID=’RangeValidator1′ runat=’server’ ErrorMessage=’Enter Age between 18 To 58′ MaximumValue=’58’ MinimumValue=’18’ ValidationGroup=’Group2′ ControlToValidate=’TextBox2′> Enter Age between 18 To 58</asp:RangeValidator> </fieldset> </div> </form> </body> </html>