Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enable and disable button
Message
De
31/10/2013 13:24:49
 
 
Information générale
Forum:
Javascript
Catégorie:
JQuery
Divers
Thread ID:
01586844
Message ID:
01587000
Vues:
16
>>Hmm. Just tried all three(i.e aspx.:
<input type="button" id="button1" value="One" />
>><button type="button" id="button2">Two</button>
>><asp:Button runat="server" ID="button3" Text="Three"/>
gives HTML:
<input type="button" id="button1" value="One">
>><button type="button" id="button3">Two</button>
>><input type="submit" name="button4" value="Three" id="button4">
in a clean Web Application and they look the same to me. Relevant bit in css:
   input[type="submit"],
>>    input[type="button"],
>>    button {
>>        background-color: #d3dce0;
>>        border: 1px solid #787878;
>>        cursor: pointer;
>>        font-size: 1.2em;
>>        font-weight: 600;
>>        padding: 7px;
>>        margin-right: 8px;
>>        width: auto;
>>    }
How does yours differ ?
>>
>
>I will try to create a small test page to see if I get the same results as you. When I tested in my "production" project page, the look was very different. As I said, the standard ASP.NET Web Forms project is using Sites.css (from MS). So it (this .css) could be that made the difference.

The example above is using standard Sites.css. I can see one difference: for the 'button' element Sites.css doesn't override the margin-bottom, -left or -top values. For and 'input' element it overrides all four. But that shouldn't affect the size of the element itself.......

>
>
>>
>>>Actually the html button and asp:button are not styled identically (by standard Site.css). The height of the button and asp:button are very different. Of course, this could be changed. I plan to do away with standard MS Site.css and have my own CSS (in addition to Bootstrap.css) since I don't like a lot of standard styles in Site.css
>>>
>>>>Absolutely - and, as per my post to Dmitry, if he is using the standard Site.css file for an ASP.NET Web Application then they are indeed styled identically.
>>>>
>>>>>You should be able to style them the same.
>>>>>
>>>>>>asp:Button (which must have "runat='server'") creates an input element with type="submit" (rather than "button" which was what I suggested)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform