Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Silly newbe question -Forms

Reply
Thread Tools

Silly newbe question -Forms

 
 
ampeloso@gmail.com
Guest
Posts: n/a
 
      02-20-2006
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

 
Reply With Quote
 
 
 
 
blackstaronline.net
Guest
Posts: n/a
 
      02-20-2006
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

 
Reply With Quote
 
 
 
 
ampeloso@gmail.com
Guest
Posts: n/a
 
      02-20-2006
"Public Sub Form_Submit" does not submit the form to the server either,
it's just a function?Could be clientside?Right?

 
Reply With Quote
 
blackstaronline.net
Guest
Posts: n/a
 
      02-20-2006
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?

 
Reply With Quote
 
ampeloso@gmail.com
Guest
Posts: n/a
 
      02-20-2006
"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

 
Reply With Quote
 
Erik Funkenbusch
Guest
Posts: n/a
 
      02-20-2006
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
 
Reply With Quote
 
blackstaronline.net
Guest
Posts: n/a
 
      02-20-2006
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

 
Reply With Quote
 
ampeloso@gmail.com
Guest
Posts: n/a
 
      02-21-2006
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbe question ---- response.writefile =?Utf-8?B?b3o=?= ASP .Net 1 01-09-2005 05:15 AM
Easy SQL Question - Newbe =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 1 01-05-2005 10:04 PM
Mozilla newbe mail settings question dryd(takethisout) Firefox 16 09-05-2004 02:17 PM
newbe question on configuration Michael Huffaker Cisco 1 07-16-2004 10:24 PM
Newbe question Cisco 1710 router! Arben Qarkaxhija Cisco 3 07-18-2003 04:20 PM



Advertisments
 



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