Why we are using "for" attribute in asp:lable tag

Posted by dhirenkaunar-15094 under ASP.NET on 5/22/2012 | Points: 10 | Views : 1016 | Status : [Member] | Replies : 1
Hi,

I want some information regarding : "for" attribute in asp:Label tag.

The below code what it means..

<asp:Label for="DiscountAmt" runat="server" ID="lblPartnerDiscountAmt" Style="padding-left: 2px;
padding-right: 10px; font-weight: bold;"></asp:Label>

Thanks & Rgards,
Dhiren Kumar Kaunar



Responses

Posted by: Sheonarayan on: 5/22/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
"for" attribute of the asp:Label is used to attach the textbox with the Label.

In this case, it is assumed that there would be a asp:TextBox or other asp.net form control with id as "DiscountAmt". When you run this page in browser, clicking on the asp:Label text will focus the cursor on the TextBox.

Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

dhirenkaunar-15094, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response