473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Posting onto a form after code executes?

Hi all,

Ok - I have a bit of a problem with a login page.

Originally it was written in normal asp - the page displayed the form, the
user entered their details, it posted back to itself, validated them and
then posted on again (using a form) to the relevant applications - sending
with it a session id from SQL server.

What I need to do at the moment is create a second stage to this and in
..net...

The process will be like this :

1. .asp page loads and displays form, user enters their details, form posts
to itself and validates.
2. Based on a successful login the .asp has a <form> inside the code which
then posts of to my new .aspx page.
3. the page_onload in the .aspx then takes the values from the hidden form
tags and runs a stored procedure.

All of the above I have running and working fine - but what I need to do now
is post using a form to the application, as I need to send in the hidden
tags the session id etc, I also need to have the action= part of the form
equal the value of a variable....

In old asp I'd have had something like :

<%
' successful log
%>
<body onload = "javascript:doc ument.formname. submit();">
<form action="<%=strU RL%>" method="post">
<input type="hidden" name="sessionid " value="<%=strSe ssionID%>">
</form>
</body>

<%
' not a successful login
%>
etc etc - but I cant work out how to achieve the same in .net - if I create
the form above on the html view in visual studio the form surely needs to
have runat = server - therefore I cant add an action= to it can I?

Any help on this would be appreciate, I am aiming to get this update out
today and this is my only problem at the moment...

Regards

Rob
Nov 18 '05 #1
5 1205
Why don't you just use Server.Transfer to transfer control and HttpContext
to the second page?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob Meade" <ro**********@N OSPAMubht.swest .nhs.uk> wrote in message
news:#U******** ******@TK2MSFTN GP12.phx.gbl...
Hi all,

Ok - I have a bit of a problem with a login page.

Originally it was written in normal asp - the page displayed the form, the
user entered their details, it posted back to itself, validated them and
then posted on again (using a form) to the relevant applications - sending
with it a session id from SQL server.

What I need to do at the moment is create a second stage to this and in
.net...

The process will be like this :

1. .asp page loads and displays form, user enters their details, form posts to itself and validates.
2. Based on a successful login the .asp has a <form> inside the code which
then posts of to my new .aspx page.
3. the page_onload in the .aspx then takes the values from the hidden form
tags and runs a stored procedure.

All of the above I have running and working fine - but what I need to do now is post using a form to the application, as I need to send in the hidden
tags the session id etc, I also need to have the action= part of the form
equal the value of a variable....

In old asp I'd have had something like :

<%
' successful log
%>
<body onload = "javascript:doc ument.formname. submit();">
<form action="<%=strU RL%>" method="post">
<input type="hidden" name="sessionid " value="<%=strSe ssionID%>">
</form>
</body>

<%
' not a successful login
%>
etc etc - but I cant work out how to achieve the same in .net - if I create the form above on the html view in visual studio the form surely needs to
have runat = server - therefore I cant add an action= to it can I?

Any help on this would be appreciate, I am aiming to get this update out
today and this is my only problem at the moment...

Regards

Rob

Nov 18 '05 #2
"Kevin Spencer" wrote ...
Why don't you just use Server.Transfer to transfer control and HttpContext
to the second page?


Hello Kevin,

Thanks for your reply - I haven't used these before - will go see what I can
find - any examples would be handy...

Regards

Rob
Nov 18 '05 #3
"Kevin Spencer" wrote ...
Why don't you just use Server.Transfer to transfer control and HttpContext
to the second page?


Hello again Kevin,

Sorry I should have asked this in my first reply - does it matter that the
..aspx will be going to a normal asp (vanilla asp) page rather than a .net
one?

Regards

Rob
Nov 18 '05 #4
> Sorry I should have asked this in my first reply - does it matter that the
.aspx will be going to a normal asp (vanilla asp) page rather than a .net
one?
Yes. ASP and ASP.Net are not compatible, do not share the same memory space.
In a case like that you would have to do a form post. A WebForm cannot post
to anything other than itself. Therefore, what you can do is add a normal
HTML form below the WebForm and submit that to change the page.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob Meade" <ro**********@N OSPAMubht.swest .nhs.uk> wrote in message
news:#K******** ******@TK2MSFTN GP11.phx.gbl... "Kevin Spencer" wrote ...
Why don't you just use Server.Transfer to transfer control and HttpContext to the second page?


Hello again Kevin,

Sorry I should have asked this in my first reply - does it matter that the
.aspx will be going to a normal asp (vanilla asp) page rather than a .net
one?

Regards

Rob

Nov 18 '05 #5
"Kevin Spencer" wrote...
Yes. ASP and ASP.Net are not compatible, do not share the same memory space. In a case like that you would have to do a form post. A WebForm cannot post to anything other than itself. Therefore, what you can do is add a normal
HTML form below the WebForm and submit that to change the page.


Have tried that, but then I need to populate the action= part of the form
with the values of my variables, which dont seem to get picked up from the
code behind page :o/

Rob
Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3986
by: Paul | last post by:
Hi, Does anyone know how I would be able to drag a single file onto my applications icon and have it run some predefined code. What I want is to drop an .mp3 file onto my applications icon (not the apps form) and perform the necessary actions then give a confirmation when these actions are done then quit.
1
4301
by: Orest Kinasevych | last post by:
Okay, I made sense of the earlier suggestions and realized I was on the right track -- I appreciate the feedback which got me to this point. The suggestions posted here indeed worked and eliminated the JavaScript errors I was seeing. The fact that the target URL didn't execute was because certain variables weren't being passed to it. ...
10
4169
by: DaveFash | last post by:
Posting variables from an HTML FORM, via the Request.Form function on the receiving ASP page is great. But how can you POST a Form variable to an ASP page -- without a human pushing a Submit button? An ASP page that can decide when to POST and send the Form vaiables, but out without a
2
2830
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL record source that returns an ID field and a Text field. Next to each combo box is two buttons, one that 'Applys' the filter of the sub-form to the...
1
2188
by: Dean R. Henderson | last post by:
I have a Windows library that I bind into a Windows Form application and into an ASP.NET Web Application. I have a procedure in the library that executes a DTS Package. I have also used information from Knowledge Base article 306158, INFO: Implementing Impersonation in an ASP.NET Application to create a procedure to perform impersonation. ...
11
2946
by: David W. Simmonds | last post by:
I have a form that will prompt for a user name/password. In VS.NET, I have the protected form in a folder named Admin. I have a Web.config file in that folder as well. It contains the following section: <authorization> <deny users="?" /> <allow users="*" /> </authorization> In the root folder where the other forms are located I have a...
1
10474
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am trying to export to Excel using a command in an Access Form. RowID strFY AccountID CostElementWBS 1 2008 1 ...
5
2430
by: Thelma Roslyn Lubkin | last post by:
I am still having trouble trying to use a popup form to allow user to set filters for the main form. The main form is based on a single table. The popup contains 5 listboxes, so the user can filter on 5 fields in this table, and can include as many field values as s/he needs. The popup is reached from a command button on the main form : ...
4
2732
by: robertallenpayne | last post by:
I have been asked to develop an application in Access for work. This application must have a simple user interface because the folks using it are not "database people" - their words, not mine. One of the "screens" they want to see will display a progress bar. I created the "screen" in a form. I do not currently have it bound to any data...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.