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

Master/Content Pages and ClientIDs

0 Answers 40 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Marcial
Top achievements
Rank 1
Marcial asked on 29 Dec 2010, 07:24 PM
I am running into an issue picking up control clientIDs when it comes to master/content pages.  For example, using $find("<%= controlName.ClientID %>") in a single page would allow me to access the controls id.  However, if I place the same code in a content page, I get a 'null' error.  It cannot find the control.  Below is the content page I am attempting to access a controls ID.  Any help would be appreciated.
<%@ Page Title="" Language="C#" MasterPageFile="~/MES.master" AutoEventWireup="true" CodeBehind="timesheet.aspx.cs" Inherits="ESPS.Timesheet.timesheet" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <asp:ScriptManagerProxy runat="server"></asp:ScriptManagerProxy>
     
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        var btn = $find("<%# rBtnTest.ClientID %>");
        alert(btn);
    </script>
    </telerik:RadCodeBlock>
        
    <div style="background-color: Blue;">
    
        <telerik:RadButton runat="server" ID="rBtnTest" Text="Test" />
         
    </div>
   
</asp:Content>


Disregard this post, I have figured the out the problem. 


No answers yet. Maybe you can help?

Tags
Ajax
Asked by
Marcial
Top achievements
Rank 1
Share this question
or