Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to pass alert value of javascript function which is define in master page to its codebehind file?

quick answer!!
Posted
Comments
Praveen Kumar Upadhyay 13-Mar-15 3:55am    
You can store the value into a Hidden field and that can be accessed from code behind.
Santosh K. Tripathi 13-Mar-15 4:01am    
+5
VICK 13-Mar-15 6:04am    
or do have a look at http://weblogs.asp.net/yonggangmeng/how-to-invoke-pagemethods-in-masterpage

1 solution

Create a web method in your Master.cs file using
C#
[System.Web.Services.WebMethod]
attribute.

Then pass the returned value from desired Javascript function to newly created web method using AJAX call.

OR

Go through this article to do the same using Page method and script Manager.
 
Share this answer
 

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