473,803 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Ro w.Cells[idFilename].FindControl("h l4filename");
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 4004
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:10 px;"><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********@hotm ail.com
http://www.nathansokalski.com/

"Joe Stateson" <js*******@swri .eduwrote in message
news:13******** *****@corp.supe rnews.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.Ro w.Cells[idFilename].FindControl("h l4filename");
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********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP05.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:10 px;"><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********@hotm ail.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
2548
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 used to create a hyperlink in a template column of a datagrid. In the designer, once I implement this code the word "Databound" appears in the column, but when I display the page in browser it errors out on this line. Thanks. <asp:HyperLink...
27
31430
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 somewhere said: Alternately, you can use CSS to declare a class having: ..nowrap { white-space:nowrap } .... and then wrap the compound word in a <span class=nowrap></span> tag (or any other suitable inline tag). You can also try {...
2
3241
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 changed. The php code prints each file name on a page and has a delete link for each seperate file. I pass the name of the file via a variable using onclick to a javascript confirm function when the delete link is clicked on. But when the...
22
8019
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 way to denote a hyphen in HTML, that the line can be broken after? I've read some stuff about soft hyphens and non-breaking hyphens, but those seem like the opposite of what I'm looking for. I want a normal hyphen, that always appears, and I...
1
6964
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, the page posts back BEFORE redirecting to the next page. If I change the navigateurl property to go to a page in a subfolder (foo\bar.aspx) it does not do a postback. I swear I'm not messing with it - I did the experiment 3 times in a row ......
1
1899
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 codeveloper on the same project can get a copy of the project from VSS and does not get this exception, ever. I do. We both have the code that causes this exception to be thrown. We do NOT checkin our
4
4559
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 hyphens establish explicit break opportunities immediately after each occurrence.
10
13617
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 hyphen, in the same way as a no break space?
3
1412
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 displayed by hlQueuedCount I wanted to try on the Label itself... with a parameter labelwidth but it does not seems to do anything... Any idea what will be the parameter for the hyperlink label which is
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10546
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.