Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Hyperlink inside label WebControl

Reply
Thread Tools

Hyperlink inside label WebControl

 
 
Christian Hofmann
Guest
Posts: n/a
 
      03-04-2006
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?RWx0b24gVw==?=
Guest
Posts: n/a
 
      03-04-2006
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
>
>
>

 
Reply With Quote
 
 
 
 
Christian Hofmann
Guest
Posts: n/a
 
      03-04-2006
Hello Elton,

"Elton W" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?RWx0b24gVw==?=
Guest
Posts: n/a
 
      03-04-2006
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" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:(E-Mail Removed)...
> > 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
>
>
>
>

 
Reply With Quote
 
Christian Hofmann
Guest
Posts: n/a
 
      03-05-2006
Hello Elton,

"Elton W" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. ASP .Net 2 01-31-2005 06:34 PM
WebControl inside of WebControl and attaching events Kasabaarde Sumta ASP .Net Building Controls 0 12-13-2004 09:51 PM
Can a webcontrol (webcontrol.dll) have a configuration file? Luis Ramírez. ASP .Net Building Controls 2 07-06-2004 04:35 PM
impossible to append a variable to a hyperlink, inside a template, inside a DataList? Dave ASP .Net Web Controls 0 08-30-2003 04:58 AM
adding a variable inside a hyperlink template (inside a datalist) Dave ASP .Net 0 08-29-2003 08:12 PM



Advertisments