This is a migrated thread and some comments may be shown as answers.

Why has radtextbox no text and asp textbox has some?

1 Answer 79 Views
Input
This is a migrated thread and some comments may be shown as answers.
adi
Top achievements
Rank 1
adi asked on 02 Jul 2009, 02:27 PM
Hi,

I have a issue with the radtextbox control. I have some placed inside an usercontrol. On my parent page, I have a button which when clicked call a method in my usercontrol that reads the text properties of the input controls. The property is empty if I use the radtextbox. If I switch to the asp.net version I can use the property values. What I haven't understood?

Thnx,
Adi

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Jul 2009, 05:16 AM
Hi Adi,

I tried to implement a similar scenario on my end and I was able to get the value of the RadTextBox as shown below.

ASPX:
 
 <uc1:WebUserControl ID="WebUserControl1" runat="server" /> 
         
        <input id="Button3" type="button" value="GetText"  onclick="GetText();" /> 


JS:
 
<script type="text/javascript" > 
 
function GetText() 
{  
  var txtbx=document.getElementById("WebUserControl1_RadTextBox1_text"); 
  alert(txtbx.value); 
 
 
</script> 

ASCX:
 
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<telerik:RadTextBox ID="RadTextBox1" runat="server"  Text="Hello"
</telerik:RadTextBox> 


Thanks
Shinu.

Tags
Input
Asked by
adi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or