AJAX 101 -- event not firing

J

John Mott

This is a total ID-10T error, but since its my first attempt I'm missing the
obvious.

I downloaded the framework, create an AJAX enabled app, added a page, and
added an update panel with this:

<asp:UpdatePanel ID="updateCategory" runat="server">
<ContentTemplate>
<asp:CheckBox runat="server" ID="chkCategory"
OnCheckedChanged="chkCategory_OnCheck" />
</ContentTemplate>
</asp:UpdatePanel>

However, the event isn't firing on click, the events are queued until the
next page refresh. Is there a 'hey dummy' checklist? No errors, just no
events.

thanks,

john
 
B

bruce barker

if you want the checkbox to post to the server when chcecked, set
AutoPostBack = true

-- bruce (sqlwork.com)
 
J

John Mott

Thank you, that was it. I guess I assumed that putting it in a panel implied
a server hit, but it makes more sense to have the controls do what they
normally do.

John
 
J

John Mott

Thank you again. The next thing i found was that I can't figure out how to
pass a value back in through a checkbox. It never occurred to me before that
the <asp:checkbox> didn't have a "value" attribute, so how do you use a
checkbox to send a value (like a key value to set or clear in a collection)
back into the server?

absent this ability i'll have to implement a button and some sort of
mark/not marked state, which the checkbox is perfect for.

thanks again

john
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top