471,337 Members | 896 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Form Submit

I've set up a page to use to test other pages under development so I can
easily control the parameters that I pass to each of them. I've use the
basic html form structure with a submit button (Code below). When I execute
the submit the browser indicates it's trying to make a connection(page url
not shown) then returns to the original page with no error and no rendering
of the page thats in the action parameter of the form. Any idea what might be
missing or how to get addition information as to what is going on????

Thanks, Neil

..
..
..
<body>
<form id="form1" runat="server" action="~/Home.aspx" method="post">
..
..
..
<input id="Submit1" type="submit" value="Go To Page" /><br />
..
..
</form>
</body>

Jun 27 '08 #1
3 1713
If you've created a form in an .aspx page, then the page will automatically
post to itself, regardless of any action="" that you put into the page
(unless you specifically configure cross-page postbacks).
"Neil B" <Ne***@discussions.microsoft.comwrote in message
news:8A**********************************@microsof t.com...
I've set up a page to use to test other pages under development so I can
easily control the parameters that I pass to each of them. I've use the
basic html form structure with a submit button (Code below). When I
execute
the submit the browser indicates it's trying to make a connection(page url
not shown) then returns to the original page with no error and no
rendering
of the page thats in the action parameter of the form. Any idea what might
be
missing or how to get addition information as to what is going on????

Thanks, Neil

.
.
.
<body>
<form id="form1" runat="server" action="~/Home.aspx" method="post">
.
.
.
<input id="Submit1" type="submit" value="Go To Page" /><br />
.
.
</form>
</body>

Jun 27 '08 #2
Thanks Scott. That explains a few things.
With that in mind how do you control what html is rendered on different post
backs?

The way VS 2008 .aspx is set up the html and c# are kept separately so how
do you control which part of the html you want rendered on each post back.

In .asp using VB the html and the VB code were all editted together and the
VB code could be used to control which html was used.

Since I'm new to VS2008 and C# any prospective on how these elemets are
related would be appreciated. Links to any good discussions on the subject
would be helpful also.

Thanks, Neil

"Scott M." wrote:
If you've created a form in an .aspx page, then the page will automatically
post to itself, regardless of any action="" that you put into the page
(unless you specifically configure cross-page postbacks).
"Neil B" <Ne***@discussions.microsoft.comwrote in message
news:8A**********************************@microsof t.com...
I've set up a page to use to test other pages under development so I can
easily control the parameters that I pass to each of them. I've use the
basic html form structure with a submit button (Code below). When I
execute
the submit the browser indicates it's trying to make a connection(page url
not shown) then returns to the original page with no error and no
rendering
of the page thats in the action parameter of the form. Any idea what might
be
missing or how to get addition information as to what is going on????

Thanks, Neil

.
.
.
<body>
<form id="form1" runat="server" action="~/Home.aspx" method="post">
.
.
.
<input id="Submit1" type="submit" value="Go To Page" /><br />
.
.
</form>
</body>


Jun 27 '08 #3
Hi Neil,

The first thing I would suggest is to NOT assume that ASP .NET is anything
like the old "Classic ASP". While it's true that there are some superficial
similarities, the way the operate is radically different.

In the old days, we'd just slap something like <%=someVariable%inline in
the HTML wherever we wanted values to go. With ASP .NET, you have a wide
assortment of server controls to utilize. So, if you know that you are
going to want a server-derived value to eventually show up in a particular
spot on the rendered page, drop a control in that spot as a sort of "place
holder", give that control a good ID and then in your C# code area, write an
event handler (usually Page_Load or Page_Init) to populate that control.
The simplest example would be to put a label on the page, just where you are
going to want a value to show up. Then in the C#, you reference the label
control very easily by refering to it by it's ID and property:

lblResut.Text = someValue;

In short, it will take you some time to get used to the way ASP .NET works
vs. Classic ASP. A really good site to check out is: http://asp.net.

Good luck!

-Scott
"Neil B" <Ne***@discussions.microsoft.comwrote in message
news:46**********************************@microsof t.com...
Thanks Scott. That explains a few things.
With that in mind how do you control what html is rendered on different
post
backs?

The way VS 2008 .aspx is set up the html and c# are kept separately so how
do you control which part of the html you want rendered on each post back.

In .asp using VB the html and the VB code were all editted together and
the
VB code could be used to control which html was used.

Since I'm new to VS2008 and C# any prospective on how these elemets are
related would be appreciated. Links to any good discussions on the subject
would be helpful also.

Thanks, Neil

"Scott M." wrote:
>If you've created a form in an .aspx page, then the page will
automatically
post to itself, regardless of any action="" that you put into the page
(unless you specifically configure cross-page postbacks).
"Neil B" <Ne***@discussions.microsoft.comwrote in message
news:8A**********************************@microso ft.com...
I've set up a page to use to test other pages under development so I
can
easily control the parameters that I pass to each of them. I've use
the
basic html form structure with a submit button (Code below). When I
execute
the submit the browser indicates it's trying to make a connection(page
url
not shown) then returns to the original page with no error and no
rendering
of the page thats in the action parameter of the form. Any idea what
might
be
missing or how to get addition information as to what is going on????

Thanks, Neil

.
.
.
<body>
<form id="form1" runat="server" action="~/Home.aspx" method="post">
.
.
.
<input id="Submit1" type="submit" value="Go To Page" /><br
/>
.
.
</form>
</body>



Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Terence Parker | last post: by
6 posts views Thread by CJM | last post: by
4 posts views Thread by Stuart Perryman | last post: by
5 posts views Thread by rjames.clarke | last post: by
5 posts views Thread by Navillus | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.