title: c# ajax updatepanel only firing clientside event in .net masterpages
body: <p>I get this error when I click on the href link:  Microsoft JScript runtime error: The value of the property 'walkRedCarpet' is null or undefined, not a Function object.</p>
  
  <p>To me, this means it is not firing the OnClientClick event and treating the OnClick like a clientside event.. am I wrong?  </p>
  
  <p>The link (a href) is programmatically generated from the codebehind PageLoad event and is the contents of a placeholder.</p>
  
  <p>CODE</p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MyFile.aspx.cs" Inherits="MyProject.MyFile" %&gt;
  
  &lt;script runat="server"&gt;
      protected void walkRedCarpet(int eventID)
       {
  
       }
  &lt;/script&gt;
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
  &lt;script type="text/javascript"&gt;
      function Call() {
           return Page_ClientValidate();
      }
  &lt;/script&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
      &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt;
      &lt;asp:UpdatePanel ID="updtPnlRedCarpet" runat="server"&gt;
      &lt;asp:PlaceHolder ID="PlaceHolder2" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>PLACEHOLDER CONTENTS CODEBEHIND</p>
  
  <pre><code>&lt;a href='#' OnClick='walkRedCarpet(" + eventID + ");' OnClientClick='return Call()' runat='server' id='linkEventShowImageSet'&gt;&lt;img Width='125' Height='95'src='Images/" + strEventThumb.ToString() + "' border='0'&gt;&lt;/a&gt;
  </code></pre>
  
  <p>PLACEHOLDER CONTENTS POSTCOMPILE</p>
  
  <pre><code>&lt;a href='#' OnClick='walkRedCarpet(1);' OnClientClick='return Call()' runat='server' id='linkEventShowImageSet'&gt;&lt;img Width='125' Height='95'src='Images/event-1-ready.jpg' border='0'&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I am very new to AJAX. I have scoured the webbernet and looked at countless examples until my brain is very soft and mushy. Please be gentle.</p>