ASP.NET - wnat to display the text at runtime - Asked By rajkumar sendhilnathan on 06-Jan-11 01:03 AM

hi


im developing a project in that i have two textbox both of them having calender control

first is txtdate1
2nd is txtdate2

i want to display the date in txtdate2 which i was selected in txtdate1  
harsh shah replied to rajkumar sendhilnathan on 06-Jan-11 01:17 AM
Hi,
on calendar selected index change write below code and set autopostback propery true on calender control.

txtbox2.text=txtbox1.text.tostring();


Regards,
Harsh Shah

assign value into textbox - Lalitha Kumaran replied to rajkumar sendhilnathan on 06-Jan-11 01:17 AM

protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        txtDate1.Text = Calendar1.SelectedDate.ToShortDateString();
        txtDate2.Text = txtDate1.Text;
    }

Anoop S replied to rajkumar sendhilnathan on 06-Jan-11 01:24 AM
Place a Placeholder control on your form with id lets say PlaceHolder1.
Then write this code

TextBox txt = new TextBox();
txt.Id ="txt1";
txt.Text="something;
PlaceHolder1.Controls.Add( txt);

if you want more the make one loop