Hi All,
I've searched a bunch of different places and cannot seem to find a concrete
answer to this.
This past weekend I was watching some .NET training videos and noticed that
they were using CommandName property on a Button in a Multiview control (or
more specifically in Views of the Multiview control).
Just by setting the CommandName property on the Buttons to things like:
PrevView, NextView, SwitchViewByIndex (& utilizing the CommandArgument
property), SwitchViewByID (& utilizing the CommandArgument property)
They were able to switch the views without any code. As I dug deeper, I
discovered that when using buttons in a GridView, I could do CommandNames
like Edit, Update, Insert, Delete, etc... and have the GridView
automatically switch templates.
My question: is there a comprehensive list of all the CommandNames for all
Controls (dependent on where they're used)?
Thanks,
Brian
Patrice - 11 Feb 2008 16:17 GMT
Check the doc for the XXCommand event in which the command name is used for
the particular control you are interested in... For example, for the
gridview, this is used in the RowCommand event that is :
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowc
ommand.aspx
where you'll find a table for available values...
--
Patrice
> Hi All,
>
[quoted text clipped - 19 lines]
> Thanks,
> Brian
Walter Wang [MSFT] - 12 Feb 2008 03:00 GMT
Hi Brian,
To see each control's supported command names, you can check related
*Command events as Patrice suggested.
To understand how the CommandName works, you can refer to a technique
called "event bubbling" in ASP.NET:
Bubbling an Event
(http://msdn2.microsoft.com/en-us/library/aa719644(VS.71).aspx)
Hope this helps.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.