Hello sir,
I have three text box(tb1,tb2,tb3) where i put nominee Percentage value. And total Percentage of nominee should be 100%. Means add of three text box values ==100.
Now i want like this::=================
if (user put 100 in textbox1(tb1) then thxtbox2 & textbox3 not visible.)
if( value of textbox1(tb1)!= 100 then thxtbox2 is visible)
if( value of textbox1(tb1) + value of thxtbox2 !=100 then thxtbox3 is visible)
if ( value of textbox1(tb1) + value of thxtbox2 +value of thxtbox3 !==100, the data cannot save)
==================================
I have write the code in page load:===========
tbsecondnominee.Visible = false; tbsecondper.Visible = false;
tbthitdnominee.Visible = false; tbthitdnominee.Visible = false;
===============================
And i have write the code in protected void btsave_Click(object sender, EventArgs e)==========
int a, b, c;
a = int.Parse(tbfirstper.Text);
b = int.Parse(tbsecondper.Text);
c = int.Parse(tbthirdper.Text);
if (a != 100)
{
tbsecondnominee.Visible = true; tbsecondper.Visible = true;
}
if (a + b != 100)
{
tbthitdnominee.Visible = true; tbthitdnominee.Visible = true;
}
if (a + b + c != 100)
{
lbper.Text = "Nominee Percentage should be 100";
btsave.Enabled = false;
}
==========================
But it is not working..i cant understand where is my mistake..
Please help me with the code...