Asp Control ASP.Net

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>



    Select Date
    
        function SetDate(dateToSet)
        {
            controlName = window.location.search.substr(1).substring(8);
            window.opener.document.forms[0].elements[controlName].value = dateToSet;
            self.close();
        }
    


    
    

                      runat="server" 
                  BackColor="White" 
                  BorderColor="#999999" 
                  CellPadding="4" 
                  DayNameFormat="Shortest" 
                  Font-Names="Verdana" 
                  Font-Size="8pt" 
                  ForeColor="Black" 
                  Height="100%" 
                  Width="100%" 
                  OnDayRender="calDefault_DayRender" >
        
        
        
        
        
        
        
        
    
    

    


File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default : System.Web.UI.Page
{
  protected void calDefault_DayRender(object sender, DayRenderEventArgs e)
  {
    HyperLink link = new HyperLink();
    LiteralControl lc = (LiteralControl)e.Cell.Controls[0];
    link.Text = lc.Text;
    link.NavigateUrl = "javascript:SetDate('" + e.Day.Date.ToShortDateString() + "');";
    e.Cell.Controls.Clear();
    e.Cell.Controls.Add(link);
  }
}