Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > asp button always rendered as type="button" vs. type="submit"

Reply
Thread Tools

asp button always rendered as type="button" vs. type="submit"

 
 
Sam
Guest
Posts: n/a
 
      11-13-2008
I have a User Control that renders all asp buttons as Command button
vs. Submit buttons. When you view source on the browser you see the
HTML rendered:

<input type="button" ... >

instead of

<input type="submit" ...>

I am aware there is a property for the button control named
UseSubmitBehavior. The default is true and I have explicitly set this
to true, but I still cannot get the button to render as a Submit
button. Has anyone seen this behavior and have a workaround?

Thanks,

Sam
 
Reply With Quote
 
 
 
 
Brian Kenneth Nielsen
Guest
Posts: n/a
 
      11-25-2008
Hi Sam

Why would you like a submit button?

ASP.Net only allows one server side form anyway. And if you have
multiple "forms" on the page, it will be a problem, if they all had
type=Submit buttons.

That's properly why you don't see a real submit button.

If you have the common problem about which button that is the default
button, then put your subform into a <aspanel> and place your Command
Button inside that. then set aspanels defaultButton property to the ID
of your Command Button. That way your button will be called when user
eg. press ENTER key in one of the forms fields.

In that way you can both a login form, search form, tip a friend form on
the same page, with different default buttons.

Best regards
Brian Kenneth Nielsen
http://www.bknnet.dk/


Sam wrote:
> I have a User Control that renders all asp buttons as Command button
> vs. Submit buttons. When you view source on the browser you see the
> HTML rendered:
>
> <input type="button" ... >
>
> instead of
>
> <input type="submit" ...>
>
> I am aware there is a property for the button control named
> UseSubmitBehavior. The default is true and I have explicitly set this
> to true, but I still cannot get the button to render as a Submit
> button. Has anyone seen this behavior and have a workaround?
>
> Thanks,
>
> Sam

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling submit button until page is fully rendered with JavaScript? ChrisN ASP .Net 3 04-04-2007 06:02 PM
How to capture the rendered HTML for asp.net page? Paul W ASP .Net 2 07-17-2005 07:52 PM
How the ASP.net Page is rendered ??? ~Maheshkumar.R ASP .Net 4 03-24-2005 09:26 PM
Setting button color not being rendered tshad ASP .Net 1 03-11-2005 05:49 PM
Trying to create a CSS box that is always is always the width of an image placed inside it (and no wider) Deryck HTML 4 06-22-2004 08:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57