473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Re-using asp:label

I do some design work on a website that up until to now has been
limited to defining CSS and HTML elements. Excuse me if I am using
incorrect terminology, I am just starting out in this.

I would like to try some beginning coding and the developers are giving
me some latitude to experiment. They said that I can use INLINE VB
code.

I would like to create an ASCX file that uses some labels that are on
the parent page that that ascx file will be called from. The labels I
want to use are-

<asp:Label ID="lblQuery" Visible="False" Runat="server"></asp:Label>

<asp:Label ID="lblCategory" Visible="False" Runat="server"></asp:Label>

Can any of you lend a hand or point me to a tutorial that specifically
addresses this type of thing?

Thanks much,

RD

Nov 19 '05 #1
2 1430
RD,

I suggest trying the www.gotdotnet.com tutorials. Click the toolbox link on
the bottom left and you'll see a link to the tutorials.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
<fo**********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I do some design work on a website that up until to now has been
limited to defining CSS and HTML elements. Excuse me if I am using
incorrect terminology, I am just starting out in this.

I would like to try some beginning coding and the developers are giving
me some latitude to experiment. They said that I can use INLINE VB
code.

I would like to create an ASCX file that uses some labels that are on
the parent page that that ascx file will be called from. The labels I
want to use are-

<asp:Label ID="lblQuery" Visible="False" Runat="server"></asp:Label>

<asp:Label ID="lblCategory" Visible="False" Runat="server"></asp:Label>

Can any of you lend a hand or point me to a tutorial that specifically
addresses this type of thing?

Thanks much,

RD

Nov 19 '05 #2
You will have to create public properties on the UserControl (ASP.NET 2.0)
and manage them from the container page.
(This is a great new feature in ASP.NET 2.0) After dropping the control on a
page, the public properties are immediately available. (No need to load
control and cast it as in ASP.NET 1.1)

In the property set the label fields text directly: eg: In the ascx
public string Query
{
set { lblQuery.Text = value; }
get { return lblQuery.Text; }
}

Gerhard

<fo**********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I do some design work on a website that up until to now has been
limited to defining CSS and HTML elements. Excuse me if I am using
incorrect terminology, I am just starting out in this.

I would like to try some beginning coding and the developers are giving
me some latitude to experiment. They said that I can use INLINE VB
code.

I would like to create an ASCX file that uses some labels that are on
the parent page that that ascx file will be called from. The labels I
want to use are-

<asp:Label ID="lblQuery" Visible="False" Runat="server"></asp:Label>

<asp:Label ID="lblCategory" Visible="False" Runat="server"></asp:Label>

Can any of you lend a hand or point me to a tutorial that specifically
addresses this type of thing?

Thanks much,

RD

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Spartanicus | last post by:
Is this correct usage of <label>?: <h5><label for="sp-q"><img src="search.png" alt="Search"></label></h5> <form method="get" action="http://search.atomz.com/search/"> <div> <input name="sp-q"...
1
by: Label over bitmap display | last post by:
Hello, I hope that someone can help me. I am developing code with C# .NET to display units which are on a Serial (RS232) Network. For my display I have to use a bitmap of the item and on top...
8
by: David McDivitt | last post by:
We have a massive java application to be made ADA compliant. We want onfocus and onblur events for each text field. The best way seems to be javascript, by cycling through all the nodes recursively...
31
by: jcrouse | last post by:
Is there a quick and easy way to change the color of a label controls border from the default black to white? Thank you, John
3
by: Mike | last post by:
Need some help with passing a label to a subroutine. I have a form with lots of checkboxes. When the form loads i have a procedure that runs to lookup values and check the appropriate boxes. If the...
2
by: André Hänsel | last post by:
Hi again, I have a radio button: <p> <input id="v_yes" type="radio" name="v" value="yes" /> <label for="v_yes">Ja</label> <input id="v_no" type="radio" name="v" value="no" /> <label...
1
by: Patrick Lioi | last post by:
Label label = new Label(); label.Width = 1; label.AutoSize = true; label.Text = "A long string, requiring a width larger than 1."; //At this point, Width is still 1. What am I missing? ...
4
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I have two labels on a form. The text for these two labels is assigned at runtime. lblLeft lblRight If the text for lblLeft is wider than the default, the text runs into lblRight. How do...
2
by: Greg (codepug | last post by:
I have created a LABEL, and placed it on top of a button. When I press the button, the label disappears under the button. Is there a way to get the LABEL to stay on top of the button, or reappear...
6
by: Miro | last post by:
Is there a way to / or a mathematical formula to see if a font size is 'too big' for a label. I have a label that is docked to 'fill' a form, and I want to resize that font based on the width...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.