Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

asp.net - Asp button with different button type

Is it possible to have an asp button that isn't rendered with a type="submit" tag. I don't want the button to submit the form, so I'd like to have it as type="button" instead. Perhaps a better way to phrase my question would be: How do I prevent an asp button from submitting?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can just set UseSubmitBehavior="false" and it will render type="button" instead of type="submit" (.net 4 at least)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...