By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

DataList - How Does It Know

P: n/a
I have a datalist control and when edit mode, I have three buttons, one for
delete, one for cancel and one for Update. My Update button is not causing
anything to happen. The other two events work just fine.

I thought the way in knows which event to fire is by the "CommandName"

My button looks like the following:
<asp:Button CommandName="Update" Text="Update Highlights" Runat="server"
ID="cmdUpdateHighlights" CausesValidation="True"></asp:Button>

My OnUpdateCommand in the Datalist Attribute looks like this...
OnUpdateCommand="ProcessHighlightUpdateCommand"

SO is it not true that if my command name is "Update" that run
"ProcessHighlightUpdateCommand"?

It seems to work on the other buttons, but why not Update?

Thanks in advance for your assistance!!!!
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try doing this in a more straightforward manner. Instead of declaring your
own names for the events, use the built-in ones - EditCommand,
DeleteCommand, UpdateCommand. Leave ItemCommand for any other stray commands
you might need.

The reason your event isn't firing is that it is wired to UpdateCommand,
where the command you are actually using is Update. You could catch this in
the ItemCommand event, but I recommend just using the standard handlers.

"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
I have a datalist control and when edit mode, I have three buttons, one for delete, one for cancel and one for Update. My Update button is not causing anything to happen. The other two events work just fine.

I thought the way in knows which event to fire is by the "CommandName"

My button looks like the following:
<asp:Button CommandName="Update" Text="Update Highlights" Runat="server"
ID="cmdUpdateHighlights" CausesValidation="True"></asp:Button>

My OnUpdateCommand in the Datalist Attribute looks like this...
OnUpdateCommand="ProcessHighlightUpdateCommand"

SO is it not true that if my command name is "Update" that run
"ProcessHighlightUpdateCommand"?

It seems to work on the other buttons, but why not Update?

Thanks in advance for your assistance!!!!

Nov 18 '05 #2

P: n/a
The problem turn out to be the Validation controls. I did not place an
error message on the controls, and so they were detecting errors at the
client and never doing a post back because the page did not pass local
validation. It really looks like you button is dead when you forget to
provide an error message on validation controls.
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.