Solved

Problem to take value of TextBox in C#

Posted on 2011-03-14
4
218 Views
Last Modified: 2012-05-11
Hello... well i need take a value of textbox

I have a textbox in my page and the user, insert a new value, next when click on button the information is save in DB... but I recieve 0 that it's the value of TextBox before changed...

I try with

string value= TextBox1.Text;

but it doesnt work...
0
Comment
Question by:tenriquez199
4 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 35136181
What kind of application are we talking ? Windows or webbased ?
When you execute the update, does it store the new value or is the value never changed ?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35136184
How do you test what value is saved in the database?
0
 
LVL 18

Accepted Solution

by:
Ajay Sharma earned 500 total points
ID: 35136231
Is your textbox value getting set into the Page_Load metho?
If yes then set it inside the below condition:

If (Page.IsPostback==false)
{
txt.Text = "0";
}


Also, post your page code, it will help us in better understanding the code.
0
 
LVL 1

Author Closing Comment

by:tenriquez199
ID: 35335724
yks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Media.Imaging 1 24
Call Controller Action Method from ASPX 2 22
How to read text with RegEx... 2 25
C# Linq - Join two objects into one 3 13
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question