Qaiser Mehmood

Qaiser Mehmood

  • NA
  • 105
  • 0

Please read and correct this code

Oct 13 2008 8:27 AM
Sir,
I am new in asp.net,
My question was.

If i have two buttons event handlers  how to determined in a calendar selectionchange event handler that which button press first than other.i.e "I want to select date from one calendar with two buttons for two textboxes i.e startdate & enddate" 

Here i  have used Code Please Correct it.
Please correct this code to work I shall be vary thankfull to you.
"''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

ublic partial class Default6 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

protected void Cal1_SelectionChanged(object sender, EventArgs e)

{

if (btnstart.Enabled.Equals(true))

{

txtstart.Text = Cal1.SelectedDate.ToShortDateString();

Cal1.Visible = false;

btnstart.Enabled = false;

btnend.Enabled = true;

}

else

{

if (btnend.Enabled.Equals(true))

txtend.Text = Cal1.SelectedDate.ToShortDateString();

Cal1.Visible = false;

btnend.Enabled = false;

btnstart.Enabled = true;

}

}

protected void txtstart_TextChanged(object sender, EventArgs e)

{

}

protected void btnstart_Click(object sender, EventArgs e)

{

Cal1.Visible = true;

// txtstart.Text = Cal1.SelectedDate.ToShortDateString();

// Cal1.Visible = false;

}

protected void txtend_TextChanged(object sender, EventArgs e)

{

}

protected void btnend_Click(object sender, EventArgs e)

{

Cal1.Visible = true;

// txtend.Text = Cal1.SelectedDate.ToShortDateString();

// Cal1.Visible = false;

}


Answers (1)