<%@ Page Language="C#" %>
<%@Import Namespace="System.Drawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat= "server">
protected void B1_Click(object sender, EventArgs e)
{
if (Text1.Text == "jas" && Text2.Text == "dish")
{
Lbl.Text = "valid user";
//Lbl.ForeColor = " Color.blue";
}
else
{
Lbl.Text = "invali user";
// Lbl.ForeColor = "Color.red";
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body id="L1">
<form id="form1" runat="server">
<div style="color: #008000">
login
<br />
<hr style="border-color: #FF0000; font-size: large; font-style: italic;" />
</div>
<table style="width:60%;">
<tr>
<td>
user id</td>
<td>
<asp:TextBox ID="Text1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
password</td>
<td>
<asp:TextBox ID="Text2" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
</table>
<hr />
<asp:Button ID="B1" runat="server" BackColor="#669900" ForeColor="#3366FF"
onclick="B1_Click" Text="login" />
<hr />
<asp:Label ID="Lbl" runat="server" Height="5px" Text="lbl"
Width="5px"></asp:Label>
<br />
</form>
</body>
</html>
i got an error for the lines in comment sections and error is " CS0029: Cannot implicitly convert type 'string' to 'System.Drawing.Color'
"
i dont understand whats the reason...........

New Topic/Question
Reply



MultiQuote




|