Click here to Skip to main content
15,906,301 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
i m having two text box. in first text box if i entered test1 and in second text box i return test5.

in database i am having test1,test2,test3,test4,test5 value this should be shown in gridview.
please give me solution.
Posted
Updated 1-May-11 21:59pm
v5
Comments
Ankit Rajput 2-May-11 2:39am    
Provide some code. and tell the problem
Pong D. Panda 2-May-11 3:31am    
This is not possible, you cant return a data that is based on query that will use varchar as your reference point for your condition. Use int to do something like this.

Hi,

If you are a beginner then please first go through with this article.
C# for Beginner

We all are here to help you if you get any problem.
But first try it your own.

Regards
AR
 
Share this answer
 
I am having a text box, in that text box having text apple1.
Lets say its name is txtName.

i want to get text value.
String text = txtName.Text;


Is that what you are asking or am I missing something?
 
Share this answer
 
Where do you want the value - at the client side or on the server side code?
a) Client side - Use JavaScript to get the value like this:
JavaScript
var textboxvalue = document.getElementById("TextBoxID").value;

b) Server side -
C#
String textboxvalue = TextBoxID.Text;


Here, TextBoxID is the id of the textbox whose text you want.

This is a very basic question. I suggest you to get a beginner ASP.NET book and read it before you start programming. It will help you in the long run. :thumbsup:
 
Share this answer
 
Comments
beginner in C#.net 2-May-11 3:05am    
sir if we use int.parse we can get integer... if i want to select first three value in text box means
Ankur\m/ 2-May-11 3:12am    
use the substring method. Considering example in my answer, it will be - test.Substring(0, 3);
Or directly, TextBoxID.Text.Substring(0, 3); You will have to assign it to another string, because Strings are immutable.

I once again ask you to get a good book and start reading it before you start programming. That will help you a lot.
beginner in C#.net 2-May-11 3:15am    
thank u..
Ankur\m/ 2-May-11 3:20am    
If the answer helped you, you should up-vote and accept it.
Hi,
I think you are a beginner.
string vale="";
vale=txtname.text;

Vale contains that string value.
 
Share this answer
 
v2
Comments
Tarun.K.S 2-May-11 3:25am    
Ashika, avoid using textspeak like u, r. And use <pre> tags to wrap your code.
Sergey Alexandrovich Kryukov 14-Aug-11 2:19am    
The code won't even compile.
--SA
Ashika s 2-May-11 6:24am    
k...........
Sergey Alexandrovich Kryukov 14-Aug-11 2:19am    
I just wonder: do you think you are not the beginner? Perhaps, not even yet!
--SA

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