Reputation: 19826
In one of the page of my ASP.NET MVC application, I have a list of messages that is shown to user. Something like this:
Pressing the close button marks the message as read on server so that it is not displayed again. This close button is internally a "submit" type input since I understand that any server side changes must be triggered by a form post.
I want to display this close as small "X" in the top right corner of message box. How can I style it like that? or there are other better ways to do it?
Upvotes: 1
Views: 1952
Reputation: 2037
use css.
.as_link {
background: transparent;
border: none;
cursor: pointer;
padding: 0px;
color: red;
float: right;
etc...
}
Etc.
Edit: just re-read your question. Use the above but call it "x", I'm not sure that you're going to be using this for a web .net app (as I'm not familliar with the way of .net but if you are it will work, else ignore me :) )
Upvotes: 3
Reputation: 526573
Use an <input type="image" ... />
tag:
<input type="image" src="/path/to/image.file" alt="Alt text" />
It acts as a submit button, but displays an image instead.
Upvotes: 2