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

Last Reply 3 months ago By amitsinghr

Posted 3 months ago

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 3 months ago.
Posted 3 months ago

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") %> ' /> 
I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html