I have created a unique asp.net custom control that utilizes a text box, which is used in various sections of a form. How can I retrieve the value entered into the text box from different instances of this custom control?
Although I am using the syntax below, it does not seem to be functioning properly.
The property added to the custom control class is as follows -
public TextBox ObjTextBox
{
get { return objTextBox; }
}
The code provided below is what I am currently using to obtain the value from the custom control.
<script type="text/javascript">
function met1() {
var objTextBox = document.getElementById('<%=MyTextBox1.ObjTextBox.ClientID %>');
alert(objTextBox.value);
}
</script>