A
Author #1
I am just curious about this.
We declare a Label control in our web form as
<asp:Label ID="lblMessage" runat="server" Text="Hello"></asp:Label>
Of course, the ID "lblMessage" as given above is of type String.
But, in our code-behind, we can simply use lblMessage as the instance
variable of that declared Label control. What does the .net framework
do behind the scenes? Does it do something like below to link the
variable lblMessage to the control which has the ID "lblMessage"?
Label lblMessage = new Label();
lblMessage.ID = "lblMessage";
We declare a Label control in our web form as
<asp:Label ID="lblMessage" runat="server" Text="Hello"></asp:Label>
Of course, the ID "lblMessage" as given above is of type String.
But, in our code-behind, we can simply use lblMessage as the instance
variable of that declared Label control. What does the .net framework
do behind the scenes? Does it do something like below to link the
variable lblMessage to the control which has the ID "lblMessage"?
Label lblMessage = new Label();
lblMessage.ID = "lblMessage";