Hi indradeo,
Check this example. Now please take its reference and correct your code.
HTML
<asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>
<input type="hidden" id="hfAmount" runat="server" />
<asp:Button ID="btnSet" runat="server" OnClick="OnSet" Text="Set" />
<asp:Button ID="btnGet" runat="server" OnClick="OnGet" Text="Get" />
Code
C#
protected void OnSet(object sender, EventArgs e)
{
hfAmount.Value = txtAmount.Text.Trim();
}
protected void OnGet(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('" + hfAmount.Value + "')", true);
}
VB.Net
Protected Sub OnSet(ByVal sender As Object, ByVal e As EventArgs)
hfAmount.Value = txtAmount.Text.Trim()
End Sub
Protected Sub OnGet(ByVal sender As Object, ByVal e As EventArgs)
ClientScript.RegisterClientScriptBlock(Me.GetType(), "", "alert('" & hfAmount.Value & "')", True)
End Sub
Screenshot