I’m new to .NET and ASP. While creating a button, in the MSDN docs, it talks about using a command rather than the traditional submit functionality, which is what I want. It also shows setting the method to be run by using the OnCommand attribute. I used this methodology, and sure enough, got the expected results, but noticed that VS2010 doesn’t have the OnCommand property in the Properties pane, nor does it show up in the Intellisense in code view. Why is this functionality possible if it isn’t showing up in VS’s databases?
I’m new to .NET and ASP. While creating a button, in the MSDN docs,
Share
For almost every control including asp:Button you can find events which it fires if you hit the small lightning pic just above the properties pane. Click twice on any of events listed there and VS will create an event handler for you. oncommand is just a property pointing to a standard method created by framework which handles the command event of the Button.
In simple cases you may prefer using onclick instead of oncommand which does not support command arguments (and events bubbling). Difference is discussed for example here. You can create the onclick event handler if you doubleclick on the button in the Design View.