|
|
 |
RE: FN-FORUM: .NET Newbie Q
date posted 21st July 2005 07:59
Thanks for the replies guys.
So are you saying (Wayne) that for every type of web form control I want to
use I need to add it's reference explicitly in the top of every "code
behind" page? It seems odd when if there's a mixture of labels in the same
function, some to controls dragged into the designer and some put in my hand
coding, the dragged ones work and the hand coded ones don't. The syntax I'm
using is correct. If I then replace a hand coded control with a dragged in
one then it all works.
The error I get (Andy) is 'Name "newlabelname" is not declared'.
I'll look up "system.reflection" to see what you're talking about.
Another annoyance is, there seems to be no way to control the case of inline
style attributes, they're ALWAYS capitalised whether you like it or not. Do
you just live with that?
As far as .NET 2.0 is concerned, that's far too near the bleeding edge of
technology for me. I thought VS 2003 would be bedded down enough by now and
have sufficient support to get me going quickly. I'm doing this for
production purposes, not for fun or to satisfy masochistic tendencies, lol.
Cheers,
Craig
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of wayne
Sent: 21 July 2005 06:55
To: FN-FORUM / [EMAIL REMOVED]
Subject: RE: FN-FORUM: .NET Newbie Q
Hi Mate
This should happen automagically as the wonders of system.reflection
works its thang. You should be declaring it in the code behind with:
Protected WithEvents myLabel As System.Web.UI.WebControls.Label
Notice the WithEvents
Also ensure you are using the Label from the Web Forms toolbox and not
the HTML toolbox as they are different ie one uses the runat="server"
declaration in the HTML, the other doesn't.
HTH
w
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of Damon
Sent: 21 July 2005 00:43
To: wayne
Subject: RE: FN-FORUM: .NET Newbie Q
You should be able to edit it with no problem, because that's what I
have
been doing for years
When I reference it I use
protected System.Web.UI.WebControls.Label lblname; (for example)
From that point onwards it is accessible
You could always switch to .Net 2.0, no need to reference controls on
your
form, they are all accessible in the code
Damon
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of Craig
Sent: 21 July 2005 00:32
To: FN-FORUM / [EMAIL REMOVED]
Subject: FN-FORUM: .NET Newbie Q
Hi,
A Visual Studio.NET question...
If I drag a label web form control on to the design surface then go to
the
"code behind" page I can programme it and all is well. However, if I
add
one in the HTML screen and then add references to it in the "code
behind"
page I get errors. Is VS doing things that aren't apparent in Designer
mode
or is there a way to get it done by hand and it work properly?
I'm getting a bit frustrated with the designer, I have more control by
hand
coding, hence the question.
Thanks in advance,
Craig
|
 |
|