Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my jquery method is below
JavaScript
 $("[src*=plus]").live("click", function () {
    $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>")
    $(this).attr("src", "../images/minus.png");
    debugger;
    var id = $(this).attr('id')
    $("input[id=hdnfldVariable]").val(id)
});
$("[src*=minus]").live("click", function () {
    $(this).attr("src", "../images/plus.png");
    $(this).closest("tr").next().remove();
});
and I want to call my below method on above jquery method
C#
protected void gvchild_RowDataBound(object sender, GridViewRowEventArgs e)
{
}
Gridview is define below
<asp:templatefield>
    <itemtemplate>
        <asp:panel id="pnlOrders" runat="server" style="display: none">
            <asp:gridview id="gvchild" onrowdatabound="gvchild_RowDataBound" onrowcommand="gvchild_RowCommand" runat="server" autogeneratecolumns="false" cssclass="ChildGrid">
                <columns>
                    <asp:boundfield itemstyle-width="150px" datafield="Front" headertext="Front">
                    <asp:boundfield itemstyle-width="150px" datafield="Roll" headertext="Roll">
                    <asp:boundfield itemstyle-width="150px" datafield="Orderno" headertext="Orderno">


What I have tried:

I don't have idea about this, how we call rowbound method in jquery

please help me I am very much thank full for all of you
Posted
Updated 17-Jan-21 23:17pm
v2
Comments
F-ES Sitecore 17-Jan-21 9:43am    
You can't call server-methods from javascript, the only calls you can make to your server code are ajax calls to web service type methods. You'll need to either come up with a way of doing what that bound event does in pure jQuery, or implement a web method your jQuery can call that returns data you then manipulate. The best solution really just depends on exactly you want to happen.
Member 10194266 17-Jan-21 10:02am    
Thanks
bbirajdar 27-Jan-21 10:06am    
https://www.c-sharpcorner.com/UploadFile/abhikumarvatsa/calling-an-Asp-Net-C-Sharp-method-web-method-using-javascript/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900