REALLY FRUSTRATING, Please help!!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vittorix

    #1

    REALLY FRUSTRATING, Please help!!

    Hi everybody.

    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
    OnCheckedChange d which updates the record in the table connected to
    the repeater.

    this method OnCheckedChange d 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="Shipp ing.aspx.cs"
    Inherits="test" MaintainScrollP ositionOnPostba ck="true" %>


    <ajaxToolkit:To olkitScriptMana ger EnablePartialRe ndering="true"
    runat="Server" ID="ToolkitScri ptManager1" />


    <ajaxToolkit:Ac cordion ID="MyAccordion " runat="server"
    SelectedIndex=" 0" HeaderCssClass= "accordionHeade r"
    HeaderSelectedC ssClass="accord ionHeaderSelect ed"
    ContentCssClass ="accordionCont ent"
    FadeTransitions ="false" FramesPerSecond ="1"
    TransitionDurat ion="1" AutoSize="None"
    RequireOpenedPa ne="true" SuppressHeaderP ostbacks="false "
    Width="900px" >


    <ContentTemplat e>


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


    <asp:CheckBox ID="ManifestChe ckBox"
    runat="server" AutoPostBack="t rue"
    Checked="True" OnCheckedChange d =
    "ManifestCheckB ox_CheckedChang ed" />


    </ItemTemplate>
    </asp:Repeater>
    </ContentTemplate >
    </ajaxToolkit:Acc ordion>


    <asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
    ConnectionStrin g="<%$ ConnectionStrin gs:XXXXXXXXXXXX XXX %>"
    SelectCommand=" SELECT * FROM [tblPICManifest] WHERE
    ([PICBatchID] =
    @PICBatchID)">
    <SelectParamete rs>
    <asp:ControlPar ameter ControlID="sele ctedLbl"
    DefaultValue=""
    Name="PICBatchI D"
    PropertyName="T ext" Type="Int32" />
    </SelectParameter s>
    </asp:SqlDataSour ce>


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


    protected void Page_Load(objec t sender, EventArgs e)
    {


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


    protected void ManifestCheckBo x_CheckedChange d(object sender,
    EventArgs e)
    {
    Control ctrSender = (Control)sender ;
    string controlID = ctrSender.Clien tID;


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



    }


    --
    ciao
    Vittorix

Working...