Login The asp button? <...">

Using internal HTML with ASP: Button?

How can i convert

<button type="submit" class="blue"> <span>Login</span> </button> 

The asp button?

 <asp:Button ID="Button1" runat="server" Text="Button" /> <asp:LinkButton ID="LinkButton1" runat="server" CssClass="blue"><span>Login</span></asp:LinkButton> 

I just can't find a way to do this. Sorry, this is a hefty question, but it throws me for a cycle, maybe you just need to sleep on it.

+4
source share
2 answers

If you really need large formatting, you use the css class and define all the styles in the css side or you can use the html anchor

I don't know any other way to compose an internal html button or link button, as you are trying to do.

+1
source

I agree with Davide that CSS is the best solution, but if you have any style requirement that requires multiple tags, then LinkButton is your best bet. You can apply all the styles that you would put in the 'button' tag to the 'a' tag.

  <asp:LinkButton ID="submit" runat="server" OnClick="Submit_Click" CssClass="block-button"> <span runat="server" ID="submitText" ClientIDMode="Static" class="block-button-text">Submit</span><span class="block-button-arrow">&nbsp;</span> </asp:LinkButton> 

If you really have a button tag, the only way is to create a custom control that implements all asp: button functions

See prabhakarbn solution here http://forums.asp.net/t/1496938.aspx/1

+7
source

Source: https://habr.com/ru/post/1383809/


All Articles