REALLY FRUSTRATING, Please help!!

Discussion in 'ASP .Net' started by Vittorix, Dec 19, 2007.

  1. Vittorix

    Vittorix Guest

    I riepilogate with corrections and updates:

    I've an Ajax Accordion that gets data from a database, in its content
    there is a Repeater that gets data from another table, depending which
    header is selected in the accordion.

    in the Repeater I've a checkbox (one for eache repeated field) checked
    by default that I select/deselect triggering the method
    OnCheckedChanged which updates the record in the table connected to
    the repeater.

    this method OnCheckedChanged is triggered correctly (with the right
    ClientID) when I deselect the a checkbox. I use the passed sender
    checkbox's ClientID to identify and modify the record in the table

    PROBLEM:
    when I deselect the CheckBox, the correct sender ClientID is passed,
    when I select the previously deselected checkbox a wrong ClientID is
    passed!
    in particolar, i found that it is passed the ClientID of last
    unselected chechbox in the repeater

    Please help, I'm going nuts!

    here is the essential structure:


    ======================aspx
    page========================================
    <%@ Page Language="C#" AutoEventWireup="true"
    CodeFile="Shipping.aspx.cs"
    Inherits="test" MaintainScrollPositionOnPostback="true" %>


    <ajaxToolkit:ToolkitScriptManager EnablePartialRendering="true"
    runat="Server" ID="ToolkitScriptManager1" />


    <ajaxToolkit:Accordion ID="MyAccordion" runat="server"
    SelectedIndex="0" HeaderCssClass="accordionHeader"
    HeaderSelectedCssClass="accordionHeaderSelected"
    ContentCssClass="accordionContent"
    FadeTransitions="false" FramesPerSecond="1"
    TransitionDuration="1" AutoSize="None"
    RequireOpenedPane="true" SuppressHeaderPostbacks="false"
    Width="900px" >


    <ContentTemplate>


    <asp:Repeater ID="Repeater1" runat="server"
    DataSourceID="SqlDataSource1">
    <ItemTemplate>


    <asp:CheckBox ID="ManifestCheckBox"
    runat="server" AutoPostBack="true"
    Checked="True" OnCheckedChanged =
    "ManifestCheckBox_CheckedChanged" />


    </ItemTemplate>
    </asp:Repeater>
    </ContentTemplate>
    </ajaxToolkit:Accordion>


    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:XXXXXXXXXXXXXXX %>"
    SelectCommand="SELECT * FROM [tblPICManifest] WHERE
    ([PICBatchID] =
    @PICBatchID)">
    <SelectParameters>
    <asp:ControlParameter ControlID="selectedLbl"
    DefaultValue=""
    Name="PICBatchID"
    PropertyName="Text" Type="Int32" />
    </SelectParameters>
    </asp:SqlDataSource>


    ======================aspx.cs
    code========================================


    protected void Page_Load(object sender, EventArgs e)
    {


    if (!IsPostBack)
    else
    {
    ............
    }


    protected void ManifestCheckBox_CheckedChanged(object sender,
    EventArgs e)
    {
    Control ctrSender = (Control)sender;
    string controlID = ctrSender.ClientID;


    ............



    }


    --
    ciao
    Vittorix
     
    Vittorix, Dec 19, 2007
    #1
    1. Advertising

  2. Vittorix

    Scott M. Guest

    Probably a good idea not to start with "riepilogate". You scared me away
    from reading the rest of your post after seeing that!


    "Vittorix" <> wrote in message
    news:...
    >I riepilogate with corrections and updates:
    >
    > I've an Ajax Accordion that gets data from a database, in its content
    > there is a Repeater that gets data from another table, depending which
    > header is selected in the accordion.
    >
    > in the Repeater I've a checkbox (one for eache repeated field) checked
    > by default that I select/deselect triggering the method
    > OnCheckedChanged which updates the record in the table connected to
    > the repeater.
    >
    > this method OnCheckedChanged is triggered correctly (with the right
    > ClientID) when I deselect the a checkbox. I use the passed sender
    > checkbox's ClientID to identify and modify the record in the table
    >
    > PROBLEM:
    > when I deselect the CheckBox, the correct sender ClientID is passed,
    > when I select the previously deselected checkbox a wrong ClientID is
    > passed!
    > in particolar, i found that it is passed the ClientID of last
    > unselected chechbox in the repeater
    >
    > Please help, I'm going nuts!
    >
    > here is the essential structure:
    >
    >
    > ======================aspx
    > page========================================
    > <%@ Page Language="C#" AutoEventWireup="true"
    > CodeFile="Shipping.aspx.cs"
    > Inherits="test" MaintainScrollPositionOnPostback="true" %>
    >
    >
    > <ajaxToolkit:ToolkitScriptManager EnablePartialRendering="true"
    > runat="Server" ID="ToolkitScriptManager1" />
    >
    >
    > <ajaxToolkit:Accordion ID="MyAccordion" runat="server"
    > SelectedIndex="0" HeaderCssClass="accordionHeader"
    > HeaderSelectedCssClass="accordionHeaderSelected"
    > ContentCssClass="accordionContent"
    > FadeTransitions="false" FramesPerSecond="1"
    > TransitionDuration="1" AutoSize="None"
    > RequireOpenedPane="true" SuppressHeaderPostbacks="false"
    > Width="900px" >
    >
    >
    > <ContentTemplate>
    >
    >
    > <asp:Repeater ID="Repeater1" runat="server"
    > DataSourceID="SqlDataSource1">
    > <ItemTemplate>
    >
    >
    > <asp:CheckBox ID="ManifestCheckBox"
    > runat="server" AutoPostBack="true"
    > Checked="True" OnCheckedChanged =
    > "ManifestCheckBox_CheckedChanged" />
    >
    >
    > </ItemTemplate>
    > </asp:Repeater>
    > </ContentTemplate>
    > </ajaxToolkit:Accordion>
    >
    >
    > <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    > ConnectionString="<%$ ConnectionStrings:XXXXXXXXXXXXXXX %>"
    > SelectCommand="SELECT * FROM [tblPICManifest] WHERE
    > ([PICBatchID] =
    > @PICBatchID)">
    > <SelectParameters>
    > <asp:ControlParameter ControlID="selectedLbl"
    > DefaultValue=""
    > Name="PICBatchID"
    > PropertyName="Text" Type="Int32" />
    > </SelectParameters>
    > </asp:SqlDataSource>
    >
    >
    > ======================aspx.cs
    > code========================================
    >
    >
    > protected void Page_Load(object sender, EventArgs e)
    > {
    >
    >
    > if (!IsPostBack)
    > else
    > {
    > ............
    > }
    >
    >
    > protected void ManifestCheckBox_CheckedChanged(object sender,
    > EventArgs e)
    > {
    > Control ctrSender = (Control)sender;
    > string controlID = ctrSender.ClientID;
    >
    >
    > ............
    >
    >
    >
    > }
    >
    >
    > --
    > ciao
    > Vittorix
    >
     
    Scott M., Dec 20, 2007
    #2
    1. Advertising

  3. "Scott M." <> wrote in message
    news:%23xyVh%...

    > Probably a good idea not to start with "riepilogate". You scared me away
    > from reading the rest of your post after seeing that!


    The OP is obviously Italian, and by "riepilogate" he means "recapitulate"...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Dec 20, 2007
    #3
  4. Vittorix

    Vittorix Guest

    Scott M. wrote:
    > Probably a good idea not to start with "riepilogate".


    sorry :)
    Now can I get some help?

    --
    ciao
    Vittorix
     
    Vittorix, Dec 20, 2007
    #4
  5. Vittorix

    Vittorix Guest

    Mark Rae [MVP] wrote:

    >> Probably a good idea not to start with "riepilogate". You scared me
    >> away from reading the rest of your post after seeing that!

    >
    > The OP is obviously Italian, and by "riepilogate" he means
    > "recapitulate"...


    you got me :-D

    --
    ciao
    Vittorix
     
    Vittorix, Dec 20, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dan m

    painfully ignorant but frustrating

    dan m, Feb 6, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    312
    Alvin Bruney [MVP]
    Mar 2, 2004
  2. Simon Harvey
    Replies:
    1
    Views:
    328
    Guest
    Apr 2, 2004
  3. nc
    Replies:
    1
    Views:
    502
    nice.guy.nige
    Feb 3, 2005
  4. KK
    Replies:
    2
    Views:
    586
    Big Brian
    Oct 14, 2003
  5. Replies:
    30
    Views:
    995
    Arne Vajhøj
    Feb 10, 2008
Loading...

Share This Page