Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2070
Value always null/blank in numeric editor
posted

I am trying to use the numeric editor control on a web form. It enters and shows data properly; however, during postback the control value is ALWAYS null or empty! The text is empty, and the values (such as Value, ValueInt, etc) are all NULL.

Again the value displays on the control fine, but I can't seem to get the value back from the server side. What is going on or what am I doing wrong?

/Tom

Parents
  • 24497
    posted

    Hi Tom,

    I do not remember anybody reported a similar problem.

    Please test codes below and verify that it works correctly. If it works, but your application fails, then I can suggest to check in your application following potential reasons:
    1. If editor (or its container) is created dynamically at run time, then it should be repeated in every single session/postback and ID of editor/containers should be the same.
    2. If editor value/text/etc. is initialized/modified dynamically on load or other server events.
    3. If ValueChanged event is processed and value is modified.

    aspx:

    <ig:WebNumericEditor ID="WebNumericEditor1" runat="server"></ig:WebNumericEditor>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <asp:Button ID="Button1" runat="server" Text="Button" />

    aspx.cs:

    protected void Page_Load(object sender, EventArgs e)
    {
      this.Label1.Text = "Value:" + this.WebNumericEditor1.Value + ", int:" + this.WebNumericEditor1.ValueInt;
    }

Reply Children