Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am developing a web application in VS 2003 (Version 1.1). Operating System in XP SP2.

In one of my web page i have textbox with readonly property true. Now on some event i am setting textbox value in javascript

E.g

document.getElementById("textboxID").value="12345";

In code behind(Server side), am getting the value 12345 (the textbox is readonly).

But when i host this application in Window Server 2003, am getting nothing in textbox.

Why?
Posted
Updated 9-May-11 6:06am
v2

1 solution

The most obvious thing to look at here is whether textboxID really is the ID of the textbox. When you host a control in ASP.NET, it performs some name mangling so that it doesn't conflict with another control hosted in other user controls on your page. To find out what the ID of the textbox is, view the source of your page and see what the ID is.

An important thing here is that this mangling only occurs at the client side, so the server side will see the textbox with the ID you gave it. There's another ID (the ClientID) that is the ID that is written to the output HTML.
 
Share this answer
 
Comments
Jagz W 12-May-11 22:24pm    
I have checked the source code. There is no another ID of same name

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900