By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

submit button versus regular button

P: n/a
I want to understand the difference between submit button and regular
button: <input type="submit"> and <input type="button">. My understanding is
that submit button will send the entire HTML form to the web server, but
regular button won't.

I have a problem that needs to pass HTML elements data back and forth in
several ASP pages. I am using regular button to do that. But what's the
approaches??

Please advise. Thanks!
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You are correct -- the submit button posts the form data to the other page,
while the button control merely displays a clickable button. The purpose of
a button control is for developers to be able to invoke methods on the page
without actually leaving it.

If you want the page interact with others, the submit button is easy and
probably better way to go.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Matt" <ma*******@hotmail.com> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl...
I want to understand the difference between submit button and regular
button: <input type="submit"> and <input type="button">. My understanding is that submit button will send the entire HTML form to the web server, but
regular button won't.

I have a problem that needs to pass HTML elements data back and forth in
several ASP pages. I am using regular button to do that. But what's the
approaches??

Please advise. Thanks!

Jul 19 '05 #2

P: n/a
<<
I have a problem that needs to pass HTML elements data back and forth in
several ASP pages. I am using regular button to do that. But what's the
approaches??


Generally speaking you can pass variables from page to page by:

1) Posting form fields from one page to the next (or to the same page)
and on the page to retrieve the value strLName = Request.Form("LName")

2) Using a querystring such as Response.Redirect
"login.asp?lname=smith&fname=tom" and on the page to retrieve the values
strLName = Request.QueryString("lname") and strFName =
Request.QueryString("fname")

3) Using session variables such as Session("LName") = "Smith" and on the
page to retrieve the value strLName = Session("LName")

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

P: n/a
"Manohar Kamath [MVP]" <mk*****@TAKETHISOUTkamath.com> wrote in message news:<OL**************@TK2MSFTNGP11.phx.gbl>...
You are correct -- the submit button posts the form data to the other page,
while the button control merely displays a clickable button. The purpose of
a button control is for developers to be able to invoke methods on the page
without actually leaving it.

If you want the page interact with others, the submit button is easy and
probably better way to go.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Matt" <ma*******@hotmail.com> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl...
I want to understand the difference between submit button and regular
button: <input type="submit"> and <input type="button">. My understanding

is
that submit button will send the entire HTML form to the web server, but
regular button won't.

I have a problem that needs to pass HTML elements data back and forth in
several ASP pages. I am using regular button to do that. But what's the
approaches??

Please advise. Thanks!


Slightly off-topic since this is not a dotNet forum, but what happens
if you use a submit button instead of a button (button) with aspx?

In most of the code I've seen, the aspx pages use a button with an
onClick event to do the postback. However, by using the 'button', I
dont get the default enter-key = submit-the-form which is rather
annoying. I'd like to change the 'button' to a submit button. It seems
to work fine but am I missing something important?

Thanks
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.