I want to populate an html label based on user information. I know how to read the data from html to c#, and how to manipulate the data. I just dont know how to return the data from c# to the html label.
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="LoginUserName">Username:</asp:Label>
<asp:TextBox ID="LoginUserName" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="LoginPassword">Password:</asp:Label>
<asp:TextBox ID="LoginPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
<asp:Label ID="errorMessageLable" AssociatedControlID="error开发者_JS百科Check" CssClass="errorMessage" runat="server"></asp:Label>
I want to be able to fill in the error message in the errorMessageLabel.
In your code-behind file (the .cs file) you should access your label this way:
errorMessageLable.Text = "YourErrorMessageHere";
精彩评论