|
Hello all,
I have ASP.NET label controls tied to a datasource (so
text will vary in length depending on the record). In IE
everything looks great--text is wrapped if needed. In
Netscape and Opera, the text extends horizontally and does
not wrap.
Any ideas would be most appreciated!
Thanks,
Mike | |
Share:
|
Have you set the width of the label? Labels render as SPAN tags in the
resulting HTML and if you have specified a width, that will appear as an
inline style attribute of the SPAN tag. If this does not work in a browser,
then that browser does not support CSS.
"Mike Casey" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl... Hello all, I have ASP.NET label controls tied to a datasource (so text will vary in length depending on the record). In IE everything looks great--text is wrapped if needed. In Netscape and Opera, the text extends horizontally and does not wrap.
Any ideas would be most appreciated!
Thanks, Mike | | |
Thanks! I specify the width and height directly in the
HTML view of the page. I've noticed that making this
change within the "Style" parameters (HEIGHT: 42px; WIDTH:
100px;) works temporarily. However after recompiling the
application, the height and width attributes appear again
outside the Style tag (I assume this is because they are
set in the property window / Design view of the server
control).
I'm thinking of removing them from the properties window
and also resorting to a pure HTML control rather than a
server-based Web control, but I'm struggling with why I
have to do this.
Thanks again!
Mike -----Original Message----- Have you set the width of the label? Labels render as
SPAN tags in theresulting HTML and if you have specified a width, that
will appear as aninline style attribute of the SPAN tag. If this does not
work in a browser,then that browser does not support CSS.
"Mike Casey" <an*******@discussions.microsoft.com> wrote
in messagenews:01****************************@phx.gbl... Hello all, I have ASP.NET label controls tied to a datasource (so text will vary in length depending on the record). In
IE everything looks great--text is wrapped if needed. In Netscape and Opera, the text extends horizontally and
does not wrap.
Any ideas would be most appreciated!
Thanks, Mike
. | | |
"Mike Casey" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl... Thanks! I specify the width and height directly in the HTML view of the page. I've noticed that making this change within the "Style" parameters (HEIGHT: 42px; WIDTH: 100px;) works temporarily. However after recompiling the application, the height and width attributes appear again outside the Style tag (I assume this is because they are set in the property window / Design view of the server control).
Not sure what you mean here. You can easily just set the width of the label
in the properties window while the page is open in design view. There's no
need to code it yourself in the HTML view.
I'm thinking of removing them from the properties window and also resorting to a pure HTML control rather than a server-based Web control, but I'm struggling with why I have to do this.
Thanks again! Mike-----Original Message----- Have you set the width of the label? Labels render as SPAN tags in theresulting HTML and if you have specified a width, that will appear as aninline style attribute of the SPAN tag. If this does not work in a browser,then that browser does not support CSS.
"Mike Casey" <an*******@discussions.microsoft.com> wrote in messagenews:01****************************@phx.gbl... Hello all, I have ASP.NET label controls tied to a datasource (so text will vary in length depending on the record). In IE everything looks great--text is wrapped if needed. In Netscape and Opera, the text extends horizontally and does not wrap.
Any ideas would be most appreciated!
Thanks, Mike
. | | |
I'm thinking there might be a reason in this case. If you
make changes in the properties window, the Width and
Height parameters appear by themselves in HTML, outside of
the Style tag. I'm thinking that some browsers might not
recognize these values unless they are within the Style
tag. Maybe? -----Original Message-----
"Mike Casey" <an*******@discussions.microsoft.com> wrote
in messagenews:07****************************@phx.gbl... Thanks! I specify the width and height directly in the HTML view of the page. I've noticed that making this change within the "Style" parameters (HEIGHT: 42px;
WIDTH: 100px;) works temporarily. However after recompiling
the application, the height and width attributes appear
again outside the Style tag (I assume this is because they are set in the property window / Design view of the server control).
Not sure what you mean here. You can easily just set the
width of the labelin the properties window while the page is open in design
view. There's noneed to code it yourself in the HTML view.
I'm thinking of removing them from the properties window and also resorting to a pure HTML control rather than a server-based Web control, but I'm struggling with why I have to do this.
Thanks again! Mike >-----Original Message----- >Have you set the width of the label? Labels render as SPAN tags in the >resulting HTML and if you have specified a width, that will appear as an >inline style attribute of the SPAN tag. If this does
not work in a browser, >then that browser does not support CSS. > > >"Mike Casey" <an*******@discussions.microsoft.com>
wrote in message >news:01****************************@phx.gbl... >> Hello all, >> I have ASP.NET label controls tied to a datasource
(so >> text will vary in length depending on the record).
In IE >> everything looks great--text is wrapped if needed.
In >> Netscape and Opera, the text extends horizontally and does >> not wrap. >> >> Any ideas would be most appreciated! >> >> Thanks, >> Mike > > >. >
. | | |
I'm not sure you are following my instructions or you may have a problem
with your VS installation.
If I put a label on a webform and then change its height and width
properties in the property window and then run the project, I get the
following HTML sent to my client:
<span id="Label1" style="height:75px;width:100px">Label</span>
Note that the height and width are attribute values for the style attribute
of the span tag. This is the correct behavior. I'm not sure what you mean
by the parameters appearing by themselves in HTML outside of the style tag,
but if you are not getting the same results as I'm showing above, then
something is wrong.
"Mike Casey" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl... I'm thinking there might be a reason in this case. If you make changes in the properties window, the Width and Height parameters appear by themselves in HTML, outside of the Style tag. I'm thinking that some browsers might not recognize these values unless they are within the Style tag. Maybe?-----Original Message-----
"Mike Casey" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl... Thanks! I specify the width and height directly in the HTML view of the page. I've noticed that making this change within the "Style" parameters (HEIGHT: 42px; WIDTH: 100px;) works temporarily. However after recompiling the application, the height and width attributes appear again outside the Style tag (I assume this is because they are set in the property window / Design view of the server control).
Not sure what you mean here. You can easily just set the width of the labelin the properties window while the page is open in design view. There's noneed to code it yourself in the HTML view.
I'm thinking of removing them from the properties window and also resorting to a pure HTML control rather than a server-based Web control, but I'm struggling with why I have to do this.
Thanks again! Mike >-----Original Message----- >Have you set the width of the label? Labels render as SPAN tags in the >resulting HTML and if you have specified a width, that will appear as an >inline style attribute of the SPAN tag. If this does not work in a browser, >then that browser does not support CSS. > > >"Mike Casey" <an*******@discussions.microsoft.com> wrote in message >news:01****************************@phx.gbl... >> Hello all, >> I have ASP.NET label controls tied to a datasource (so >> text will vary in length depending on the record). In IE >> everything looks great--text is wrapped if needed. In >> Netscape and Opera, the text extends horizontally and does >> not wrap. >> >> Any ideas would be most appreciated! >> >> Thanks, >> Mike > > >. >
. | | |
AH...actually that is the HTML label you are adding,
right? If I add the Web Forms Label control, the tags are
handled differently... -----Original Message----- I'm not sure you are following my instructions or you may
have a problemwith your VS installation.
If I put a label on a webform and then change its height
and widthproperties in the property window and then run the
project, I get thefollowing HTML sent to my client:
<span id="Label1"
style="height:75px;width:100px">Label</span> Note that the height and width are attribute values for
the style attributeof the span tag. This is the correct behavior. I'm not
sure what you meanby the parameters appearing by themselves in HTML outside
of the style tag,but if you are not getting the same results as I'm
showing above, thensomething is wrong.
"Mike Casey" <an*******@discussions.microsoft.com> wrote
in messagenews:08****************************@phx.gbl... I'm thinking there might be a reason in this case. If
you make changes in the properties window, the Width and Height parameters appear by themselves in HTML, outside
of the Style tag. I'm thinking that some browsers might
not recognize these values unless they are within the Style tag. Maybe? >-----Original Message----- > >"Mike Casey" <an*******@discussions.microsoft.com>
wrote in message >news:07****************************@phx.gbl... >> Thanks! I specify the width and height directly in
the >> HTML view of the page. I've noticed that making this >> change within the "Style" parameters (HEIGHT: 42px; WIDTH: >> 100px;) works temporarily. However after recompiling the >> application, the height and width attributes appear again >> outside the Style tag (I assume this is because they
are >> set in the property window / Design view of the
server >> control). >> > >Not sure what you mean here. You can easily just set
the width of the label >in the properties window while the page is open in
design view. There's no >need to code it yourself in the HTML view. > > >> I'm thinking of removing them from the properties
window >> and also resorting to a pure HTML control rather
than a >> server-based Web control, but I'm struggling with
why I >> have to do this. >> >> Thanks again! >> Mike >> >-----Original Message----- >> >Have you set the width of the label? Labels render
as >> SPAN tags in the >> >resulting HTML and if you have specified a width,
that >> will appear as an >> >inline style attribute of the SPAN tag. If this
does not >> work in a browser, >> >then that browser does not support CSS. >> > >> > >> >"Mike Casey" <an*******@discussions.microsoft.com> wrote >> in message >> >news:01****************************@phx.gbl... >> >> Hello all, >> >> I have ASP.NET label controls tied to a datasource (so >> >> text will vary in length depending on the record). In >> IE >> >> everything looks great--text is wrapped if needed. In >> >> Netscape and Opera, the text extends horizontally
and >> does >> >> not wrap. >> >> >> >> Any ideas would be most appreciated! >> >> >> >> Thanks, >> >> Mike >> > >> > >> >. >> > > > >. >
. | | |
No, that is the Web Form Label (System.Web.UI.WebControls.Label).
All web form controls render in the client as HTML, so the web form label
control renders as a span tag. Any modifications to the look/feel/position
of the label in the properties window render as style attribute values to
the span tag.
Let's see what HTML you are getting in your browser if you use a web form
label.
"Mike Casey" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl... AH...actually that is the HTML label you are adding, right? If I add the Web Forms Label control, the tags are handled differently...-----Original Message----- I'm not sure you are following my instructions or you may have a problemwith your VS installation.
If I put a label on a webform and then change its height and widthproperties in the property window and then run the project, I get thefollowing HTML sent to my client:
<span id="Label1" style="height:75px;width:100px">Label</span> Note that the height and width are attribute values for
the style attributeof the span tag. This is the correct behavior. I'm not sure what you meanby the parameters appearing by themselves in HTML outside of the style tag,but if you are not getting the same results as I'm showing above, thensomething is wrong.
"Mike Casey" <an*******@discussions.microsoft.com> wrote in messagenews:08****************************@phx.gbl... I'm thinking there might be a reason in this case. If you make changes in the properties window, the Width and Height parameters appear by themselves in HTML, outside of the Style tag. I'm thinking that some browsers might not recognize these values unless they are within the Style tag. Maybe? >-----Original Message----- > >"Mike Casey" <an*******@discussions.microsoft.com> wrote in message >news:07****************************@phx.gbl... >> Thanks! I specify the width and height directly in the >> HTML view of the page. I've noticed that making this >> change within the "Style" parameters (HEIGHT: 42px; WIDTH: >> 100px;) works temporarily. However after recompiling the >> application, the height and width attributes appear again >> outside the Style tag (I assume this is because they are >> set in the property window / Design view of the server >> control). >> > >Not sure what you mean here. You can easily just set the width of the label >in the properties window while the page is open in design view. There's no >need to code it yourself in the HTML view. > > >> I'm thinking of removing them from the properties window >> and also resorting to a pure HTML control rather than a >> server-based Web control, but I'm struggling with why I >> have to do this. >> >> Thanks again! >> Mike >> >-----Original Message----- >> >Have you set the width of the label? Labels render as >> SPAN tags in the >> >resulting HTML and if you have specified a width, that >> will appear as an >> >inline style attribute of the SPAN tag. If this does not >> work in a browser, >> >then that browser does not support CSS. >> > >> > >> >"Mike Casey" <an*******@discussions.microsoft.com> wrote >> in message >> >news:01****************************@phx.gbl... >> >> Hello all, >> >> I have ASP.NET label controls tied to a datasource (so >> >> text will vary in length depending on the record). In >> IE >> >> everything looks great--text is wrapped if needed. In >> >> Netscape and Opera, the text extends horizontally and >> does >> >> not wrap. >> >> >> >> Any ideas would be most appreciated! >> >> >> >> Thanks, >> >> Mike >> > >> > >> >. >> > > > >. >
. | | This discussion thread is closed Replies have been disabled for this discussion. Similar topics
4 posts
views
Thread by abc |
last post: by
|
2 posts
views
Thread by John Baro |
last post: by
|
4 posts
views
Thread by Richard MSL |
last post: by
|
1 post
views
Thread by mg |
last post: by
|
2 posts
views
Thread by David |
last post: by
|
12 posts
views
Thread by vbnewbie |
last post: by
|
4 posts
views
Thread by ckirchho@directmedia.de |
last post: by
|
11 posts
views
Thread by Peter Larsen [] |
last post: by
|
5 posts
views
Thread by gerry |
last post: by
| | | | | | | | | | | |