acts like an anchor, i.e., links to another page, but looks like a button

  • Thread starter Thread starter AAaron123
  • Start date Start date
A

AAaron123

I like something that acts like an anchor, i.e., links to another page, but
looks like a button.

I can use this: asp:LinkButton but the corners are square so it looks
different that a regular button.



I tried defined a css class and do this:

<a class="button" href="whatever.com">Anchor Button</a>

I did not succeed (yet), but I'm quite sure it to will not look like a
normal button because the border will have square corners.



Is there a solution without using themes?



Any answer, especially "No" so I stop trying, would be appreciated.
 
I like something that acts like an anchor, i.e., links to another page, but
looks like a button.

 I can use this: asp:LinkButton but the corners are square so it looks
different that a regular button.

I tried defined a css class and do this:

<a class="button" href="whatever.com">Anchor Button</a>

I did not succeed (yet), but I'm quite sure it to will not look like a
normal button because the border will have square corners.

Is there a solution without using themes?

Any answer, especially "No" so I stop trying, would be appreciated.

An image? You can attach an href to an image element.

Edward
 
To create the look and feel you need to learn more about CSS; pseudo-classes
in particular and also how to make buttons. Thirdly you need to learn
ASP.NET and understand we can add runat="server" to any HTML element and
process it on the server. Finally learn how to read Backus-Naur format and
naming conventions as its how software developers document and discuss
examples as this one that follows...

// ASP.NET HTML Control
<a href="[hrefValue]" class="[className]" runat="server">[anchorText]</a>
 
I don't know if I want to laugh or cry.

Thanks

Mark Rae said:
Hmm - something which looks like a button, eh? How about a button...?

<input type="button" value="Anchor Button"
onclick="window.location='whichever.com';" />
 
thanks
Hillbilly said:
To create the look and feel you need to learn more about CSS;
pseudo-classes in particular and also how to make buttons. Thirdly you
need to learn ASP.NET and understand we can add runat="server" to any HTML
element and process it on the server. Finally learn how to read
Backus-Naur format and naming conventions as its how software developers
document and discuss examples as this one that follows...

// ASP.NET HTML Control
<a href="[hrefValue]" class="[className]" runat="server">[anchorText]</a>



AAaron123 said:
I like something that acts like an anchor, i.e., links to another page,
but looks like a button.

I can use this: asp:LinkButton but the corners are square so it looks
different that a regular button.



I tried defined a css class and do this:

<a class="button" href="whatever.com">Anchor Button</a>

I did not succeed (yet), but I'm quite sure it to will not look like a
normal button because the border will have square corners.



Is there a solution without using themes?



Any answer, especially "No" so I stop trying, would be appreciated.
 
thanks
I like something that acts like an anchor, i.e., links to another page,
but
looks like a button.

I can use this: asp:LinkButton but the corners are square so it looks
different that a regular button.

I tried defined a css class and do this:

<a class="button" href="whatever.com">Anchor Button</a>

I did not succeed (yet), but I'm quite sure it to will not look like a
normal button because the border will have square corners.

Is there a solution without using themes?

Any answer, especially "No" so I stop trying, would be appreciated.

An image? You can attach an href to an image element.

Edward
 
unlike an anchor, this requires javascript be enabled. an anchor with an
image is probably a better choice.

-- bruce (sqlwork.com)
 
I'd like ask a couple of questions just to be sure:

To get the rounded corners I'd have to make a .gif with transparent color in
the corners?

The text would be part of the image so I'd need an image for each different
text?

Are there many people with JavaScript disabled (this impacts other things)?

Thanks for the suggestion
 
Mark Rae said:
Yes, pretty much.


Or create the image dynamically at runtime...


About 6%: http://www.thecounter.com/stats/2008/October/javas.php

How do most developers handle the 6%?

Ignore that fact that their site will not function perfectly on those
browsers?

Not use javascript?

Check to see if it is supported and provide alternate code?

??


Thanks


PS Do you have any idea why some people would use a javascript non-enabled
browser?
 
whether you can ignore javascript being disabled depends on your site
and its users. if there is there a monetary reward to use your site,
then you can have more control. maybe you can just blow them off.

you can use a sniffer, to detect no javascript, and have two versions.
you can code your pages to gracefully degrade when javascript is
disabled. (unfortunately asp.net webforms gave no thought to this
approach, so many of the control fail without javascript).

when dealing with transparent images check the limitations of IE 6.0
(only 8 bit).

-- bruce (sqlwork.com)
 
Thanks for the insight

bruce barker said:
whether you can ignore javascript being disabled depends on your site and
its users. if there is there a monetary reward to use your site, then you
can have more control. maybe you can just blow them off.

you can use a sniffer, to detect no javascript, and have two versions. you
can code your pages to gracefully degrade when javascript is disabled.
(unfortunately asp.net webforms gave no thought to this approach, so many
of the control fail without javascript).

when dealing with transparent images check the limitations of IE 6.0 (only
8 bit).

-- bruce (sqlwork.com)
 
Back
Top