[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

get the value of a <input type="text" field in code behind

Posted on 2007-10-07
4
Medium Priority
?
1,641 Views
Last Modified: 2013-11-07
I have a simple

<input id="P0" type=text />

and a simple

<a href='javascript:markProp(1234)'>Click Here</a>

and the markProp function is

function marpProp(ListNum) {
    document.getElementById('P0').innerText = ListNum;
}

When the user presses the href = it changes the value of the inputfield with a dynamic value from a repeater control - and that works good - BUT ... i can't get that value in the codebehind.

I've tried Dim P0 As System.Web.UI.HtmlControls.HtmlInputText -

I just need to get the value of this field in the code behind.

Any ideas?

Thanks,

Gp.





0
Comment
Question by:timbersnow
  • 2
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
RedKelvin earned 2000 total points
ID: 20031384
try using
<input id="P0" type=text runat="Server" />

The runat="Server", should make it available in the codebehind, so then you should be able to access it directly using the "id"

eg
dim sTest as string = PO.Text
0
 

Author Comment

by:timbersnow
ID: 20031405
Never mind ... i figured it out.

In the page_load of the code behind, i put:

  P0.Attributes.Add("readonly", "readonly")

and wella ... it works.

Can i give mySELF points?  grin

Gp.
0
 

Author Comment

by:timbersnow
ID: 20031408
Hey Red ... i'll give you the points just cause you respoinded.

Easy ... eh?

BTW ... i had already tried that and it was no go ... i'm using the Telerik RAD:AJAXMANAGER which further complicates stuff.

Cheers,

Gp.
0
 
LVL 22

Expert Comment

by:RedKelvin
ID: 20031437
ah, good work, glad you got it sorted, and thanks for the points ;-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 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