Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 9669 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > How to get asp:text box value ? ...
Abhisekjani

How to get asp:text box value ?

Replies: 5 | Posted by: Abhisekjani on 10/19/2012 | Category: ASP.NET Forums | Views: 378 | Status: [Member] | Points: 10  


Hi
in my page i have a asp:textbox controls but i am unable to get the value
my code is below
<asp:TextBox ID="text1" runat="server"
ontextchanged="text1_TextChanged" TextMode="MultiLine"
Width="200px"></asp:TextBox>

but in code behind text1.text it not taking the user input text it always shows blank
so how to get the textbox value


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Gow.Net
Gow.Net  
Posted on: 10/19/2012 8:52:59 AM
Level: Starter | Status: [Member] | Points: 25

please show me your coding

gowthaman8870226416

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Vasanthmvp
Vasanthmvp  
Posted on: 10/19/2012 12:05:56 PM
Level: Starter | Status: [Member] | Points: 25

Post your Codebehind code also.
In the page_load method, did you include anything related to textbox.. i think it is getting cleared off.

Regards,

Awesome Coding !! :)

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Jayakumars
Jayakumars  
Posted on: 10/20/2012 2:03:39 AM  Download source file
Level: Bronze | Status: [Member] | Points: 25

hi
Abhisekjani

try this code

client Side

<asp:TextBox ID="text1" runat="server" AutoPostBack ="true"
ontextchanged="text1_TextChanged" TextMode="MultiLine"
Width="200px"></asp:TextBox>


Server Side

protected void text1_TextChanged(object sender, EventArgs e)
{
Response.Write(text1.Text);
}


this is working in my pc see this image file also

Mark as Answer if its helpful to you

Regards
Email Id: kumaraspcode2009@gmail.com

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Bhupentiwari
Bhupentiwari  
Posted on: 10/20/2012 2:52:10 AM
Level: Starter | Status: [Member] | Points: 25

it is working in my pc also....

Thanks n Regards
Bhupendra Tiwari

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sourabh07
Sourabh07  
Posted on: 10/20/2012 5:29:22 AM
Level: Starter | Status: [Member] | Points: 25

Hi..

if you want to see the output of this event.....

try to postback the page after inputing the text in the Textbox..

eg: 1st enter the text in the textbox then after click on the button if it is on the page to postback the page...then it will show your output....:-)

Sourabh07

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/18/2013 10:05:52 PM