When I use e. in an event handler all Intellisense wants to show me is:
// Event handler
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
// can only 'see" these properties of e
e. [Equals | GetHashCode | GetType | ToString ]
// can only 'see" these properties of sender
sender.[Equals | GetHashCode | GetType | ToString ]
}
// BuildNewFileButton control declaration
<asp:Button ID="BuildNewFileButton"
OnCommand="BuildNewFileButton_Click"
CommandName="FileStructure"
CommandArgument="NoExtensions"
Text="Build New File"
runat="server"/>
The control declares a CommandName and CommandArgument and even though they
are properties documentation at MSDN shows they can be referenced (get) the
CommandArgument property through e as follows...
// Get value of CommandArgument
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
if(e.CommandArgument == "NoExtensions")
// do something...
}
I've read the documents at MSDN [1,2] but I really still don't get how to
use an [OnCommand | OnClick] method with CommandName, and CommandArgument
properties...
....What am I failing to understand here?
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
[1] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
[2] http://msdn2.microsoft.com/en-us/lib...dargument.aspx 6 2480
I'm no expert here but...
Intellisense is working, EventArgs is a generic base event that knows
nothing about commands.
OnClick="Button_Click"
corresponds to:
protected void Button_Click(object sender, EventArgs e){.. generic event
whereas
OnCommand="Button_Command"
corresponds to :
protected void Button_Command(object sender, CommandEventArgs e){
switch ( e.CommandName ) {
case "Cancel":
// do stuff
Response.Redirect( "RegistrantList.aspx" );
break;
}
}
that's my foggy interpretation of things at hand ;)
"clintonG" wrote:
When I use e. in an event handler all Intellisense wants to show me is:
// Event handler
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
// can only 'see" these properties of e
e. [Equals | GetHashCode | GetType | ToString ]
// can only 'see" these properties of sender
sender.[Equals | GetHashCode | GetType | ToString ]
}
// BuildNewFileButton control declaration
<asp:Button ID="BuildNewFileButton"
OnCommand="BuildNewFileButton_Click"
CommandName="FileStructure"
CommandArgument="NoExtensions"
Text="Build New File"
runat="server"/>
The control declares a CommandName and CommandArgument and even though they
are properties documentation at MSDN shows they can be referenced (get) the
CommandArgument property through e as follows...
// Get value of CommandArgument
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
if(e.CommandArgument == "NoExtensions")
// do something...
}
I've read the documents at MSDN [1,2] but I really still don't get how to
use an [OnCommand | OnClick] method with CommandName, and CommandArgument
properties...
....What am I failing to understand here?
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
[1] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
[2] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
Good point about the CommandEventArgs e parameter but the MSDN document
shows the control using an OnCommand="CommandBtn_Click" attribute pair
which is inconsistent with what your comments suggest [would | should]
coincide with one another, e.g. OnCommand="CommandBtn_Command or
OnClick="CommandBtn_Click" wouldn't you think?
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:B1**********************************@microsof t.com...
I'm no expert here but...
Intellisense is working, EventArgs is a generic base event that knows
nothing about commands.
OnClick="Button_Click"
corresponds to:
protected void Button_Click(object sender, EventArgs e){.. generic event
whereas
OnCommand="Button_Command"
corresponds to :
protected void Button_Command(object sender, CommandEventArgs e){
switch ( e.CommandName ) {
case "Cancel":
// do stuff
Response.Redirect( "RegistrantList.aspx" );
break;
}
}
that's my foggy interpretation of things at hand ;)
"clintonG" wrote:
>When I use e. in an event handler all Intellisense wants to show me is:
// Event handler protected void BuildNewFileButton_Click(Object sender, EventArgs e) { // can only 'see" these properties of e e. [Equals | GetHashCode | GetType | ToString ] // can only 'see" these properties of sender sender.[Equals | GetHashCode | GetType | ToString ] }
// BuildNewFileButton control declaration <asp:Button ID="BuildNewFileButton" OnCommand="BuildNewFileButton_Click" CommandName="FileStructure" CommandArgument="NoExtensions" Text="Build New File" runat="server"/>
The control declares a CommandName and CommandArgument and even though they are properties documentation at MSDN shows they can be referenced (get) the CommandArgument property through e as follows...
// Get value of CommandArgument protected void BuildNewFileButton_Click(Object sender, EventArgs e) { if(e.CommandArgument == "NoExtensions") // do something... }
I've read the documents at MSDN [1,2] but I really still don't get how to use an [OnCommand | OnClick] method with CommandName, and CommandArgument properties...
....What am I failing to understand here?
<%= Clinton Gallagher NET csgallagher AT metromilwaukee.com URL http://clintongallagher.metromilwaukee.com/ MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
[1] http://msdn2.microsoft.com/en-us/lib...dargument.aspx [2] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
the attribute OnCommand can be assigned any arbitrary value, e.g.
OnCommand="foo" as long as there is a corresponding method in the codebehind
file with that name e.g.
protected void foo(object sender, CommandEventArgs e){...
The choice of CommandBtn_Click for a value in the docs is a tad confusing
because of the "Click" in the string, but it's just a string.
"clintonG" wrote:
Good point about the CommandEventArgs e parameter but the MSDN document
shows the control using an OnCommand="CommandBtn_Click" attribute pair
which is inconsistent with what your comments suggest [would | should]
coincide with one another, e.g. OnCommand="CommandBtn_Command or
OnClick="CommandBtn_Click" wouldn't you think?
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:B1**********************************@microsof t.com...
I'm no expert here but...
Intellisense is working, EventArgs is a generic base event that knows
nothing about commands.
OnClick="Button_Click"
corresponds to:
protected void Button_Click(object sender, EventArgs e){.. generic event
whereas
OnCommand="Button_Command"
corresponds to :
protected void Button_Command(object sender, CommandEventArgs e){
switch ( e.CommandName ) {
case "Cancel":
// do stuff
Response.Redirect( "RegistrantList.aspx" );
break;
}
}
that's my foggy interpretation of things at hand ;)
"clintonG" wrote:
When I use e. in an event handler all Intellisense wants to show me is:
// Event handler
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
// can only 'see" these properties of e
e. [Equals | GetHashCode | GetType | ToString ]
// can only 'see" these properties of sender
sender.[Equals | GetHashCode | GetType | ToString ]
}
// BuildNewFileButton control declaration
<asp:Button ID="BuildNewFileButton"
OnCommand="BuildNewFileButton_Click"
CommandName="FileStructure"
CommandArgument="NoExtensions"
Text="Build New File"
runat="server"/>
The control declares a CommandName and CommandArgument and even though
they
are properties documentation at MSDN shows they can be referenced (get)
the
CommandArgument property through e as follows...
// Get value of CommandArgument
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
if(e.CommandArgument == "NoExtensions")
// do something...
}
I've read the documents at MSDN [1,2] but I really still don't get how to
use an [OnCommand | OnClick] method with CommandName, and CommandArgument
properties...
....What am I failing to understand here?
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
[1] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
[2] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
After last reply I used the CommandEventArgs e as the parameter for the
click event handler as you reminded and I see what you mean in your last
reply about the name value of the attribute being an arbitrary string.
When the OnCommand attribute is used within a corresponding control
declaration we must use CommandEventArgs e as the parameter in the event
handler but the event handler type can be either <String>_Click or
<String>_Command.
Now, why would we want to choose _Click or _Command? It seems we want to use
_Command when needing to bubble properties up to another event handler but
again I'm still shady on that too. Going to sleep on it tonight. I had an in
patient procedure today (epidural) and the narcotics are all worn out and
I'm really exhausted. Thanks for helping me think through this Dabbler...
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:04**********************************@microsof t.com...
the attribute OnCommand can be assigned any arbitrary value, e.g.
OnCommand="foo" as long as there is a corresponding method in the
codebehind
file with that name e.g.
protected void foo(object sender, CommandEventArgs e){...
The choice of CommandBtn_Click for a value in the docs is a tad confusing
because of the "Click" in the string, but it's just a string.
"clintonG" wrote:
>Good point about the CommandEventArgs e parameter but the MSDN document shows the control using an OnCommand="CommandBtn_Click" attribute pair which is inconsistent with what your comments suggest [would | should] coincide with one another, e.g. OnCommand="CommandBtn_Command or OnClick="CommandBtn_Click" wouldn't you think?
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message news:B1**********************************@microso ft.com...
I'm no expert here but...
Intellisense is working, EventArgs is a generic base event that knows
nothing about commands.
OnClick="Button_Click"
corresponds to:
protected void Button_Click(object sender, EventArgs e){.. generic
event
whereas
OnCommand="Button_Command"
corresponds to :
protected void Button_Command(object sender, CommandEventArgs e){
switch ( e.CommandName ) {
case "Cancel":
// do stuff
Response.Redirect( "RegistrantList.aspx" );
break;
}
}
that's my foggy interpretation of things at hand ;)
"clintonG" wrote:
When I use e. in an event handler all Intellisense wants to show me is:
// Event handler protected void BuildNewFileButton_Click(Object sender, EventArgs e) { // can only 'see" these properties of e e. [Equals | GetHashCode | GetType | ToString ] // can only 'see" these properties of sender sender.[Equals | GetHashCode | GetType | ToString ] }
// BuildNewFileButton control declaration <asp:Button ID="BuildNewFileButton" OnCommand="BuildNewFileButton_Click" CommandName="FileStructure" CommandArgument="NoExtensions" Text="Build New File" runat="server"/>
The control declares a CommandName and CommandArgument and even though they are properties documentation at MSDN shows they can be referenced (get) the CommandArgument property through e as follows...
// Get value of CommandArgument protected void BuildNewFileButton_Click(Object sender, EventArgs e) { if(e.CommandArgument == "NoExtensions") // do something... }
I've read the documents at MSDN [1,2] but I really still don't get how to use an [OnCommand | OnClick] method with CommandName, and CommandArgument properties...
....What am I failing to understand here?
<%= Clinton Gallagher NET csgallagher AT metromilwaukee.com URL http://clintongallagher.metromilwaukee.com/ MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
[1] http://msdn2.microsoft.com/en-us/lib...dargument.aspx [2] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
I think you are missing my point, the name of the event handler is truly
arbitary, it could be <string>_Click, <string>_Command or <string>_ummagumma.
The attribute name determines the event type, not the attribute value, e.g.
OnCommand or OnClick, not <string>_Command or <string>_anything.
Hope you feel better in the morning ;)
"clintonG" wrote:
After last reply I used the CommandEventArgs e as the parameter for the
click event handler as you reminded and I see what you mean in your last
reply about the name value of the attribute being an arbitrary string.
When the OnCommand attribute is used within a corresponding control
declaration we must use CommandEventArgs e as the parameter in the event
handler but the event handler type can be either <String>_Click or
<String>_Command.
Now, why would we want to choose _Click or _Command? It seems we want to use
_Command when needing to bubble properties up to another event handler but
again I'm still shady on that too. Going to sleep on it tonight. I had an in
patient procedure today (epidural) and the narcotics are all worn out and
I'm really exhausted. Thanks for helping me think through this Dabbler...
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:04**********************************@microsof t.com...
the attribute OnCommand can be assigned any arbitrary value, e.g.
OnCommand="foo" as long as there is a corresponding method in the
codebehind
file with that name e.g.
protected void foo(object sender, CommandEventArgs e){...
The choice of CommandBtn_Click for a value in the docs is a tad confusing
because of the "Click" in the string, but it's just a string.
"clintonG" wrote:
Good point about the CommandEventArgs e parameter but the MSDN document
shows the control using an OnCommand="CommandBtn_Click" attribute pair
which is inconsistent with what your comments suggest [would | should]
coincide with one another, e.g. OnCommand="CommandBtn_Command or
OnClick="CommandBtn_Click" wouldn't you think?
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:B1**********************************@microsof t.com...
I'm no expert here but...
Intellisense is working, EventArgs is a generic base event that knows
nothing about commands.
OnClick="Button_Click"
corresponds to:
protected void Button_Click(object sender, EventArgs e){.. generic
event
whereas
OnCommand="Button_Command"
corresponds to :
protected void Button_Command(object sender, CommandEventArgs e){
switch ( e.CommandName ) {
case "Cancel":
// do stuff
Response.Redirect( "RegistrantList.aspx" );
break;
}
}
that's my foggy interpretation of things at hand ;)
"clintonG" wrote:
When I use e. in an event handler all Intellisense wants to show me
is:
// Event handler
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
// can only 'see" these properties of e
e. [Equals | GetHashCode | GetType | ToString ]
// can only 'see" these properties of sender
sender.[Equals | GetHashCode | GetType | ToString ]
}
// BuildNewFileButton control declaration
<asp:Button ID="BuildNewFileButton"
OnCommand="BuildNewFileButton_Click"
CommandName="FileStructure"
CommandArgument="NoExtensions"
Text="Build New File"
runat="server"/>
The control declares a CommandName and CommandArgument and even though
they
are properties documentation at MSDN shows they can be referenced
(get)
the
CommandArgument property through e as follows...
// Get value of CommandArgument
protected void BuildNewFileButton_Click(Object sender, EventArgs e)
{
if(e.CommandArgument == "NoExtensions")
// do something...
}
I've read the documents at MSDN [1,2] but I really still don't get how
to
use an [OnCommand | OnClick] method with CommandName, and
CommandArgument
properties...
....What am I failing to understand here?
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
[1] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
[2] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
I feel great this morning thanks.
I probably didn't convey it clearly but I understood you. I still need to
really understand the scope of using the OnCommand attribute. Command to
what for example? BTW, its a quibble but I wrote <String>_EventName to
follow the consensus naming convention. An event would not ordinarily be
named using camel case. Are you a maverick ? ;-)
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:EF**********************************@microsof t.com...
>I think you are missing my point, the name of the event handler is truly
arbitary, it could be <string>_Click, <string>_Command or
<string>_ummagumma.
The attribute name determines the event type, not the attribute value,
e.g.
OnCommand or OnClick, not <string>_Command or <string>_anything.
Hope you feel better in the morning ;)
"clintonG" wrote:
>After last reply I used the CommandEventArgs e as the parameter for the click event handler as you reminded and I see what you mean in your last reply about the name value of the attribute being an arbitrary string.
When the OnCommand attribute is used within a corresponding control declaration we must use CommandEventArgs e as the parameter in the event handler but the event handler type can be either <String>_Click or <String>_Command.
Now, why would we want to choose _Click or _Command? It seems we want to use _Command when needing to bubble properties up to another event handler but again I'm still shady on that too. Going to sleep on it tonight. I had an in patient procedure today (epidural) and the narcotics are all worn out and I'm really exhausted. Thanks for helping me think through this Dabbler...
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message news:04**********************************@microso ft.com...
the attribute OnCommand can be assigned any arbitrary value, e.g.
OnCommand="foo" as long as there is a corresponding method in the
codebehind
file with that name e.g.
protected void foo(object sender, CommandEventArgs e){...
The choice of CommandBtn_Click for a value in the docs is a tad
confusing
because of the "Click" in the string, but it's just a string.
"clintonG" wrote:
Good point about the CommandEventArgs e parameter but the MSDN document shows the control using an OnCommand="CommandBtn_Click" attribute pair which is inconsistent with what your comments suggest [would | should] coincide with one another, e.g. OnCommand="CommandBtn_Command or OnClick="CommandBtn_Click" wouldn't you think?
<%= Clinton
"Dabbler" <Da*****@discussions.microsoft.comwrote in message news:B1**********************************@microso ft.com...
I'm no expert here but...
Intellisense is working, EventArgs is a generic base event that
knows
nothing about commands.
OnClick="Button_Click"
corresponds to:
protected void Button_Click(object sender, EventArgs e){.. generic
event
whereas
OnCommand="Button_Command"
corresponds to :
protected void Button_Command(object sender, CommandEventArgs e){
switch ( e.CommandName ) {
case "Cancel":
// do stuff
Response.Redirect( "RegistrantList.aspx" );
break;
}
}
that's my foggy interpretation of things at hand ;)
"clintonG" wrote:
When I use e. in an event handler all Intellisense wants to show me is:
// Event handler protected void BuildNewFileButton_Click(Object sender, EventArgs e) { // can only 'see" these properties of e e. [Equals | GetHashCode | GetType | ToString ] // can only 'see" these properties of sender sender.[Equals | GetHashCode | GetType | ToString ] }
// BuildNewFileButton control declaration <asp:Button ID="BuildNewFileButton" OnCommand="BuildNewFileButton_Click" CommandName="FileStructure" CommandArgument="NoExtensions" Text="Build New File" runat="server"/>
The control declares a CommandName and CommandArgument and even though they are properties documentation at MSDN shows they can be referenced (get) the CommandArgument property through e as follows...
// Get value of CommandArgument protected void BuildNewFileButton_Click(Object sender, EventArgs e) { if(e.CommandArgument == "NoExtensions") // do something... }
I've read the documents at MSDN [1,2] but I really still don't get how to use an [OnCommand | OnClick] method with CommandName, and CommandArgument properties...
....What am I failing to understand here?
<%= Clinton Gallagher NET csgallagher AT metromilwaukee.com URL http://clintongallagher.metromilwaukee.com/ MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
[1] http://msdn2.microsoft.com/en-us/lib...dargument.aspx [2] http://msdn2.microsoft.com/en-us/lib...dargument.aspx
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: monkey king |
last post by:
I have a given dll file(PDFCreator.dll) - probably generated by VC++.
I want to use its method(PDFCreator()) in dotNet environment. It works
well in WindiowsApplication, but bad in WebApplication...
|
by: muralidharan |
last post by:
WebForm1.aspx Code:
<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI"
Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView
id="TreeView1" Height="520"...
|
by: freddy |
last post by:
I would like to load a path to a file when the form loads like this:
public void Form1_Load(object sender, System.EventArgs e)
{
string path = "G:\\\\Freddy\\vb.net\\c#\\football.txt";...
|
by: Poewood |
last post by:
Okay here are four classes for a pocket pc program: Input, fpositional,
ComboBoxArray and TextBoxArray. The "input" class is the form. I use the
fpositional class to handle most of the functions...
|
by: Martine |
last post by:
Hi there!
I have a problem with programmatically adding user controls to my
mobile webforms. If I load my usercontrol programmatically (in the
Page_Load), the object is instantiated, I have...
|
by: Jeff |
last post by:
I'm getting an Object Reference error before I even run my app, and
I'm not sure where to look to find the cause. I'd appreciate your
help.
When I open my Windows Application project, the...
|
by: ST |
last post by:
Hello everyone, Can anyone help me with this error above when I debug my web
app project in vstudio.net?? I can't figure it out! It was working fine for
months, and now all of a sudden it's not!!...
|
by: SAL |
last post by:
I am getting the following ERROR in my WebApp on line 30:
Server Error in '/TestWebApp' Application.
--------------------------------------------------------------------------------
Object...
|
by: =?Utf-8?B?cGVsZWdrMQ==?= |
last post by:
i work on winxp with Net2 ver 2.0.50727 in the IIS (under ASP.NET)
in my web.config file i have :
<configuration>
<connectionStrings>
<add name="local_con" connectionString="Data...
|
by: livmacca |
last post by:
Hi,
I am new to VB .Net programming and is trying to create a webpage. I encountered the following error and is totally clueless on how to make it work:
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |