Apply stylesheet to Hyperlink server control
Apply stylesheet to Hyperlink server control
am 10.01.2008 02:24:41 von redhair
When I set up a image link with Hyperlink server control as below
NavigateUrl="#toWhere" ImageUrl="theLinkIMage.gif" />
the html output will be
style="border-width:0px;">
How to remove the built-in style and apply style sheet to the tag?
Re: Apply stylesheet to Hyperlink server control
am 10.01.2008 08:17:07 von Eliyahu Goldin
Make your own style class in a stylesheet and assign it to the CssClass
property. Or make a rule for a or for img. You can make it apply to that
link only. There are many thinks you can make with css.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Redhairs" wrote in message
news:eVBrodyUIHA.2464@TK2MSFTNGP04.phx.gbl...
> When I set up a image link with Hyperlink server control as below
>
> NavigateUrl="#toWhere" ImageUrl="theLinkIMage.gif" />
> the html output will be
> style="border-width:0px;">
>
> How to remove the built-in style and apply style sheet to the tag?
>
>
Re: Apply stylesheet to Hyperlink server control
am 10.01.2008 19:47:42 von redhair
I have tried both way but they don't work.
If I set the CssClass of the HyperLink control, the class property will be
added to the tag instead of the tag.
I also create css rule for img but the default style(border-width:0px" will
override the rule.
"Eliyahu Goldin" wrote in
message news:OXwZTh1UIHA.1208@TK2MSFTNGP03.phx.gbl...
> Make your own style class in a stylesheet and assign it to the CssClass
> property. Or make a rule for a or for img. You can make it apply to that
> link only. There are many thinks you can make with css.
>
> --
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
>
>
> "Redhairs" wrote in message
> news:eVBrodyUIHA.2464@TK2MSFTNGP04.phx.gbl...
>> When I set up a image link with Hyperlink server control as below
>>
>> NavigateUrl="#toWhere" ImageUrl="theLinkIMage.gif" />
>> the html output will be
>> style="border-width:0px;">
>>
>> How to remove the built-in style and apply style sheet to the tag?
>>
>>
>
>
Re: Apply stylesheet to Hyperlink server control
am 10.01.2008 20:05:01 von Eliyahu Goldin
Make your css class in this way:
border-width:2px!important;
And you don't have to use Hyperlink if it doesn't suit you. Just use html
markup with runat=server.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Redhairs" wrote in message
news:u$tZgk7UIHA.4696@TK2MSFTNGP05.phx.gbl...
>I have tried both way but they don't work.
> If I set the CssClass of the HyperLink control, the class property will be
> added to the tag instead of the tag.
> I also create css rule for img but the default style(border-width:0px"
> will override the rule.
>
> "Eliyahu Goldin" wrote in
> message news:OXwZTh1UIHA.1208@TK2MSFTNGP03.phx.gbl...
>> Make your own style class in a stylesheet and assign it to the CssClass
>> property. Or make a rule for a or for img. You can make it apply to that
>> link only. There are many thinks you can make with css.
>>
>> --
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>>
>>
>> "Redhairs" wrote in message
>> news:eVBrodyUIHA.2464@TK2MSFTNGP04.phx.gbl...
>>> When I set up a image link with Hyperlink server control as below
>>>
>>> NavigateUrl="#toWhere" ImageUrl="theLinkIMage.gif" />
>>> the html output will be
>>> style="border-width:0px;">
>>>
>>> How to remove the built-in style and apply style sheet to the tag?
>>>
>>>
>>
>>
>
>
Re: Apply stylesheet to Hyperlink server control
am 10.01.2008 22:10:19 von marss
On 10 СÑÑ, 03:24, "Redhairs" wrote:
> When I set up a image link with Hyperlink server control as below
>
> NavigateUrl=3D"#toWhere" ImageUrl=3D"theLinkIMage.gif" />
> the html output will be
> style=3D"border-width:0px;">
>
Another variant is using nested IMG element instead of setting
ImageUrl property.
Something like this:
src=3D"theLinkIMage.gif"/>
Regards,
Mykola
http://marss.co.ua
Re: Apply stylesheet to Hyperlink server control
am 11.01.2008 20:16:45 von redhair
I need to use Image server control in order set the image programmatically
"marss" wrote in message
news:d383fd6d-c63d-43b7-9c6a-31dbd30e8859@f3g2000hsg.googleg roups.com...
On 10 ???, 03:24, "Redhairs" wrote:
> When I set up a image link with Hyperlink server control as below
>
> NavigateUrl="#toWhere" ImageUrl="theLinkIMage.gif" />
> the html output will be
> style="border-width:0px;">
>
Another variant is using nested IMG element instead of setting
ImageUrl property.
Something like this:
src="theLinkIMage.gif"/>
Regards,
Mykola
http://marss.co.ua
Re: Apply stylesheet to Hyperlink server control
am 11.01.2008 20:54:09 von marss
On 11 СÑÑ, 21:16, "Redhairs" wrote:
> I need to use Image server control in order set the image programmatically=
Just add runat=3D"server" attribute and id.
id=3D"theLinkIMage" runat=3D"server"/>
Server-side code: theLinkIMage.Src =3D "theLinkIMage.gif"
Or use Image web control:
NavigateUrl=3D"#toWhere">
ImageUrl=3D"theLinkIMage.gif">
Regards,
Mykola
http://marss.co.ua