How to move to code in codebehind from javascript
<p>I have a gridview .When i click on one row in it i have to go to javascript which is like this.</p>

<pre><code>        &lt;script type="text/javascript" language="javascript"&gt;
            function GetDetails(rowNo)
            {
                document.getElementById('hidRowNo').value = rowNo
                document.getElementById('btnDet').click();
            }
        &lt;/script&gt;
</code></pre>

<p>I have written following code in codebehind </p>

<pre><code>    protected void btnDet_Click(object sender, EventArgs e)
    {
        if (hidRowNo.Value != "")
        {
            int rowNo = Convert.ToInt32(hidRowNo.Value);
            TextBox1.Text = GridView1.Rows[rowNo].Cells[0].Text;
            TextBox2.Text = GridView1.Rows[rowNo].Cells[1].Text;
            TextBox3.Text = GridView1.Rows[rowNo].Cells[2].Text;
        }
    }



    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onclick", "GetDetails(" + e.Row.RowIndex + ");");
        }
    }
</code></pre>

<p>The problem is javascript is working but document.getElementById('btnDet').click(); is not working.While debugging also,control is not moving to btnDet_Click.what change i have to include to move control to btnDel_Click in code behind.</p>

<p>can anybody help?</p>
