I have a c# method which stores data to sql server. This function is called from an Onlick and i pass the parametres using CommandArgument. Like this.
<asp:LinkButton runat="server" onClick="save" CommandArgument='<%# Eval("post_id").ToString() + "," + Eval("user_id").ToString()%>'></asp:LinkButton>
This is the c# method
protected void vote(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
string arguments = lb.CommandArgument;
string[] args = arguments.Split(',');
string post = args[0];
string user = args[1];
.............
}
All i want to do is to call the c# method using ajax because i dont want the page to be refreshed, but i cant call that function passing CommandArgument. I want to use CommandArgument because i dont want the c# method to have other parametres than object sender and EventArgs e