Click here to Skip to main content
16,012,352 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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;
}
C#
if(txtbox2.text!='')
       {
         YY=txtbox2.text;
        }

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



}
 
Share this answer
 
v2
Here, try this:
string _value = "";

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

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

if(textbox3.Text != "")
{
    _value = textbox3.Text;
}
 
Share this answer
 
Comments
Avik Ghosh22 6-Mar-13 0:51am    
good...5!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900