0

Does anyone know a way to make an asp button...

<asp:button runat="server">Button1</asp:button>

resemble an HTML input button...

<input type="button" value="Button2"/>

(or vice versa) in Visual Studio 2003?

4
  • Do you mean, like a hyper link? Commented Feb 28, 2011 at 14:30
  • 2
    asp:button eventually rendered as HTML button. so your question doesnt make any sense at all. Commented Feb 28, 2011 at 14:31
  • How do I make an asp button look exactly the same as an html button. By default they look quite different. Commented Feb 28, 2011 at 14:32
  • I see that you're right now adt. Thanks. Commented Mar 1, 2011 at 9:05

2 Answers 2

1

I think you'll need to modify your CSS. Here is something that may help get you going;

input.link
{
  border: none;
  background-color: transparent;
  padding: 0px;
  margin: 0px;
  color: #0000ff;
}

a.button
{
  border: 1px solid #a9a9a9;
  padding: 3px 8px 3px 8px;
  background-color: #dbdbdb;
  text-decoration: none;
  color: #000000;
}

Then update your markup to look something like this;

<input type="submit" class="link" value="Submit" />

<%= Html.ActionLink("Cancel", "QuoteList", "Quote", new { @class = "button" })%>

This is just off the top of my head so I hope that helps.

Sign up to request clarification or add additional context in comments.

1 Comment

Ah, thank goodness someone understood my witterings :-) Thank you!
1

Are you missing the runat="server" attribute in your code?

2 Comments

Yes, I was. Thank you. I'm not any more.
That's not an answer. It's pointing out a typo in the question, which I've now fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.