Hi,
We can not access changes by javascript in server side.
upto my knowledge you've to follow another way for doing this.like posting changed data to server by jquery.
here 'm providing some example to maintain javascript values on postback using jquery .
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script language="javascript" >
function setval() {
$("#Label1").text("hi this is testing");
$.post("default3.aspx?action=change", {txt:"hi this is testing"}, function (data) { });
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type ="button" value ="set Value" id="bthsetval" onclick="setval()" />
<asp:Label ID="Label1" runat="server" Text="Label"><br />
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</div>
</form>
</body>
</html>
And we've to maintain one session variable for label text value
we've to write some code in code behind file to set session variable to label text
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["action"] != null)
{
Session["lbltext"] = Request.Form["txt"].ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Session["lbltext"].ToString() != "")
{
Label1.Text = Session["lbltext"].ToString();
}
}
By this way we can maintain javascript changes in server side.
All the best