Click here to Skip to main content
15,880,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
As am cloning one of my dock on client side.

ASPX code:

ASP.NET
<telerik:RadDock ID="RadDock1"  runat="server"  DockHandle="Grip"
                               Width="170px" DockMode="Docked" ForbiddenZones="RadDockZone3,RadDockZone4"
                               onclientdragend="RadDock1_DragEnd"  önClientDragStart="RadDock1_DragStart">
                               <ContentTemplate>
                                   <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                               </ContentTemplate>
                           </telerik:RadDock>


How can I find the clientId of that dynamically added textbox inside raddock?

For more brief on to the code please refer : How can I restrict dynamically created raddock with dockmode float[^]
Posted
Comments
Sergey Alexandrovich Kryukov 8-Aug-14 4:55am    
Where is ClientId in your code?
—SA
praveen iThesisArt 8-Aug-14 5:36am    
pls refer to my previous question : http://www.codeproject.com/Questions/805430/How-can-I-restrict-dynamically-created-raddock-wit

I've cloned raddock as they are dynamically generated at client side , how can i find the clientID associated with it particular to the textbox?
praveen iThesisArt 8-Aug-14 5:40am    
cause i want to bind clientside function to it .

code to be binded :

function RadDock1_ResizeEnd(sender, args) {
var a = sender.get_width();
var b = sender.get_height();

// ??? -> should be replaced with the dynamically created textbox clientId

document.getElementById('???').style.height = b + 'px';
document.getElementById('???').style.width = a + 'px';
}
</script>

1 solution

It all comes from the main principle: in HTML (generated from your ASP.NET page), ID or ClientID is translated into the HTML attribute "id", and the values of all such attribute in the context of the whole page should be unique.

To see how the values are set or generated please read this:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.ui.clientidmode%28v=vs.110%29.aspx[^],
http://highoncoding.com/Articles/703_Understanding_ClientIDMode_Mode_Feature_in_ASP_net_4_0.aspx[^].

See also:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.web.ui.control.id%28v=vs.110%29.aspx[^].

I'm almost sure your problem is related to the above considerations. If not, please clarify.

—SA
 
Share this answer
 

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



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