This is my function JavaScript
:
function prueba() {
var a = 1;
var b = 2;
var total = a + b;
('#TextBox1').val(total);
}
This is the .aspx
:
<div>
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
</div>
And this aspx.cs
:
namespace widget
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this.UpdatePanel1, GetType(), "mifuncion", "prueba()", true);
}
}
}
And I want to assign the value of "total" in the Textbox .