Silly newbe question -Forms

Discussion in 'ASP .Net' started by ampeloso@gmail.com, Feb 20, 2006.

  1. Guest

    Hello,
    I'm trying to understand how a aspx form gets submitted to the server
    when there is no action attribute. I am under the impression you would
    need some kind of html valid button attribute in order to get the form
    to post.Since Asp.net is browser independent ,how does the form know(
    within the confines of the xhtml or html specs)that it is supposed to
    go anywhere.(Even to itself)
    No "action" and no "value= Submit" attributes?

    Thanks
    Mike
     
    , Feb 20, 2006
    #1
    1. Advertising

  2. When you specify your submit button on the form you set the OnClick
    event to a Sub Routine. That sub can process the form. Like this.

    ---> The below code is under the <Script> tags of your page or in a
    codebehind page
    Public Sub Form_Submit(sender As Object, e As System.EventArgs)
    'Code to process form, save in database or whatever you want
    End Sub

    ---->The below code is inbetween the <form> tags on your page
    <Form Runat="Server">
    <asp:button runat="Server" ID="btnSubmit text="Submit"
    OnClick="Form_Submit"/>
    </Form>


    Hope this helps,
    Jeremy Reid
    http://blackstaronline.net/hgtit
     
    blackstaronline.net, Feb 20, 2006
    #2
    1. Advertising

  3. Guest

    "Public Sub Form_Submit" does not submit the form to the server either,
    it's just a function?Could be clientside?Right?
     
    , Feb 20, 2006
    #3
  4. The 'Runat=Server' specifies that it will process on the server. With
    that the page will get handed to the client as HTML. Your actual VB or
    C#, etc. code is not passed to the client (obviously). The form will do
    a postback to the server calling your Sub server side.

    Are you interested in doing client side programming?
     
    blackstaronline.net, Feb 20, 2006
    #4
  5. Guest

    "Runat" is not a valid html attribute.So that cant tell the browser to
    send back to the server.
    I'm just trying to find out how the form gets sent back.It MUST be sent
    back within the specifications.
    You just cant make up tags.
    I know it works, but why??
    Mike
     
    , Feb 20, 2006
    #5
  6. On 20 Feb 2006 13:16:30 -0800, wrote:

    > "Runat" is not a valid html attribute.So that cant tell the browser to
    > send back to the server.
    > I'm just trying to find out how the form gets sent back.It MUST be sent
    > back within the specifications.
    > You just cant make up tags.
    > I know it works, but why??
    > Mike


    hint: Look at the source code you see in the browser with view->source
     
    Erik Funkenbusch, Feb 20, 2006
    #6
  7. Yes, I realize that "Runat" is not valid HTML code. The .NET server
    inserts some of the necessary client side commands into java for you.
    You should check out http://asp.net they have some great articles on
    the inner workings of the .NET framework that might be a little more
    helpful for you.


    Jeremy Reid
    http://blackstaronline.net/hgtit
     
    blackstaronline.net, Feb 20, 2006
    #7
  8. Guest

    Thanks Both of You.
    Sometimes I just aint thinking!
    Mike
    blackstaronline.net wrote:
    > Yes, I realize that "Runat" is not valid HTML code. The .NET server
    > inserts some of the necessary client side commands into java for you.
    > You should check out http://asp.net they have some great articles on
    > the inner workings of the .NET framework that might be a little more
    > helpful for you.
    >
    >
    > Jeremy Reid
    > http://blackstaronline.net/hgtit
     
    , Feb 21, 2006
    #8
    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. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Easy SQL Question - Newbe

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Jan 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    316
    Bob Lehmann
    Jan 5, 2005
  2. =?Utf-8?B?b3o=?=

    Newbe question ---- response.writefile

    =?Utf-8?B?b3o=?=, Jan 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    311
    =?Utf-8?B?b3o=?=
    Jan 9, 2005
  3. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Newbe Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Sep 9, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    390
  4. Daniel Bello Urizarri

    Newbe question about location of assemblies.

    Daniel Bello Urizarri, Sep 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    310
    Daniel Bello Urizarri
    Sep 30, 2005
  5. Eric
    Replies:
    2
    Views:
    595
Loading...

Share This Page