Textfield value is not updated

  1. #1

    Textfield value is not updated

    Hi,

    I am getting the value from SQL Db to the textfield...

      
                 <ext:ComboBox ID="drpSecQues" runat="server" FieldLabel="Secret Question" Editable = "false" Width = "175" Cls="AlignLeft"     AutoPostBack = "false"  >
                                  <Items>
                                    <ext:ListItem Text="Select" />
                                    <ext:ListItem Text="What is your pet name" />
                                    <ext:ListItem Text="What is your favourite Place" />
                                    <ext:ListItem Text="What is your favourite Game" />
                                    <ext:ListItem Text="What is your favourite Food" />
                                    <ext:ListItem Text="What is your favourite Colour" />
                                </Items>
                              <Listeners>
                               <Select Handler = "loadvalue();" />
                              </Listeners>
                            </ext:ComboBox>
                            <ext:TextField ID="txtSecAns"  runat="server" FieldLabel="Secret Answer" EmptyText="Enter the Secret Answer" 
                                AllowBlank="false" BlankText="Your Secret Answer is required." Width = "175" Cls="AlignLeft" />
    Once i updated the textfield and When i am calling the save button in server side , it shows the old value:
    Example : china....i updated to japan..in page_load it gets an updated value(japan)...but it gets the value as china in btnSave_Click method.....

      
                  <buttons>
                            <ext:Button ID="btnSave" runat="server" Icon="Disk" Text="Submit" >
                            <DirectEvents>
                               <Click OnEvent = "btnSave_Click" />
                            </DirectEvents>
                          </ext:Button>

      
                   Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As DirectEventArgs) Handles btnSave.Click
    		If txtSecAns.Text = "" Then
                      ScriptManager.RegisterStartupScript(Me, Me.GetType(), "3IMS", "alert('Enter the Secret Answer');", True)
                    End If
    	       End Sub
  2. #2
    Please post a simplified .aspx sample demonstrating the whole scenario.

    http://forums.ext.net/showthread.php...ing-New-Topics

    http://forums.ext.net/showthread.php...ation-Required
    Geoffrey McGill
    Founder
  3. #3
    Hi,

    Thanks for ur reply...

    Here is the code :

      
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Sample.aspx.vb" Inherits="Sample" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!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></title>
        <style type="text/css">
            .AlignLeft
            {
               text-align:left ;
            }
     </style>
    </head>
    <body>
    <script runat = "server">
            protected Sub Store_RefreshData(ByVal sender As Object, ByVal e As StoreRefreshDataEventArgs)
                Dim store As Store = TryCast(sender, Store)
    	        store.DataBind()
    	        
            End Sub
         </script>
           
         
        <style type="text/css">
            .AlignLeft
            {
               text-align:left ;
            }
        </style>
    </script>
         <form id="form1" runat="server">
        <div id = "div1" style="width: 100%; height: 485px;" onkeypress = "javascript:return keycheck(event);" >
        <asp:ScriptManager runat = "server" />
     <ext:ResourceManager ID="ResourceManager1" runat="server" />
           <asp:SqlDataSource ID = "SqlDataSource1" runat = "server" connectionString="<%$ appSettings:constring%>"  SelectCommand = "Select distinct (name) + ' - ' + (code) as name from M_supplier where (status) = 'A'"  >
            
           </asp:SqlDataSource>
          <ext:Store ID="Store1" runat="server" IDMode = "Static" DataSourceID = "SqlDataSource1" OnRefreshData = "Store_RefreshData"   >
                                      <Reader>
                                         <ext:JsonReader IDProperty="id" >
                                          <Fields>
                                            <ext:RecordField Name="name" Type="String" />
                                         </Fields>
                                         </ext:JsonReader>
                                        </Reader>
                                        
            </ext:Store>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            
               <ContentTemplate>
    		 <ext:FormPanel ID="FormPanel1" runat="server" ButtonAlign="Center"  Height="290" 
                        Padding="5" Title="Supplier Profile" Width="475"  Frame = "true" > 
                        <Items>  
                            <ext:ComboBox ID="drpSupplier" runat="server" FieldLabel="Supplier Name" Editable = "false" DisplayField = "name"
                                Width = "350" Cls="AlignLeft" ForceSelection="true" SelectOnFocus="true" ValueField = "name" StoreID = "Store1"  >
                              <Listeners>
                               <Select Handler = "#{Store1}.reload();" />
                              </Listeners>
                             </ext:ComboBox>
     			<ext:TextField ID="txtUserName"  runat="server" FieldLabel="User Name" EmptyText="Enter the User Name" 
                                BlankText="Your username is required." Width = "175" Cls="AlignLeft" />
                           
                            <ext:TextField ID="txtPassword"  runat="server" FieldLabel="Password" EmptyText="Enter the Password" Width = "175" Cls="AlignLeft"
                                 InputType = "Password" AllowBlank="false"  BlankText="Your password is required." MinLength = "7" MaxLength = "15"   />
                            <ext:TextField ID="txtCfmPassword"  runat="server" FieldLabel="Confirm Password" EmptyText="Enter the Password" Width = "175"
                                 InputType = "Password" AllowBlank="false"  BlankText="Your password is required." MinLength = "7" MaxLength = "15" Cls="AlignLeft">
                                 <CustomConfig><ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Value"></ext:ConfigItem> </CustomConfig>
                            </ext:TextField>
                            <ext:DateField ID="txtDOB" runat="server"  FieldLabel="Date of Birth" Format = "dd-MM-yyyy" Editable = "false" Width = "175" Cls="AlignLeft"  MaxDate = "<%# DateTime.Today %>"  />
                            <ext:ComboBox ID="drpGroup" runat="server" FieldLabel="User Group" Editable = "false" Width = "175" Cls="AlignLeft" AutoPostBack = "false"  >
                               <Items>
                                    <ext:ListItem Text="Select" />
                                    <ext:ListItem Text="Administrators" />
                                      <ext:ListItem Text="Power Users" />
                                    <ext:ListItem Text="Users" />
                                </Items>
                            </ext:ComboBox>
                            <ext:ComboBox ID="drpSecQues" runat="server" FieldLabel="Secret Question" Editable = "false" Width = "175" Cls="AlignLeft"  AutoPostBack = "false"  >
                                  <Items>
                                    <ext:ListItem Text="Select" />
                                    <ext:ListItem Text="What is your pet name" />
                                    <ext:ListItem Text="What is your favourite Place" />
                                    <ext:ListItem Text="What is your favourite Game" />
                                    <ext:ListItem Text="What is your favourite Food" />
                                    <ext:ListItem Text="What is your favourite Colour" />
                                </Items>
                            </ext:ComboBox>
                            <ext:TextField ID="txtSecAns"  runat="server" FieldLabel="Secret Answer" EmptyText="Enter the Secret Answer" 
                                AllowBlank="false" BlankText="Your Secret Answer is required." Width = "175" Cls="AlignLeft" />
                            
                         </Items>
                         <buttons>
                            <ext:Button ID="btnSave" runat="server" Icon="Disk" Text="Submit" >
                            <DirectEvents>
                               <Click OnEvent = "btnSave_Click" />
                            </DirectEvents>
                          </ext:Button>
                </buttons>
         </ext:FormPanel>
    </ContentTemplate>
      </asp:UpdatePanel>
      
       </div>
    </form>
    </body>
    </html>

    In server Side:

     
       Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As DirectEventArgs) Handles btnSave.Click
                If txtDOB.Text = "" Then
                    ScriptManager.RegisterStartupScript(Me, Me.GetType(), "3IMS", "alert('Select a DOB');", True)
                    txtDOB.Focus()
                ElseIf drpGroup.Text = "Select" Then
                    ScriptManager.RegisterStartupScript(Me, Me.GetType(), "3IMS", "alert('Select a User Group');", True)
                    drpGroup.Focus()
                ElseIf drpSecQues.Text = "Select" Then
                    ScriptManager.RegisterStartupScript(Me, Me.GetType(), "3IMS", "alert('Select a Secret Question');", True)
                    drpSecQues.Focus()
                ElseIf txtSecAns.Text = "" Then
                    ScriptManager.RegisterStartupScript(Me, Me.GetType(), "3IMS", "alert('Enter the Secret Answer');", True)
                    txtSecAns.Focus()
    	    else
    		'Save Query here
    	    End If
       End Sub

    Once i updated the values in textfield, i call save method....it gets only the old values.....
    Last edited by Anburaja; Oct 15, 2012 at 4:31 AM.
  4. #4
    Hi,

    When I run your sample I get the following Exception,

    The file '/EIMS.master' does not exist.
    Geoffrey McGill
    Founder
  5. #5
    Hi,

    I updated the above code ( now - without the master page)

    Kindly check and clarify.....
    Last edited by Anburaja; Oct 15, 2012 at 6:28 AM.

Similar Threads

  1. Replies: 2
    Last Post: Oct 01, 2012, 8:16 AM
  2. Replies: 2
    Last Post: Jan 16, 2012, 10:34 AM
  3. [CLOSED] SVN Updated Lately?
    By alexkay in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 16, 2011, 4:47 PM
  4. Have the forums been updated??
    By r_honey in forum Open Discussions
    Replies: 9
    Last Post: Jun 14, 2010, 2:43 PM
  5. [CLOSED] [1.0] Updated via SVN
    By state in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 19, 2009, 5:42 PM

Posting Permissions