Hello,
I'm doing the lessons out of a Sams ASP.net book and have copied the
following verbatim, out of the book (without the beginning and ending
quotes);
"'<%@ 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"
The lblMessage control is part of the LoginForm user control.
I've reviewed the code in the book and can't figure out what's wrong.
I'll cut and paste both pages of code in their entirety below.
Thanks!
Jo
"<script language=vb runat=server>
Public Backcolor as string="white"
public UserName as string
Public Password as string
LoginForm.ascx = the following;
"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 verdana;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 /></p>"
LoginMaster.aspx = the following
<%@ 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>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<tyaspnet:LoginForm id=LoginForm1 runat=server
password=MyPassword
UserName=Chris
BackColor=Beige/>
</form>
</body>
</html> 4 1400
You didnt say what problem you had, just that it did not work.
--
Terry Burns http://TrainingOn.net
"Jozef" <NO****@NOSPAM.com> wrote in message
news:qvane.1531473$8l.1364647@pd7tw1no... Hello,
I'm doing the lessons out of a Sams ASP.net book and have copied the following verbatim, out of the book (without the beginning and ending quotes);
"'<%@ 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"
The lblMessage control is part of the LoginForm user control.
I've reviewed the code in the book and can't figure out what's wrong.
I'll cut and paste both pages of code in their entirety below.
Thanks! Jo "<script language=vb runat=server> Public Backcolor as string="white" public UserName as string Public Password as string
LoginForm.ascx = the following;
"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 verdana;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 /></p>"
LoginMaster.aspx = the following
<%@ 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> <body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server"> <tyaspnet:LoginForm id=LoginForm1 runat=server password=MyPassword UserName=Chris BackColor=Beige/> </form>
</body> </html>
Woops! Sorry, thanks for pointing that out. Here is the error;
Compiler Error Message: BC30451: Name 'lblMessage' is not declared.
Source Error:
Line 3: <script runat=server>
Line 4: Sub Page_Load(obj as object,e as eventargs)
Line 5: lblMessage.Text = "Properties of the user " & _
Line 6: "control:<br> " & _
Line 7: "id: " & LoginForm1.id & "<br>" & _
Jo
"Terry Burns" <he**@now.com> wrote in message
news:OT**************@TK2MSFTNGP14.phx.gbl... You didnt say what problem you had, just that it did not work.
-- Terry Burns http://TrainingOn.net
"Jozef" <NO****@NOSPAM.com> wrote in message news:qvane.1531473$8l.1364647@pd7tw1no... Hello,
I'm doing the lessons out of a Sams ASP.net book and have copied the following verbatim, out of the book (without the beginning and ending quotes);
"'<%@ 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"
The lblMessage control is part of the LoginForm user control.
I've reviewed the code in the book and can't figure out what's wrong.
I'll cut and paste both pages of code in their entirety below.
Thanks! Jo "<script language=vb runat=server> Public Backcolor as string="white" public UserName as string Public Password as string
LoginForm.ascx = the following;
"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 verdana;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 /></p>"
LoginMaster.aspx = the following
<%@ 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> <body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server"> <tyaspnet:LoginForm id=LoginForm1 runat=server password=MyPassword UserName=Chris BackColor=Beige/> </form>
</body> </html>
The complete example is posted at : http://asp1.ccac.edu/cit235/ew00/web.../userctrl.html
Check your code against that source code
and see if there's anything you missed.
Juan T. Llibre
ASP.NET MVP http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"Jozef" <NO****@NOSPAM.com> wrote in message news:5tine.1534181$8l.393161@pd7tw1no... Woops! Sorry, thanks for pointing that out. Here is the error; Compiler Error Message: BC30451: Name 'lblMessage' is not declared.
Source Error:
Line 3: <script runat=server> Line 4: Sub Page_Load(obj as object,e as eventargs) Line 5: lblMessage.Text = "Properties of the user " & _ Line 6: "control:<br> " & _ Line 7: "id: " & LoginForm1.id & "<br>" & _
Jo "Terry Burns" <he**@now.com> wrote in message news:OT**************@TK2MSFTNGP14.phx.gbl... You didnt say what problem you had, just that it did not work.
-- Terry Burns http://TrainingOn.net
"Jozef" <NO****@NOSPAM.com> wrote in message news:qvane.1531473$8l.1364647@pd7tw1no... Hello,
I'm doing the lessons out of a Sams ASP.net book and have copied the following verbatim, out of the book (without the beginning and ending quotes);
"'<%@ 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"
The lblMessage control is part of the LoginForm user control.
I've reviewed the code in the book and can't figure out what's wrong.
I'll cut and paste both pages of code in their entirety below.
Thanks! Jo "<script language=vb runat=server> Public Backcolor as string="white" public UserName as string Public Password as string
LoginForm.ascx = the following;
"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 verdana;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 /></p>"
LoginMaster.aspx = the following
<%@ 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> <body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server"> <tyaspnet:LoginForm id=LoginForm1 runat=server password=MyPassword UserName=Chris BackColor=Beige/> </form>
</body> </html>
You probably forgot to change the name of the label to lblMessage. To do
this open your web form in designer and select the label, in the properties
for this control, go to the ID and make sure its lblMessage ( 1's can look
just like l's ( L's ) ) you didnt use a 1 did you >?
HTH
--
Terry Burns http://TrainingOn.net
"Jozef" <NO****@NOSPAM.com> wrote in message
news:5tine.1534181$8l.393161@pd7tw1no... Woops! Sorry, thanks for pointing that out. Here is the error; Compiler Error Message: BC30451: Name 'lblMessage' is not declared. . Source Error:
Line 3: <script runat=server> Line 4: Sub Page_Load(obj as object,e as eventargs) Line 5: lblMessage.Text = "Properties of the user " & _ Line 6: "control:<br> " & _ Line 7: "id: " & LoginForm1.id & "<br>" & _
Jo "Terry Burns" <he**@now.com> wrote in message news:OT**************@TK2MSFTNGP14.phx.gbl... You didnt say what problem you had, just that it did not work.
-- Terry Burns http://TrainingOn.net
"Jozef" <NO****@NOSPAM.com> wrote in message news:qvane.1531473$8l.1364647@pd7tw1no... Hello,
I'm doing the lessons out of a Sams ASP.net book and have copied the following verbatim, out of the book (without the beginning and ending quotes);
"'<%@ 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"
The lblMessage control is part of the LoginForm user control.
I've reviewed the code in the book and can't figure out what's wrong.
I'll cut and paste both pages of code in their entirety below.
Thanks! Jo "<script language=vb runat=server> Public Backcolor as string="white" public UserName as string Public Password as string
LoginForm.ascx = the following;
"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 verdana;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 /></p>"
LoginMaster.aspx = the following
<%@ 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> <body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server"> <tyaspnet:LoginForm id=LoginForm1 runat=server password=MyPassword UserName=Chris BackColor=Beige/> </form>
</body> </html>
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: fdsl ysnh |
last post by:
--- python-list-request@python.orgдµÀ:
> Send Python-list mailing list submissions to
> python-list@python.org
>
> To subscribe or unsubscribe via the World Wide Web,
> visit
>...
|
by: Hai Nguyen |
last post by:
I have another question. I'm trying to loop through all the textboxes on a
web application. The snippet is below
//foreach(WebControl ctr in Page.Controls)
foreach(Control ctr in Page.Controls)...
|
by: hqdtech |
last post by:
how to refresh webform from other webform
I have 2 webform, i want if webform A was close then webform B wil
refresh.
And the problem second:
how to catch packet on the network in C#.
...
|
by: Jerry |
last post by:
I am using .Net 2003. I have been working with this
ASP.Net webform that I created a few weeks ago. It has
been working fine.
However, while modifying the webform today, this webform
stopped...
|
by: Kristof Despiere |
last post by:
Suppose you have one domain, filled with a couple of users. What needs to be
done now is I need to start a windows application from a webform by pressing
a button on the webform (for example).
...
|
by: Jeff Gaines |
last post by:
I am making the jump into Webforms/asp from Windows forms.
To ease the transition I am setting up an address book so I can use
code from the previous Windows forms app.
I have a really simple...
|
by: anthonymelillo |
last post by:
I am looking to learn more of Visual Basic .Net and was wondering if anyone
could recommend a good book ?
I have done a lot of programming on Visual Basic 6, so I would like to
crossover my...
|
by: Johnfli |
last post by:
Most of my ASP programming experience is on NT4.
We recently upgraded (replaced) our NT4 webserver with Win2k3 Web Edition.
I am looking for a good book that I can go through that will show me...
|
by: =?Utf-8?B?UGF1bA==?= |
last post by:
Hi I have start web form and when the user clicks a button (server.transfer)
they are directed to the second webform. I was wondering if there is a way
to create an instance of the first webform...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |