hi all
Problem is I have hidden variable and stored a value to hidden variable through javascript
while retrieving hidden varaible from code behind it is retrieved as empty value
javascript code is
function CalculateTotalAmountWithLoadingCharge() {
var loadingValue = parseFloat(document.getElementById('<%= txtLoadingcharge.ClientID %>').value)
if (loadingValue >= 0) {
document.getElementById('<%= hdnLoadingCharge.ClientID %>').value = loadingValue
document.getElementById('<%= hdnLoadingChargeTemp.ClientID %>').value = "valuechanged";
}
<asp:UpdatePanel ID="upHiddenField" runat="server" >
<ContentTemplate>
<asp:HiddenField ID="hdnQuantity" runat="server" />
<asp:HiddenField ID="hdnLoadingCharge" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="upFreightType" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:TextBox ID="txtQuantity" runat="server" CssClass="textBox" Text="1" onchange="onchangeQuantity();" Width="40px" />
<
<asp:TextBox ID="txtBasicAmount" runat="server" onchange="BasicAmountChange()" Text="0" CssClass="textBox" Width="160px" />
</div>
<%----%>
<asp:Label ID="lblLoadingCharge" runat="server" Text="Loading Charge:" CssClass="label" />
<asp:TextBox ID="txtLoadingcharge" runat="server" CssClass="textBox" Text="0" onchange="CalculateTotalAmountWithLoadingCharge()" Width="160px" />
</div>
<asp:Label ID="lblTotalAmount" runat="server" Text="Total Amount:" CssClass="label" />
<asp:TextBox ID="txtTotalAmount" runat="server" Text="0" CssClass="textBox" Width="160px" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlFreightType" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<asp:Button ID="btnSave" runat="server" Text="Book" CssClass="button" Width="160px" OnClientClick="CalculateTotalAmountWithLoadingCharge();" />
in code behind
Dim loadingcharge As Integer=hdnLoadingCharge.Value
I have update panel to get value to retrieve the value on dropdown selected index changed that works fine after retrieving the value i process and store it in hidden variable while trying
to access it in my code behind the value of hidden variable is empty string (i.e) "".
How can i retrieve the hidden variable value from code behind
Thanks in advance . what have i done wrong