473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Passing a value from server side to client side

Im having a bit of a problem here, what I want to do is a user types
in data in a text box then I need to pass that data to the client side.
The problem Im having is I can't seem to get the value from the text
box be it a regular asp.net text box or even when I assign a value in a
hidden textbox I still can't seem to get the value. I thought using:
document.getElementbyID("Client_ID").innerText would get the value but
its not.
Any help will be greatly appreciated.
Thanks

Jul 12 '06 #1
4 2317
Where is the textbox? Grid/DataList/Repeater? User control? Content page?

Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

<ki*************@consultant.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Im having a bit of a problem here, what I want to do is a user types
in data in a text box then I need to pass that data to the client side.
The problem Im having is I can't seem to get the value from the text
box be it a regular asp.net text box or even when I assign a value in a
hidden textbox I still can't seem to get the value. I thought using:
document.getElementbyID("Client_ID").innerText would get the value but
its not.
Any help will be greatly appreciated.
Thanks

Jul 12 '06 #2
Kimberly,

The first thing to check is whether or not you have the correct client id.
ViewSource on the page and double check what client id your control is being
rendered with.

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<ki*************@consultant.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Im having a bit of a problem here, what I want to do is a user types
in data in a text box then I need to pass that data to the client side.
The problem Im having is I can't seem to get the value from the text
box be it a regular asp.net text box or even when I assign a value in a
hidden textbox I still can't seem to get the value. I thought using:
document.getElementbyID("Client_ID").innerText would get the value but
its not.
Any help will be greatly appreciated.
Thanks

Jul 12 '06 #3
Hi Eliyahu,
The text box is an asp.net text on a user control

Eliyahu Goldin wrote:
Where is the textbox? Grid/DataList/Repeater? User control? Content page?

Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

<ki*************@consultant.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Im having a bit of a problem here, what I want to do is a user types
in data in a text box then I need to pass that data to the client side.
The problem Im having is I can't seem to get the value from the text
box be it a regular asp.net text box or even when I assign a value in a
hidden textbox I still can't seem to get the value. I thought using:
document.getElementbyID("Client_ID").innerText would get the value but
its not.
Any help will be greatly appreciated.
Thanks
Jul 13 '06 #4
You should use the textbox ClientID property. You need to pass it from
server to client. If you do it in a hidden input control, it may look like:

<input type="hidden" id="clientId" runat="server"/>
....
var clientId=document.getElementById("clientId").value ;
....
myText=document.getElementById(clientId).value

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

<ki*************@consultant.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi Eliyahu,
The text box is an asp.net text on a user control

Eliyahu Goldin wrote:
>Where is the textbox? Grid/DataList/Repeater? User control? Content page?

Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

<ki*************@consultant.comwrote in message
news:11**********************@b28g2000cwb.googleg roups.com...
Im having a bit of a problem here, what I want to do is a user types
in data in a text box then I need to pass that data to the client side.
The problem Im having is I can't seem to get the value from the text
box be it a regular asp.net text box or even when I assign a value in a
hidden textbox I still can't seem to get the value. I thought using:
document.getElementbyID("Client_ID").innerText would get the value but
its not.
Any help will be greatly appreciated.
Thanks

Jul 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
10
by: vbMark | last post by:
Hello, I am doing this: window.location="page2.php?subj="+subj+"&body="+body; to send information to another page. However, I don't want that second page to show up or display in any way....
7
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException...
2
by: Yama | last post by:
Hi, Simple question: Is there a way to a value from client-side to server-side upon a click? function _getReport(ReportName) { alert(ReportName); } <asp:datalist id="dlReports"...
8
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
7
by: Cemal Karademir | last post by:
Hello, Please forgive my simple question, but i don't know the correct synatx. From the masterpage i want to put a text in an textbox and then select an item in the datagrid. I do know how to...
5
by: Paul | last post by:
Just wondering if someone could provide an example of passing a variable from the code behind to javascript in vb. I want to have one control have focus with the page loading with one condition...
6
by: Jerry Camel | last post by:
Basic Web Form... A few text boxes and a checkbox - and a card reader... The effect I want to accomplish is this: The basic credit card fields are there and can be filled out. But if the user...
3
by: Andy | last post by:
Hi, Have just found a bug in Netscape for some of my Javascript code - works ok in Internet Explorer. Given the following form element: <input type="text" compulsory = "yes" name="an_el"> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.