Getting JS Error (for - event.srcElement.id) in WebForm
<p>I am building a dynamic user control (ascx) which contains a placeholder. Inside the placeholder, there will be n tables. Inside each table, in one of the cells i have the link button as below.</p>

<p>HyperLink lnkButton = new HyperLink(); 
lnkButton.ID = "lnkButton_" + ID.ToString(); 
lnkButton.Text = tstText; 
lnkButton.NavigateUrl = "javascript:JS_Click();"; </p>

<p>I have to call a JS function on the link button click (no postback). </p>

<p>In the JS function, i have to get the id of the control that invoked that JS function. In this case, it will be link button. I am writing the below code in the JS Function:</p>

<p>var ctrl = event.srcElement.id;</p>

<p>but i am getting 'Object Required' error in javaScript. </p>

<p>Few other things: This user control will be loaded in default.aspx page and the JS Function i am writing in default.aspx.</p>

<p>I am not sure why this is not working. I am using IE6/7, VS 2005. Is there any other function or way available to get the srcElement.id. Please help.</p>
