V
Vittorix
Hi all,
Here's a matter I can't fix:
the method OnCheckedChanged is correctly fired when the checkbox is
selectioned, but not when the checkbox is deselectioned! (the page just
reloads)
Please help, thanks in advance.
I've an Ajax Accordion and a Repeater inside, both connected with a
database.
here is the fundamental 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;
............
}
Here's a matter I can't fix:
the method OnCheckedChanged is correctly fired when the checkbox is
selectioned, but not when the checkbox is deselectioned! (the page just
reloads)
Please help, thanks in advance.
I've an Ajax Accordion and a Repeater inside, both connected with a
database.
here is the fundamental 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;
............
}