Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have implemented on scroll loading in my .aspx page with the use of jquery and javascript.

it works fine

bt i have facing a problem that link buttons command argument is not working there

i have searching a lot for this and i come know that jquery changes is reflected only at client side not server side.

so how can i reflect these changes at server side.
please give me any suggestion.

thanks in advance
Posted
Updated 5-Apr-15 23:30pm
v5

1 solution

kindly put a hidden field in your page and fill the value on linkbutton clicked and check this at server side as you want.

XML
<asp:TemplateField ItemStyle-CssClass="font_grid">
                                       <ItemTemplate>
                                           <asp:Button ID="btnEdit" runat="server" CommandArgument='<%#Eval("coRefnr") %>' CommandName="Edit" OnCommand="btnEdit_Command"  CssClass='<%#Container.DataItemIndex==0?"displayblock":"displaynone" %>' Text="Edit" />
                                       </ItemTemplate>
                                   </asp:TemplateField>


after getting on server side ,remove the hiddenfield value.
 
Share this answer
 
Comments
Kriti Sharma 10400841 6-Apr-15 5:46am    
but how can i do this please explain little bit
upendra shahi 6-Apr-15 6:00am    
hello Kriti!

Page 1-

<asp:TemplateField ItemStyle-CssClass="font_grid">
<itemtemplate>
<asp:Button ID="btnEdit" runat="server" CommandArgument='<%#Eval("coRefnr") %>' CommandName="Edit" OnCommand="btnEdit_Command" CssClass='<%#Container.DataItemIndex==0?"displayblock":"displaynone" %>' Text="Edit" />


code behind--

protected void btnEdit_Command(object sender, CommandEventArgs e)
{


Session["edittask"] = e.CommandArgument.ToString();

Response.Redirect("WebTT.aspx");

}


Page2-

<asp:HiddenField ID="hdnEdit" runat="server" ClientIDMode="Static" />

code behind-

if (Session["edittask"] != null)
{
hdnEdit.Value = Session["edittask"].ToString().Trim();
Session.Remove("edittask");
string retask = hdnEdit.Value;
//hdnEdit.Value = "";
EditTask(usrname, retask);//use ur own method
}



use this type of concept for your work. I hope this will work for you.
If not kindly give your sample on upshahi12@gmail.com

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