User Controls and IIS 5.1

A

AL Cs

Hi
Hope I am in the right newsgroup, and sorry if I`m not..
Trying to teach myself some ASP.NET, I am reading "Sams Teach Yoyrself
ASP.NET in 21 days" But I am strugling with the "User Controls" (also). What
ever I do, my server do not see the difference between the "ascx" file and
the "aspx" file when I run it. The errors are "picked" in the aspx file, and
blamed on the "ascx" file, and vica verca, as if it was the one and same
thing.


My ASCX file looks like this: What my ASPX file looks like comes next,
and one of all the error messages comes in the end.
I will be greatfull for any advice!!!!!

<script language="VB" runat="server">
Public BackColor as String = "White"
Public UserName as String
Public Password as String

public sub Submit(obj as object, e as eventArgs)
lblMessage.Text ="Username: <b>" & User.Text & "</b><br>" & "Password:
<b>" & Pass.Text & "</b><p>"

end sub
</script>

<table style="background-color:<%=BackColor%>;
font:10pt verdena; border-width:1 ;border-style:solid;
border-color:black;"
cellspacing=15>
<tr>
<td><b>Login: </b></td>
<td><ASP:TextBox id="User" runat="server"/></td>
</tr>
<tr>
<td><b>Password: </b></td>
<td><ASP:TextBox id="Pass" TextMode="Password"
runat="server"/></td>
</tr>
<tr>
<td></td>
<td><ASP:Button Text="Submit" runat="server"
OnClick="Submit" /></td>
</tr>
</table>
<p>
<ASP:Label id="lblMessage" runat="server"/>
-----------------------------------------------------------------------------------------------
What my ASPX file looks like :
---------------------------------------
<%@ Page Language="VB" %>
<%@ Register TagPrefix="TYASPNET" TagName="Loginform" src="Loginform.ascx" %>

<script runat="server">
sub Page_Load(obj as object, e as eventargs)
lblMessage.Text = "Properties of the user " &
"control:<br> " &
"id: " & loginform1.id & "<br>" &
"BackColor: " & Loginform1.BackColor & "<br>" &
"UserName: " & Loginform1.UserName & "<br>" &
"Password: " & Loginform1.Password
end sub
</script>

<html><head><title>Brukerkontroll</title></head><body>
<form runat="server">
<TYASPNET:Loginform id="Loginform1" runat="server"
Password="MyPassword"
Username="AC"
BackColor="Beige">
</form>
<p>
<asp:Label id="lblMessage" runat="server" />



<a href="../../index.html" target="_self">Tilbake</a><br>
</body>
</html>
----------------------------------------------------------------------------------------------
And finaly one of the &%¤#" #!?&¤%@£ messages:
--------------------------------------------------------------
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Type 'ASP.loginform_ascx' does not have a property
named 'asp:Label'.

Source Error:


Line 21: </form>
Line 22:
Line 23: <asp:Label id="lblMessage" runat="server" />
Line 24:
Line 25:


Source File: c:\inetpub\wwwroot\21dager\Oppgaver\Dag456\brukerkontroll2.aspx
Line: 23

Thank you for your time.
Sincerely
AL Cs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top