Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with file .ascx

Status
Not open for further replies.

neomax

Programmer
Jul 1, 2006
29
BG
hi, I have 2 files aspx and ascx and compiler return erorr, please help me to resolve that problem

login.ascx
<%@ Control className="login" %>
<%@ Import Namespace="System.Web.Security " %>
<script language="C#" runat="server">
void Login_Click(object sender, EventArgs E)
{
// ?????????????? ????????????: ??? ????????
// ????????????? ??????
// ?????? ???????????? ? ?????? doug@programmingasp.net
// ? ??????? 'password1.
if ((UserEmail.Value == "doug@programmingasp.net") &&
(UserPass.Value == "password"))
{
// FormsAuthentication . RedirectFromLoginPageC
// UserEmail. Value, false);
Fo rmsAuthenticat ion. Get Redirect Url ( UserEmail.Value, false);
Msg.Text = "Logged In I" ;
}
else
{
Msg.Text = "Invalid Credentials: Please try again";
</script>
<table width=120 bgColor="red">
<tr>
<td>
<center>
<h3>
<font face="Verdana" color=Yellow>Login<font>
</h3>
<table width=100px>
<tr>
<td>
<font color=yellow>Email:</font>
</td>
</tr>
<tr>
<td>
<input id="Text1" ld="UserEmail"
type="text"
runat=server />
size=20
maxlen=30 />
</td>
<td>
<asp: RequiredFieldValidator
ControlToValidate="UserEmail"
Display="Static"
ErrorMessage="*"
runat="server" />
</td>
</tr>
<tr>
<td>
<font color=yellow>Password:</font>
</td>
</tr>
<tr>
<td>
<input id="UserPass"
type=password
runat=server
size=20
maxlen=30 />
</td>
<td>
<asp:RequiredFieldValidator
ControlToValidate="UserPass"
Display="Static"
ErrorHessage="*"
runat=server />
</td>
</tr>
<tr>
<td colspan=3 align="center">
<asp:button text="Login"
QnClick="Login_Click"
runat=server>
</asp:button>
<P>
<asp:Label id="Msg" ForeColor="Yellow"
Font-Name="Verdana"
Font-Size="10"
runat=server />
</td>
</tr>
</table>

and

UserLogin.aspx

<%@ Page LANGUAGE="C#" %>
<%@ Register TagPrefix="Chapter06" TagName="login" Src="Login.ascx" %>
<html>
<head>
<title>Use Login User Control</title>
</head>
<body leftrmargin="0" topmargin="0">
<form id="Form1" runat=server>
<table width=600 height=600 border=C
cellpadding=0 cellspacing=0>
<tr>
<td width=120 bgcolor="blue" valign=top>
<font face="verdana"
color="yellow" size=2xb>
Just before the user control is included...
</b></font>
<Chapter06:login
rD="LoginControl"
RunAt=Server />
<font face="verdana"
color="yellow" size=2xb>
Just after the us«r control was included...
</b></font>
</td>
<td valign=top>
<center>
<br>
<bxfont face="verdana" size=4>
This is the rest of the page!
</fontx/b>
</center>
</td>
</tr>
</table>
</form>
</body>
</html>
 
erorr is

Parser Error Message: Unknown server tag 'asp:'.

Source Error:


Line 42: </td>
Line 43: <td>
Line 44: <asp: RequiredFieldValidator
Line 45: ControlToValidate="UserEmail"
Line 46: Display="Static"

 
1.

<Chapter06:login
rD="LoginControl"
RunAt=Server />

should be

<Chapter06:login
id="LoginControl"
RunAt=Server />


2. Which page throws the error? the ascx?

3. Just <%@ Import Namespace="System.Web.Security " %>
works for you? should you not also

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HTMLControls


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top