473,382 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 1773
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p...
2
by: Matt | last post by:
Can form.submit() submit another form? In the following example, in page1.asp, it is fine to submit the current form: form1.submit(), and and I could see the value "Joe" in page2.asp. However, if I...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.