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

hyphen in hyperlink causing unwanted break in text line

I have a template field that contains filenames that are (or can be) on a
unix system. The hypen (and others) is a valid filename character in unix.
When I display the name of the file I get an unwanted break and the text
wraps at the hyphen.

NavigateUrl bound to Eval("file_name","//acqlib/data/{0:c}") launches the
file just fine since there is nothing wrong with the '-' on the linux system
which is the acqlib server.

But binding "Text" as in
Eval("file_name","{0:c}") causes 3-4 rows to be displayed in the hyperlink
shown in the gridview. I assume this is because the hypen is interpreted as
a line break???

Is there a way to fix this in the IDE using Eval? I managed to get it
working using the RowDataBound callback as in ...

hl = (HyperLink)e.Row.Cells[idFilename].FindControl("hl4filename");
hl.Text = e.Row.Cells[idFilename].Text.ToString()..Replace('-','_')

Maybe there is a better way that does not involve interpreting any
characters such as '-'?

Oct 24 '07 #1
3 3980
Joe Stateson wrote:
But binding "Text" as in
Eval("file_name","{0:c}") causes 3-4 rows to be displayed in the
hyperlink shown in the gridview. I assume this is because the hypen is
interpreted as a line break???
No, it's because the hyphen is interpreted as a hyphen. A line break is
allowed after a hyphen, just as with a space.

--
Göran Andersson
_____
http://www.guffa.com
Oct 24 '07 #2
My recommendation would be to use the CSS property white-space, as in the
following:

<a style="white-space:nowrap;">testing-testing</a>

I tested this in IE (it should work the same in other browsers since it's
CSS, but you never know) by including the following in my HTML file:

<div style="width:10px;"><a
style="white-space:nowrap;">testing-testing</a></div>

Notice that the div has a specified width of 10px, which would normally
cause the text to wrap, but because of the white-space:nowrap; CSS property
it is prevented from wrapping. You can test this out by removing the
white-space:nowrap; from the style attribute. Hopefully this helps.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Joe Stateson" <js*******@swri.eduwrote in message
news:13*************@corp.supernews.com...
>I have a template field that contains filenames that are (or can be) on a
unix system. The hypen (and others) is a valid filename character in unix.
When I display the name of the file I get an unwanted break and the text
wraps at the hyphen.

NavigateUrl bound to Eval("file_name","//acqlib/data/{0:c}") launches the
file just fine since there is nothing wrong with the '-' on the linux
system which is the acqlib server.

But binding "Text" as in
Eval("file_name","{0:c}") causes 3-4 rows to be displayed in the hyperlink
shown in the gridview. I assume this is because the hypen is interpreted
as a line break???

Is there a way to fix this in the IDE using Eval? I managed to get it
working using the RowDataBound callback as in ...

hl = (HyperLink)e.Row.Cells[idFilename].FindControl("hl4filename");
hl.Text = e.Row.Cells[idFilename].Text.ToString()..Replace('-','_')

Maybe there is a better way that does not involve interpreting any
characters such as '-'?

Oct 25 '07 #3

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
My recommendation would be to use the CSS property white-space, as in the
following:

<a style="white-space:nowrap;">testing-testing</a>

I tested this in IE (it should work the same in other browsers since it's
CSS, but you never know) by including the following in my HTML file:

<div style="width:10px;"><a
style="white-space:nowrap;">testing-testing</a></div>

Notice that the div has a specified width of 10px, which would normally
cause the text to wrap, but because of the white-space:nowrap; CSS
property it is prevented from wrapping. You can test this out by removing
the white-space:nowrap; from the style attribute. Hopefully this helps.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Thanks Nathan, that worked when I put it in the style for the hyperlink. I
first tried it on the table that the hyperlinks are in but it had to be
specified on the hyperlink style itself. I did not realize that a dash was
treated the same as white space.


Oct 25 '07 #4

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

Similar topics

2
by: MrMike | last post by:
I have an ASP.NET web form that I'm developing, and I'm running into a problem with my below code. Business rules aside, is there anything noticably wrong with this syntax? This syntax is being...
27
by: The Bicycling Guitarist | last post by:
Hi. I found the following when trying to learn if there is such a thing as a non-breaking hyphen. Apparently Unicode has a ‑ but that is not well-supported, especially in older browsers. Somebody...
2
by: Max | last post by:
I'm reading some files in a directory using php code for the end result of allowing these files to be deleted. The problem is some of the file names have hyphens in them, and this cannot be...
22
by: stevenkobes | last post by:
If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won't. Apparently the Firefox behavior is standards-compliant, but it is not what I want. Is there a...
1
by: Mark | last post by:
Ok this is very odd. I have a hyperlink server control (not a linkbutton) on my .aspx page. When the navigateurl property is set to a file (blah.aspx) in the same directory as the current page,...
1
by: D A H | last post by:
I have gotten the same exception in multiple projects. I have solved the underlying problem. My question is if anyone knew of a setting that would cause this exception to be thrown. A...
4
by: Rubin | last post by:
1) I want to show a breaking hyphen in Mozilla 1.5.0.4 How do I do that? "Unicode standard annex #14", <http://www.unicode.org/reports/tr14/>, defines 4 breaking hyphens. <quote> Breaking...
10
by: Tim | last post by:
hi all, I have searched for this, yet with no joy. I have the word e-commerce in an html sentence. The hyphen allows the commerce part to wrap to a new line. Yuck. Is there a no break...
3
by: Dominique | last post by:
Hello, I tried: <aw:HyperLink runat="server" id="hlQueuedCount" labelposition="top" labelwidth="30" command="runQuery" /> as if I use the parameter width it just affect the result of the query...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.