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

accessing hidden control from the telerik Rad Splitter

2 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sindu
Top achievements
Rank 1
Sindu asked on 21 Dec 2011, 06:21 AM
Hi ,

I have a hidden control inside telerik rad splitter .how can i access this control using javascript.

My code is given below...

 

 

<telerik:RadSplitter ID="clientAreaSplitter" runat="server" Height="100%" Width="100%" EnableViewState="true" VisibleDuringInit="true">

 

<

 

 

asp:HiddenField ID="HiddenField1" runat="server" />

 

 

 

</telerik:RadSplitter>

 javascript code

 

 

 

var splitter = $find("clientAreaSplitter");

 

var obj = splitter .FindControl("HiddenField1");

alert(document.getElementById('HiddenField1'))

this is not working ..

pls help me ..

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Dec 2011, 10:15 AM
Hello,

You can add HiddenField as shown below and then access the HiddenField.
ASPX:
<telerik:RadSplitter ID="clientAreaSplitter" runat="server" Height="100%" Width="100%" EnableViewState="true" VisibleDuringInit="true" OnClientLoaded="OnClientLoaded">
 <telerik:RadPane ID="pane1" runat="server">
    <asp:HiddenField ID="HiddenField1" runat="server" Value="aa" />
 </telerik:RadPane>
</telerik:RadSplitter>

JS:
<script type="text/javascript">
 function OnClientLoaded(sender, args)
    {
      var hdn1 = document.getElementById("HiddenField1");
    }
</script>

 Thanks,
Princy.
0
Dobromir
Telerik team
answered on 21 Dec 2011, 05:58 PM
Hi Sindu,

RadSplitter cannot have as direct children controls different than RadPane or RadSplitBar, and if any different control is added in the markup it will not be rendered on the page at all. That is why the you cannot access the hidden field in the JavaScript.

Also, I would like to point out that RadSplitter with a single RadPane (the example provided by Princy) is unsupported scenario and while the controls will be rendered correctly you may experience unexpected behaviors and some of the functionality of the splitter may not work correctly.

Greetings,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
General Discussions
Asked by
Sindu
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Dobromir
Telerik team
Share this question
or