Hi,
I've got a webform, which takes customer details in, - if the customers time at their address is less than 3 years, I need to take a previous address, but I don't want the previous adress entry fields visible, if this is not the case, and when the page is first loaded.
Currently, I'm testing - the previous address fields will eventually be contained in a panel I guess - but for the time being I'm practising with a label.
I've got my form fields txtYears and txtMonths in a normal HTML table - the months text field has AutoPostBack enabled - and these two fields are contained within an UpdatePanel so I dont refresh the whole page (I'd like this to be fluid). My code behind is simply:
if (Page.IsPostBack)
{
int Years = Convert.ToInt32(txtYears.Text);
int Months = Convert.ToInt32(txtMonths.Text);
int TotalMonths = ((Years * 12) + Months);
if (TotalMonths < 36)
{
Label1.Visible = true;
}
else
{
Label1.Visible = false;
}
}
- eventually I guess I'd like the Label1 to be the Panel, but as the Label is outside of the update panel, it's not being shown (it's invisible at startup) - is there anyway that I can achieve this?
Thanks