[CLOSED] How get originally Value in the fields

  1. #1

    [CLOSED] How get originally Value in the fields

    Example:
    I have CheckBox with default Checked is true;
    I can Reset to default value (CheckBox.Reset();)
    How get default value in C#? Example: bool myDefault = this.CheckBox.DefaultChecked;

    Thanks.
    Last edited by Daniil; Jul 14, 2011 at 10:44 AM. Reason: [CLOSED]
  2. #2
    Hi,

    There is no such server side property.

    I can suggest you to pass it to server as an extra parameter.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Reset(object sender, DirectEventArgs e)
        {
            this.Checkbox1.Reset();
            X.Msg.Alert("DirectEvent", "The initial value is " + e.ExtraParams["initialValue"]).Show();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Checkbox ID="Checkbox1" runat="server" Checked="true" />
            <ext:Button runat="server" Text="Reset">
                <DirectEvents>
                    <Click OnEvent="Reset">
                        <ExtraParams>
                            <ext:Parameter 
                                Name="initialValue" 
                                Value="Checkbox1.originalValue" 
                                Mode="Raw" />
                        </ExtraParams>
                    </Click>
                </DirectEvents>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #3
    bool DefaultValue = (CheckBox.IsDefault ? CheckBox.Checked : !CheckBox.Checked);
    It can be possible to apply the such?
  4. #4
    .IsDefault is not a default value.

    The single way is sending an initial value via ExtraParams as I demonstrated.
  5. #5
    ok. thanks..

Similar Threads

  1. [CLOSED] Focus Fields
    By majunior in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 08, 2011, 2:11 PM
  2. [CLOSED] Layout for fields
    By ppettigrew in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 13, 2010, 2:23 PM
  3. [CLOSED] [1.0] Get all mandatory fields always in red
    By juane66 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 27, 2010, 2:14 PM
  4. [CLOSED] [1.0] Required Fields
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 15, 2010, 10:57 PM
  5. [CLOSED] Date fields with asp:ScripManager
    By Pablo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 07, 2009, 1:04 PM

Tags for this Thread

Posting Permissions