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

Hyperlink inside label WebControl

Hello,

How is it possible to use a hyperlink webcontrol inside a label webcontrol?

I am using resources for globalisation. Now I have a text like this:

Please click here to open that document.

"here" would be linked and should be a hyperlink webcontrol. But that is not
possible.
The other way would be to make "Please click" and "to open that document" to
labels and here to a hyperlink webcontrol.

But in other languages it would sounds crazy when translating exactly both
labels in the resource-files. So I need to integrate a hyperlink webcontrol
in a label webcontrol.

How can I solve this problem?

Thank you,

Christian
Mar 4 '06 #1
4 7471
Hi Christian,

You can put a Label like

<asp:Label id="lblID" runat="server">Please click <a href='url'
target='_blank'>here</a> to open file</asp:Label>

HTH

Elton Wang

"Christian Hofmann" wrote:
Hello,

How is it possible to use a hyperlink webcontrol inside a label webcontrol?

I am using resources for globalisation. Now I have a text like this:

Please click here to open that document.

"here" would be linked and should be a hyperlink webcontrol. But that is not
possible.
The other way would be to make "Please click" and "to open that document" to
labels and here to a hyperlink webcontrol.

But in other languages it would sounds crazy when translating exactly both
labels in the resource-files. So I need to integrate a hyperlink webcontrol
in a label webcontrol.

How can I solve this problem?

Thank you,

Christian

Mar 4 '06 #2
Hello Elton,

"Elton W" <El****@discussions.microsoft.com> schrieb im Newsbeitrag
news:93**********************************@microsof t.com...
Hi Christian,

You can put a Label like

<asp:Label id="lblID" runat="server">Please click <a href='url'
target='_blank'>here</a> to open file</asp:Label>


But I am using localization:
<asp:Label id="lblID" runat="server"
meta:resourcekey="MyResourceKey></asp:Label>

so this is not possible. Do you have an other idea?

Thank you,

Christian

Mar 4 '06 #3
Suppose in Resource you get test for the label is like

"Please click here to open file"

How about to try in lblID_PreRender event

lblID.Text = lblID.Text.Replace("here", "<a href='url'>here</a>");

Elton

"Christian Hofmann" wrote:
Hello Elton,

"Elton W" <El****@discussions.microsoft.com> schrieb im Newsbeitrag
news:93**********************************@microsof t.com...
Hi Christian,

You can put a Label like

<asp:Label id="lblID" runat="server">Please click <a href='url'
target='_blank'>here</a> to open file</asp:Label>


But I am using localization:
<asp:Label id="lblID" runat="server"
meta:resourcekey="MyResourceKey></asp:Label>

so this is not possible. Do you have an other idea?

Thank you,

Christian

Mar 4 '06 #4
Hello Elton,

"Elton W" <El****@discussions.microsoft.com> schrieb im Newsbeitrag
news:7F**********************************@microsof t.com...
Suppose in Resource you get test for the label is like

lblID.Text = lblID.Text.Replace("here", "<a href='url'>here</a>");


This is a good solution for non ressource based projects. But the designers
should choose the links and names themselves.

Maybe it is possible to inherit the label webcontrol and the hyperlink
webcontrol. To combine them into one webcontrol. But I have no figure how to
do that.

Christian
Mar 5 '06 #5

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

Similar topics

1
by: Josema | last post by:
Hi to all, i have a web custom control(webcontrol1) that has a button(button1), another webcontrol(webcontrol2) that has a label (label1), and another webcontrol (webcontrol_all). in the...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
3
by: Tom Bernsen | last post by:
This should be simple, I did it with a datagrid easily enough. Using VS Net 1.1, I want a label over the datagrid and a hyperlink below it (from WebForms toolbox), with BOTH of them centered (text...
3
by: MrMike | last post by:
I have the following hyperlink webcontrol. The problem is that I can't figure out how to pass the webform's Request.Querystring("id") param into the NavigateURL as shown below. As it is currently...
3
by: Christian Filzwieser | last post by:
Hy I created a WebControl called StatusBar with a static function public static void SetText(string text) { MyVariable = Text } and on Page Load I set MyVariable to the Label in my WebControl....
9
by: Leon | last post by:
What Am I Doing Wrong? Code Will Not Run, I Can't See The Error! Thanks. <asp:datalist id="DataList1" runat="server" RepeatColumns="4"> <ItemTemplate> <asp:HyperLink id=HyperLink1 ImageUrl=...
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
3
by: Nathan Sokalski | last post by:
I am using the ImageUrl property of the HyperLink control. My image is large, so I am setting the width/height attributes, but when it renders the width/height attributes are in the <atag rather...
1
by: sivasrec | last post by:
Hi, This is sivakumar from India. Now I am learning to ASP.NET 2.0.. I have a doubt.... I have used in a one hidden field control, 2 label controls, 2 button controls and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...
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...

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.