.cs side
//Declaring protected type string variable
protected string myMessageFromCodeBehind;
protected void Page_Load(object sender, EventArgs e)
{
//Assigning Value to variable
myMessageFromCodeBehind = "Happy coding, keep coding";
}
I have declared a protected type string variable myMessageFromCodeBehind in asp.net code behind, assign a value to that variable and get it on my .aspx page using javascript given below
var myMessage = "<%=myMessageFromCodeBehind %>";
alert(myMessage);
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment