i am new to asp.net ,i have two textboxes and in one user will enter value which will get added to the other automatically generated textbox value.But is user is not entering any value it is showing error.Any solution to solve this

Recommended Answers

All 6 Replies

i am new to asp.net ,i have two textboxes and in one user will enter value which will get added to the other automatically generated textbox value.But is user is not entering any value it is showing error.Any solution to solve this

Hi,
Check the availability of the value for the first checkbox before inserting the value into another textbox

if(textbox1.text!=" ")
{
  textbox2.text=textbox1.text);
}

All The Best

Assigning an empty textbox value another textbox will not throw error.

Could you please post the error messge that you are getting.

You can also post some code which will help us to understand the problem and provide quick solution to you.

thanks i got the solution

if (this.TextBox1.Text.Trim().Length > 0)

{

this.TextBox2.Text = this.TextBox1.Text;

}

SNIP

Hi anudjoe,

Mark this thread as solved if you question is answered.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.