Creating ASP.NET forms, that act like HTML forms

Discussion in 'ASP .Net' started by jlopes151, Mar 13, 2005.

  1. jlopes151

    jlopes151 Guest

    Question:

    I'm creating an ASP.NET webform and I have questions about how the
    ASP.NET form works. In ASP or
    HTML a form with an action will transfer that forms items to another
    page.

    From the documentation I have read, there is nothing that describes
    the use of the forms action
    atribute. I did find text on the MSDN that describes the use of
    Server.Transfer and Response.Redirect.

    A simple Submit use of the "action" attribute doesn't seem to exist.

    Is there a default way to submit a webform in ASP.NET as in HTML or
    ASP? Yes I can store the form
    data in a class, store the class in the session, retrive it from the
    session as needed.


    Thanks for any help :?


    Posted Via Usenet.com Premium Usenet Newsgroup Services
    ----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    ----------------------------------------------------------
    http://www.usenet.com
     
    jlopes151, Mar 13, 2005
    #1
    1. Advertising

  2. jlopes151

    Brock Allen Guest

    Forms in ASP.NET postback to the same page that rendered them so you can
    take advantage of the object model. When you postback all of the server side
    controls are recreated and repopulated with the values that are posted back
    to the page. This provides for a much higher level programming model, and
    therefore makes you as the developer more productive.

    Now, if you really want to post to a second page, you can. But then you're
    back to [old] ASP style Request.Forms programming.

    As an aside, in ASP.NET v2.0 you can do a cross page postback without sacrificing
    the ASP.NET object model.

    -Brock
    http://staff.develop.com/ballen

    > Question:
    >
    > I'm creating an ASP.NET webform and I have questions about how the
    > ASP.NET form works. In ASP or
    > HTML a form with an action will transfer that forms items to another
    > page.
    > From the documentation I have read, there is nothing that describes
    > the use of the forms action
    > atribute. I did find text on the MSDN that describes the use of
    > Server.Transfer and Response.Redirect.
    > A simple Submit use of the "action" attribute doesn't seem to exist.
    >
    > Is there a default way to submit a webform in ASP.NET as in HTML or
    > ASP? Yes I can store the form
    > data in a class, store the class in the session, retrive it from the
    > session as needed.
    > Thanks for any help :?
    >
    > Posted Via Usenet.com Premium Usenet Newsgroup Services
    > ----------------------------------------------------------
    > ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    > ----------------------------------------------------------
    > http://www.usenet.com
     
    Brock Allen, Mar 13, 2005
    #2
    1. Advertising

  3. Setting the action attribute just isn't the ASP.NET way.
    If you really must do it though, here are some tips:

    1) Output an old fashioned non-server form to the client (without the runat=
    'server' attribute) Set the action attribute like you would have in
    ASP.OLD, and use javascript to submit the form.
    2) use client side script to change your ASP.NET form action attribute
    3) use this webform control: http://www.wilsondotnet.com/Controls/

    Note: In ASP.NET 2.0 you will be able to more easily post to another page.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "jlopes151" <-spam.invalid> wrote in message
    news:4234b277$1_4@127.0.0.1...
    > Question:
    >
    > I'm creating an ASP.NET webform and I have questions about how the
    > ASP.NET form works. In ASP or
    > HTML a form with an action will transfer that forms items to another
    > page.
    >
    > From the documentation I have read, there is nothing that describes
    > the use of the forms action
    > atribute. I did find text on the MSDN that describes the use of
    > Server.Transfer and Response.Redirect.
    >
    > A simple Submit use of the "action" attribute doesn't seem to exist.
    >
    > Is there a default way to submit a webform in ASP.NET as in HTML or
    > ASP? Yes I can store the form
    > data in a class, store the class in the session, retrive it from the
    > session as needed.
    >
    >
    > Thanks for any help :?
    >
    >
    > Posted Via Usenet.com Premium Usenet Newsgroup Services
    > ----------------------------------------------------------
    > ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    > ----------------------------------------------------------
    > http://www.usenet.com
     
    Steve C. Orr [MVP, MCSD], Mar 14, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dipesh
    Replies:
    0
    Views:
    340
    dipesh
    Nov 9, 2004
  2. C.F.
    Replies:
    0
    Views:
    659
  3. S Kalynuik
    Replies:
    11
    Views:
    1,075
    Stan McCann
    Mar 15, 2006
  4. Edward
    Replies:
    3
    Views:
    981
    Edward
    Aug 4, 2006
  5. active
    Replies:
    4
    Views:
    314
    active
    Apr 3, 2007
Loading...

Share This Page