[CLOSED] Post back issues

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Post back issues

    Hi,

    There are two problems here

    1) Page is not getting postback immediately after we change the date or change selection in drop down(ext controls)
    but its getting postback when we click mouse on any other control.

    Why is this happening?
    We want the post back event to be fired immediately after performing date change or drop down selection change

    2)When the post back is fired and page is loaded the drop down controls are losing its data and selected value is displayed as selected text and we are missing other list item in the drop downs and the selected date is also missing


  2. #2

    RE: [CLOSED] Post back issues

    Hi,

    1. To initiate postabck after selection you need define OnItemSelect event handler


    <ext:ComboBox runat="server" AutoPostBack="true" OnItemSelected="ItemSelected"/>


    protected void ItemSelected(object sender, EventArgs e){}


    2. I am sure that you don't rebind store after postback. If I am wrong then please post your source code

    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: [CLOSED] Post back issues

    Hi,

    It seems that the problem is not with the Post back but with the user controls

    We are having several user controls in the page, when ever there is a post back all the user controls are once again loading which is required, because of this the values in the Date control selected date value is missing.

    When we deleted all the user controls and tried we were able to get the selected date value in post back.

    Is there any different way to handle date controls when we have user controls in the page ?


  4. #4

    RE: [CLOSED] Post back issues

    Hi,

    May be you can create simple example which reproduces the problem. It can help us to understand the problem
    Vladimir Shcheglov
    Sr. Developer
  5. #5

    RE: [CLOSED] Post back issues

    Hi,
    Just i created one sample for this.In my application lot of tabs are there and each tab many usercontrols are there.

    In the below same only one tab in the tab with two rows,the firstrow contains two columns the column is the datefield ,the second column contains usercontrol.the second row contains only two buttons.

    The usercontrol contains only grid,I am filling the grid in the pageload event.

    See the desing

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <%@ Register Src="ProcessedBy.ascx" TagName="ProcessedBy" TagPrefix="uc1" %>
    <!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 id="Head1" runat="server">
        <title></title>
        <link rel="Stylesheet" type="text/css" href="css/Icons.css" />
        <link rel="Stylesheet" type="text/css" href="css/genral.css" />
    
        <script src="scripts/JScript.js" language="javascript" type="text/javascript"></script>
    
    </head>
    <body>
        <ext:ScriptManager ID="ScriptManager1" runat="server" />
        <form id="form1" runat="server">
            <ext:ViewPort runat="server" ID="parentPanel" Width="100%" Height="100%">
                <Body>
                    <ext:BorderLayout ID="BL" runat="Server">
                        <Center>
                            <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" MinTabWidth="150"
                                ResizeTabs="true">
                                <Tabs>
                                    <ext:Tab ID="Tab1" runat="server" Title="Overview" Icon="Tab">
                                        <Body>
                                            <ext:BorderLayout runat="Server" ID="BorderLayout1">
                                                <Center>
                                                    <ext:Panel ID="pnl" runat="Server" Border="false">
                                                        <Body>
                                                            <ext:RowLayout ID="RowLayout1" runat="server">
                                                                <ext:LayoutRow>
                                                                    <ext:Panel Border="false" ID="Panel5" runat="server" Height="91">
                                                                        <Body>
                                                                            <ext:ColumnLayout ID="ColumnLayout2" runat="server" FitHeight="false">
                                                                                <ext:LayoutColumn ColumnWidth="0.50">
                                                                                    <ext:Panel Border="false" ID="Panel6" runat="server">
                                                                                        <Body>
                                                                                            <ext:DateField ID="dfDate" runat="server">
                                                                                            </ext:DateField>
                                                                                        </Body>
                                                                                    </ext:Panel>
                                                                                </ext:LayoutColumn>
                                                                                <ext:LayoutColumn ColumnWidth="0.50">
                                                                                    <ext:Panel Border="false" ID="Panel1" runat="server">
                                                                                        <Body>
                                                                                        <ext:FitLayout ID="FitLayout1" runat="server">
                                                                                        <ext:Panel Border="false" ID="Pl3" runat="server">
                                                                                            <body>
                                                                                                <uc1:ProcessedBy ID="ProcessedBy1" runat="server" />
                                                                                            </body>
                                                                                        </ext:Panel>
                                                                                    </ext:FitLayout>
                                                                                        </Body>
                                                                                    </ext:Panel>
                                                                                    
                                                                                </ext:LayoutColumn>
                                                                            </ext:ColumnLayout>
                                                                        </Body>
                                                                    </ext:Panel>
                                                                </ext:LayoutRow>
                                                                <ext:LayoutRow RowHeight="1">
                                                                    <ext:Panel Border="false" ID="Panel3" runat="server">
                                                                        <Body>
                                                                            <ext:Button ID="btnApply" runat="server" Text="Apply">
                                                                                <AjaxEvents>
                                                                                    <Click OnEvent="btnApply_Click">
                                                                                        <EventMask ShowMask="true" MinDelay="500" Msg="Updating the values..." />
                                                                                    </Click>
                                                                                </AjaxEvents>
                                                                            </ext:Button>
                                                                            <ext:Button ID="btnCancel" runat="server" Text="Cancel">
                                                                                <AjaxEvents>
                                                                                    <Click OnEvent="btnCancel_Click">
                                                                                        <EventMask ShowMask="true" MinDelay="500" Msg="Cancel the changes..." />
                                                                                    </Click>
                                                                                </AjaxEvents>
                                                                            </ext:Button>
                                                                        </Body>
                                                                    </ext:Panel>
                                                                </ext:LayoutRow>
                                                            </ext:RowLayout>
                                                        </Body>
                                                    </ext:Panel>
                                                </Center>
                                            </ext:BorderLayout>
                                        </Body>
                                    </ext:Tab>
                                </Tabs>
                            </ext:TabPanel>
                        </Center>
                    </ext:BorderLayout>
                </Body>
            </ext:ViewPort>
        </form>
    </body>
    </html>
    and the code is

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {

    }
    protected void btnApply_Click(object sender, EventArgs e)
    {
    DateTime dt = dfDate.SelectedDate;
    }

    in the button click event, i am unable to get date control selected date .It is always showing this date 1/1/0001 12:00:00 AM




  6. #6

    RE: [CLOSED] Post back issues

    Hi Etisbew,

    One issue I noticed right away is that you need to AjaxEventArgs instead of EventArgs.


    Example


    protected void btnApply_Click(object sender, AjaxEventArgs e)

    Hope this helps.


    Geoffrey McGill
    Founder & CEO
  7. #7

    RE: [CLOSED] Post back issues

    Still its not working, please run the above sent code you can find the problem
    Please place any user control and run the code
  8. #8

    RE: [CLOSED] Post back issues

    Hi Etisbew,

    When I run your code the date from the DateField is parsed correctly.


    Geoffrey McGill
    Founder & CEO
  9. #9

    RE: [CLOSED] Post back issues

    Have you placed the user control?

    If you do not place the user control date will be parsed but if you place a user control then comes the problem ...

    Please place a user control and try
  10. #10

    RE: [CLOSED] Post back issues

    Yes, I added a .ascx usercontrol and everything appeared to work correctly. The date was parsed properly.

    Geoffrey McGill
    Founder & CEO
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 10
    Last Post: Nov 09, 2011, 7:19 PM
  2. Partial Post Back
    By hardik in forum 1.x Help
    Replies: 2
    Last Post: Apr 13, 2011, 5:46 AM
  3. Store does not retain value after post back
    By pooja in forum 1.x Help
    Replies: 1
    Last Post: Oct 15, 2010, 7:14 PM
  4. [CLOSED] Post Back issues ????
    By dukefama in forum 1.x Help
    Replies: 2
    Last Post: Oct 08, 2008, 2:52 PM
  5. Replies: 7
    Last Post: Jun 09, 2008, 8:45 PM

Posting Permissions