Call a server side code from Jquery.
I will brief about how to call a server side code from Jquery. How we can achieve this in the Jquery/javascript code.If you are working on context menu if we want to handle the Menu items click on server side code with how to achieve this i will explain with code snippets and real time Images.
In some occasions or in some scenarios we need to call a server side event from the Client Script Using J query or JavaScript.
Scenario to Call a server side Code or Server side Event :
For example when we are working with Controls like Context Menu based on the Menu items click we need to perform an action event i.e Button_click based on that we need to populate the data to Controls.
The below is the snapshot(image) to get exact idea....
On click of Menu items we need to call server side code or server side event
Call from Jquery :
function contextMenuWork(action, el, pos)
{
switch (action)
{
case "ctivate":
{
$("#HiddenFieldRowId").val("1");
$("#ButtonHiddenAddCustomer").click();
break;
}
case "eActivate":
{
$("#HiddenFieldRowId").val("0");
$("#ButtonHiddenAddCustomer").click();
}
}
}
asp:Button ID="ButtonHiddenAddCustomer" runat="server" CssClass="addCustomer"
style="display:none" OnClick="ButtonHiddenAddCustomer_Click" '