Probelm with TemplateColumn and Checkbox

Joined
Oct 8, 2008
Messages
1
Reaction score
0
Hey there guys,
so basically I have a TemplateColumn that looks like this:

<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="WL" OnCheckedChanged="Check_Clicked" Runat="server" AutoPostBack="True"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>

in the code behind I have the method Check_Clicked that looks like this:

public void Check_Clicked(object sender, System.EventArgs e)
{
CheckBox cb=(CheckBox)sender;
if (cb.Checked)
{
WinLose="Win";
}
else
{
WinLose="Lose";
}
}

and now the problem, nothing happens when the event is fired..
WinLose always stays the same..
I used some breakpoints to check what happens, everything goes well until it reaches the lines WinLose="Win"; or WinLose="Lose"; and then nothing happens..simply wont put new the new value..

So my question is WHY? and how do I make it change??

Thanks.

P.S
I've tried different combinations, boolean instead of string
cb.Checked==true instead of just cb.Cheked, nothing works..

oh and I'm using VS2003 ASP.NET 1.1
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top