I'm curious if there is possibility to change java script parameter from code behind if specific text location (TextBox19) have to be moved to TextBox20.
.aspx
function myFunction()
{
var progValue1 = <%=ProgValue1%>;
document.getElementById({ value: progValue1 }).value = "something";
};
<asp:Button ID="Button2" runat="server" Text="Button" OnClientClick="myFunction()" OnClick="Button2_Click" />
<asp:Button ID="Button1" runat="server" Text="Change text location" OnClientClick="SomeMethod" />
.aspx.cs
private string _progValue1 = "\"" + "<%=TextBox19.ClientID%>" + "\"";
protected string ProgValue1 { get { return this._progValue1; } }
private void SomeMethod(object sender, EventArgs e)
{
this._progValue1 = "\"" + "<%=TextBox20.ClientID%>" + "\"";
}
protected void Page_Load(object sender, EventArgs e)
{
//wywołanie skryptu js myFunction()
ClientScript.RegisterStartupScript(Page.GetType(), "OnLoad", "myFunction();", true);
}
There is possibiility to do it in this way?