How to take value from client side control from server side code?

Hi all,

I would like to know that, how to access client side control in server side code?

Here is an example..

I am having the textBox in client side like

I need to take the value from this textBox in button click event which is server side code.

private void buttonShow(object sender, System.EventArgs e) {

//I need to access this textBox here.

}

How to do that?

Thanks

R. eswaran.

0
Eswaran_MCA
2/18/2009 7:02:50 AM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 6 followers.

💬 6 Replies
👁️‍🗨️ 1360 Views

hi

you need to make it run at server.

runat="server" name="textBoxUsername"/>

now you can fetch it as you fetch asp controls

textBoxUsername.Text="Admin"


Diseirra
Mark it as an answer, if it helped you anyhow...
0
diseirra
2/18/2009 8:24:22 AM

 Hi,

You need to put attribute runat="server" to HTML controls to use them in code behind pages.

 


Please mark it as answer if this post seems to be useful.
0
nishit_123
2/18/2009 8:39:45 AM

Hi all,

No. I would like to know how to access that client control in server side code.

Is there any other way?

Thanks

R.Eswaran

0
Eswaran_MCA
2/18/2009 8:55:26 AM

 

why can't you make the client control runat=server.

Tell us yr exact situation/requirement so that we can give better ideas/solutions. 


Diseirra
Mark it as an answer, if it helped you anyhow...
0
diseirra
2/18/2009 8:58:02 AM

 Hi Eswaran,

The thing you are talking off is not yet provided in Microsoft.net framework.  So please contact bill gates to include it in thier next framework.!


Please mark it as answer if this post seems to be useful.
0
nishit_123
2/18/2009 9:02:00 AM

Eswaran_MCA:

No. I would like to know how to access that client control in server side code.

Is there any other way?

 

Hi,

Another way would be using Request.Form like

Request.Form["textBoxUsername"].


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
0
vinz
2/18/2009 9:04:20 AM