Form action attribute unchangeable?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Form action attribute unchangeable?

    Whereas in Asp I could submit my form contents to any other Asp page, it
    appears that in Asp.NET the primary Asp form will only submit to itself.

    I have tried changing the Action attribute in the Form tag, but it changes
    itself back when compiled.

    I have also tried changing the form Action attribute in client-side
    javascript prior to submitting the form, but I get this error:
    The View State is invalid for this page and might be corrupted.

    I can pass the form collection to a different Asp page by creating
    properties in the page module and using Server.Transfer. I can also do it
    using client-side logic, by creating a second form on the page with whatever
    Action attribute I desire, and copy the data from the primary form to hidden
    controls on the secondary form before submitting it.

    Am I correct that there is no simpler way of accomplishing what was a common
    task in old Asp?

    I am otherwise happy with ASP.NET so far. I can manage my interface in a
    single page, but it is a lot of panel moving and hiding. (I have found the
    best way to do this is with an HTML Grid Layout panel, with the RunAt
    property set to Server.)

    Please let me know if it seems I have overlooked something.

    Thanks!
    Bill



    belgie Guest

  2. Similar Questions and Discussions

    1. CF submit form action
      hi. I have a site that uses a form for visitors to request information. when the SUBMIT button is clicked, the page returns to the home page... I...
    2. changing action attribute
      Question: In a flash cfform Is the action attribute changeable? I have searched thru the actionscript docs, the flex docs, and the cfdocs. If there...
    3. update cfform action attribute with ActionScript
      I would appreciate any help possible. I have a flash form, and am trying to update the cfform's action attribute according to which submit button...
    4. Double action from an ASP form
      Thank you for your patience and courtesy. I have some text and the "Submit" button, pressing which I do something useful. When the form is finished...
    5. form action
      What does "doesn't seem to work" mean? (asp.general removed from x-post list) "rOadhOg" <roadhog@nospam.phreaker.net> wrote in message...
  3. #2

    Default Re: Form action attribute unchangeable?

    Belgie,

    This is a trade off that was made in order to bring web programming into the
    modern world of object oriented programming.

    It took me a while to get used to it too...

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "belgie" <belgie@hns.com> wrote in message
    news:O6nN5RRVDHA.2156@TK2MSFTNGP11.phx.gbl...
    > Whereas in Asp I could submit my form contents to any other Asp page, it
    > appears that in Asp.NET the primary Asp form will only submit to itself.
    >
    > I have tried changing the Action attribute in the Form tag, but it changes
    > itself back when compiled.
    >
    > I have also tried changing the form Action attribute in client-side
    > javascript prior to submitting the form, but I get this error:
    > The View State is invalid for this page and might be corrupted.
    >
    > I can pass the form collection to a different Asp page by creating
    > properties in the page module and using Server.Transfer. I can also do it
    > using client-side logic, by creating a second form on the page with
    whatever
    > Action attribute I desire, and copy the data from the primary form to
    hidden
    > controls on the secondary form before submitting it.
    >
    > Am I correct that there is no simpler way of accomplishing what was a
    common
    > task in old Asp?
    >
    > I am otherwise happy with ASP.NET so far. I can manage my interface in a
    > single page, but it is a lot of panel moving and hiding. (I have found
    the
    > best way to do this is with an HTML Grid Layout panel, with the RunAt
    > property set to Server.)
    >
    > Please let me know if it seems I have overlooked something.
    >
    > Thanks!
    > Bill
    >
    >
    >

    S. Justin Gengo Guest

  4. #3

    Default Re: Form action attribute unchangeable?

    You can change this behavior to submit to another page by removing the
    runat="server" attribute from the form tag. However, you then lose the
    ability to work with web controls.

    With ASP.NET, you work with declared controls and inheritance. The post back
    can then be used to read from these same controls and take some action. It
    is a fundamental difference in how you construct your applications - once
    you get used to it, it seems very natural. You react to events. You may not
    want to post to another form yet - you may have validators that you want to
    run before you leave that page, and you can't trust that this happens in
    client side code.

    If you have several pages, don't forget that you can also response.redirect
    and server.transfer, rather than having to use panels and such.

    Also, you have the ability to dynamically load controls. I have quite a few
    applications that consist of a single aspx page, and the content is
    determined by which ascx pages I have loaded into it at a given time. You've
    just got to think about things a little bit differently.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows XP
    Windows XP Associate Expert
    --
    "belgie" <belgie@hns.com> wrote in message
    news:O6nN5RRVDHA.2156@TK2MSFTNGP11.phx.gbl...
    > Whereas in Asp I could submit my form contents to any other Asp page, it
    > appears that in Asp.NET the primary Asp form will only submit to itself.
    >
    > I have tried changing the Action attribute in the Form tag, but it changes
    > itself back when compiled.
    >
    > I have also tried changing the form Action attribute in client-side
    > javascript prior to submitting the form, but I get this error:
    > The View State is invalid for this page and might be corrupted.
    >
    > I can pass the form collection to a different Asp page by creating
    > properties in the page module and using Server.Transfer. I can also do it
    > using client-side logic, by creating a second form on the page with
    whatever
    > Action attribute I desire, and copy the data from the primary form to
    hidden
    > controls on the secondary form before submitting it.
    >
    > Am I correct that there is no simpler way of accomplishing what was a
    common
    > task in old Asp?
    >
    > I am otherwise happy with ASP.NET so far. I can manage my interface in a
    > single page, but it is a lot of panel moving and hiding. (I have found
    the
    > best way to do this is with an HTML Grid Layout panel, with the RunAt
    > property set to Server.)
    >
    > Please let me know if it seems I have overlooked something.
    >
    > Thanks!
    > Bill
    >
    >
    >

    Chris Jackson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139