How to call server side method button click event from the client side script :
Script :
<%= Page.ClientScript.GetPostBackEventReference(btnClose, String.Empty) %>;
Note :
Place this code in the script to call the any sever-side method, from above btnclose is the click method of the button. and event is empty.
Calling Script method from server side method.
System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), “Script”, “ConfirmationAlert();”, true);
Note :
ConfirmationAlert()ย method :
ย function ConfirmationAlert() {
var copiedText = “”;
var answer = confirm(“Click ‘OK’, to give alert!”)
if (answer) {
alert(“You Click OK”);}}
This is very attention-grabbing, You are a very skilled blogger.
I’ve joined your feed and sit up for in the hunt for more of your great post. Additionally, I’ve shared
your site in my social networks