Click here to Skip to main content
14,669,324 members
Rate this:
Please Sign up or sign in to vote.
See more:
hello !! i have three textboxes inside one button click event how to get the any one values of the textbox in asp.net..
Posted

Rate this:
Please Sign up or sign in to vote.

Solution 1

Here, try this:
string _value = "";

if(textbox1.Text != "")
{
    _value = textbox1.Text;
}

if(textbox2.Text != "")
{
    _value = textbox2.Text;
}

if(textbox3.Text != "")
{
    _value = textbox3.Text;
}
   
Comments
Avik Ghosh22 6-Mar-13 0:51am
   
good...5!
Rate this:
Please Sign up or sign in to vote.

Solution 2

On Buton Click event You can Declare Three Variable Like Below
protected void Buton _Click(object sender, EventArgs e)
{
String xx;
String YY;
String ZZ;
if(txtbox1.text!='')
{
xx=txtbox1.text;
}
if(txtbox2.text!='')
       {
         YY=txtbox2.text;
        }

if(txtbox3.text!='')
       {
         ZZ=txtbox3.text;
        }



}
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100