Hello,
Thank you for the report. Please use the following fix for now.
Fix
<script>
Ext.form.field.Hidden.override({
afterRender : function () {
this.inputEl = this.el;
this.labelEl = this.el;
this.bodyEl = this.el;
this.errorEl = this.el;
this.inputRow = this.el;
if (Ext.isDefined(this.value)) { // if (this.value) {
this.originalValue = this.lastValue = this.value;
this.el.dom.value = this.value;
}
this.callParent();
}
});
</script>
Here is a full test case.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Hidden1.Value = 0;
}
}
protected void GetHiddenValue(object sender, DirectEventArgs e)
{
X.Msg.Alert("Hidden.Value", this.Hidden1.Value).Show();
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
<script>
Ext.form.field.Hidden.override({
afterRender : function () {
this.inputEl = this.el;
this.labelEl = this.el;
this.bodyEl = this.el;
this.errorEl = this.el;
this.inputRow = this.el;
if (Ext.isDefined(this.value)) { // if (this.value) {
this.originalValue = this.lastValue = this.value;
this.el.dom.value = this.value;
}
this.callParent();
}
});
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Hidden ID="Hidden1" runat="server" />
<ext:Button runat="server" Text="Test" OnDirectClick="GetHiddenValue" />
</form>
</body>
</html>