473,387 Members | 1,464 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,387 software developers and data experts.

Label control question

I need to use a label control that depending on the page where the control is
use sets the control into a sort of edit mode. That is, I need to use a label
that sometimes I can type text to. Can this be done? or Is there another
control I can use to accomplish this (web control or HTML)?

HS
Nov 19 '05 #1
6 1062
I did something like this some time ago. What I did was to create a
usercontrol that wrapped both a label and textbox control. My usercontrol
had similar properties such as Text which would be used to interact with the
contents. I also had properties such as Readonly which would determine the
state.

Depending on the state of Readonly, the label or textbox would be visible.

"hecsan07" <he******@hotmail.com> wrote in message
news:79**********************************@microsof t.com...
I need to use a label control that depending on the page where the control is use sets the control into a sort of edit mode. That is, I need to use a label that sometimes I can type text to. Can this be done? or Is there another
control I can use to accomplish this (web control or HTML)?

HS

Nov 19 '05 #2
How about a textarea (multi-line TextBox)?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"hecsan07" <he******@hotmail.com> wrote in message
news:79**********************************@microsof t.com...
I need to use a label control that depending on the page where the control
is
use sets the control into a sort of edit mode. That is, I need to use a
label
that sometimes I can type text to. Can this be done? or Is there another
control I can use to accomplish this (web control or HTML)?

HS

Nov 19 '05 #3
Can you not just use a textbox control and set it's enabled property to true
or false depending on the page it is in?

"hecsan07" <he******@hotmail.com> wrote in message
news:79**********************************@microsof t.com...
I need to use a label control that depending on the page where the control
is
use sets the control into a sort of edit mode. That is, I need to use a
label
that sometimes I can type text to. Can this be done? or Is there another
control I can use to accomplish this (web control or HTML)?

HS

Nov 19 '05 #4
Setting a TextBox property to enable and/or disable and setting to
visible/not visible is not supported by all web browsers.
While your input was great and appreciated, I think I'll simply stick to
using an HTML input control and setting its property to readonly when needed.

HS

"Steven Licciardi" wrote:
Can you not just use a textbox control and set it's enabled property to true
or false depending on the page it is in?

"hecsan07" <he******@hotmail.com> wrote in message
news:79**********************************@microsof t.com...
I need to use a label control that depending on the page where the control
is
use sets the control into a sort of edit mode. That is, I need to use a
label
that sometimes I can type text to. Can this be done? or Is there another
control I can use to accomplish this (web control or HTML)?

HS


Nov 19 '05 #5
Spoke too soon. My great plan turned out to be a fluke. The readonly property
is not available to change at run time.
Can you please elaborate on your user control? How did it work?

HS

"Steven Licciardi" wrote:
Can you not just use a textbox control and set it's enabled property to true
or false depending on the page it is in?

"hecsan07" <he******@hotmail.com> wrote in message
news:79**********************************@microsof t.com...
I need to use a label control that depending on the page where the control
is
use sets the control into a sort of edit mode. That is, I need to use a
label
that sometimes I can type text to. Can this be done? or Is there another
control I can use to accomplish this (web control or HTML)?

HS


Nov 19 '05 #6
Actually, it worked. nstead of using the readonly property of the control
(for which there is not runtime counter part), I used the Disable property.
Thanks for your input, nevertheles.

HS

"hecsan07" wrote:
Setting a TextBox property to enable and/or disable and setting to
visible/not visible is not supported by all web browsers.
While your input was great and appreciated, I think I'll simply stick to
using an HTML input control and setting its property to readonly when needed.

HS

"Steven Licciardi" wrote:
Can you not just use a textbox control and set it's enabled property to true
or false depending on the page it is in?

"hecsan07" <he******@hotmail.com> wrote in message
news:79**********************************@microsof t.com...
I need to use a label control that depending on the page where the control
is
use sets the control into a sort of edit mode. That is, I need to use a
label
that sometimes I can type text to. Can this be done? or Is there another
control I can use to accomplish this (web control or HTML)?

HS


Nov 19 '05 #7

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

Similar topics

6
by: thejackofall | last post by:
I added a label server control in my aspx file. In the code behind, the IDE does not generate the corresponding object like it does with buttons and other objects. What am I doing wrong? Is...
3
by: Patrick.O.Ige | last post by:
I created a USERCONTROL and i want to call a LABEL from an ASPX page. The USERCONTROL is in the ASPX page I have the label :- Label lblstr = new Label(); And displaying using:-...
6
by: Joe | last post by:
I know that the Literal control will not render a <span> tag so I can not format its text. Other than this, what is the difference betwen the Literal control and the LiteralControl Control? How...
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
6
by: jcrouse | last post by:
I am rotating some text is some label controls. In the one place I use it it works fine. In the other place I use it I can't figure out the syntax. I don't really understand the event. Where it...
7
by: Joe | last post by:
I have a label control that will be filled with text at runtime. The length of the text will vary, but the label must stay the same size. Is there a way to set the font size of the text such that...
2
by: rn5a | last post by:
Consider the following code: <script runat="server"> Sub ShowData(obj As Object, ea As EventArgs) lblDate.Text = DateTime.Now.ToString("d") lblDate.DataBind() End Sub </script> <form...
3
by: John Heitmuller. | last post by:
Hi, I just want to make sure I'm not missing something obvious. VB.Net controls like the CheckBox are implemented with a label attached to it. This is very handy. But the TextBox control has no...
11
by: Peter Larsen [] | last post by:
Hi, I have two questions related to the Label control. How do i prevent the label from expand the canvas into 2 lines (word wrap) ?? At the moment i set AutoSize to false (to prevent the word...
0
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,...
0
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$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
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...

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.