Focus to a div after Button Click using JavaScript in ASP.Net

Last Reply on Apr 19, 2017 11:48 PM By amitsinghr

Posted on Apr 19, 2017 10:43 PM

dear all in my below code there is buttton inside repeater i want after button click (page post back) direct jump to div which have id = stu

aspx design
 <div id="student" class="panel panel-default">

//some design

</div>

//some html design

<asp:Repeater ID="rptStudentDetails" runat="server">
        <ItemTemplate>
              <tr>
                  <td>
                       <a href="#student"><asp:Button ID="btnClick"  runat="server" Text="Edit"  OnClick="btnClick_Click"  
                         CssClass="btn btn-info btnClick" CommandArgument='<%#Eval("SRNo") %> ' /></a>
                  </td>
               </tr>
        </itemTempale>
</asp:Repeater>
You are viewing reply posted by: amitsinghr on Apr 19, 2017 11:48 PM.
Posted on Apr 19, 2017 11:48 PM

i got another logic

just add PostBackUrl="#ID" to my button

ex

<asp:Button ID="btnClick" PostBackUrl="#student" runat="server" Text="Edit" OnClick="btnClick_Click"
CssClass="btn btn-info btnClick" CommandArgument='<%#Eval("SRNo") %> ' />