473,386 Members | 1,773 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,386 software developers and data experts.

2 Forms on one page

Hi all
I have a to different input masks on one page. The first must be posted on
itself, the second must be posted to another website and popup in a new
window. My problem is, ive got one global form tag (index.aspx). The content
comes from different user controls. The two input masks come from 2
different user controls. My global form tag encloses everything between the
<body>-tags. So what i have to do imho, is to identificate which
submit-button was clicked, and change the form attributes. So i have to
change form attributes after a button was clicked, but before the form gets
posted.

Regards Benjamin
Nov 18 '05 #1
5 2944
Hi Benjamin,

The following article might provide some insight:

Form-based Programming in ASP.NET
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

HTH,

--
Scott
http://www.OdeToCode.com

On Mon, 24 May 2004 09:37:49 +0200, "Benjamin Bittner"
<benjamin_bittner[a_t]nospam.web.de> wrote:
Hi all
I have a to different input masks on one page. The first must be posted on
itself, the second must be posted to another website and popup in a new
window. My problem is, ive got one global form tag (index.aspx). The content
comes from different user controls. The two input masks come from 2
different user controls. My global form tag encloses everything between the
<body>-tags. So what i have to do imho, is to identificate which
submit-button was clicked, and change the form attributes. So i have to
change form attributes after a button was clicked, but before the form gets
posted.

Regards Benjamin


Nov 18 '05 #2
Hi!

Scott Allen wrote:
[...]
Form-based Programming in ASP.NET
http://msdn.microsoft.com/msdnmag/is...e/default.aspx
[...]
<benjamin_bittner[a_t]nospam.web.de> wrote:
[..]
change form attributes after a button was clicked, but before the form gets
posted.

Regards Benjamin


Hum but even this doc leaves a great many questions open.

Imagine a typical invoice/order webform which has many buttons to add
remove change items, change the address of the client, recipient address
and payment stuff. This webform is part of an application with 20 other
larger webforms to create address records, items, payments and billing
stuffs etc.

Such an invoice form has many buttons and some of them lead back to the
same form with the same form variables and some lead to other forms,
also with the form variables.

How to make this in SFI ASP.NET?

I m thinking of another solution, but then my question is:

How can I upon receipt of a pressed button event change the whole
"current page/webform context" to another webform and paste my current
scope of form variables to the other webform, which then runs through
its page creation render termination lifecycle? Or because it is already
just fine living in memory simply forward the request there?
Then when somebody presses a button on the invoice form which requires a
redraw of the invoice form it is fine as usual. But when a button is
pressed which leads to another webform, then .... what? Redirect the
webbrowser to another form with a quazillion bytes long URL? Or can this
happen "in memory", on the Server?

Regards,
Philipp

Nov 18 '05 #3
Server.Transfer(string path, bool preserveForm)

Terminates execution of the current page and begins execution of a new
page using the specified URL path to the page. Specifies whether to
clear the QueryString and Form collections.

Parameters

path -The URL path of the new page on the server to execute.

preserveForm - If true, the QueryString and Form collections are
preserved. If false, they are cleared. The default is false .

-Jason

Philipp Ott wrote:
Hi!

Scott Allen wrote:
[...]
Form-based Programming in ASP.NET
http://msdn.microsoft.com/msdnmag/is...e/default.aspx
[...]
<benjamin_bittner[a_t]nospam.web.de> wrote:
[..]
change form attributes after a button was clicked, but before the
form gets
posted.

Regards Benjamin

Hum but even this doc leaves a great many questions open.

Imagine a typical invoice/order webform which has many buttons to add
remove change items, change the address of the client, recipient address
and payment stuff. This webform is part of an application with 20 other
larger webforms to create address records, items, payments and billing
stuffs etc.

Such an invoice form has many buttons and some of them lead back to the
same form with the same form variables and some lead to other forms,
also with the form variables.

How to make this in SFI ASP.NET?

I m thinking of another solution, but then my question is:

How can I upon receipt of a pressed button event change the whole
"current page/webform context" to another webform and paste my current
scope of form variables to the other webform, which then runs through
its page creation render termination lifecycle? Or because it is already
just fine living in memory simply forward the request there?
Then when somebody presses a button on the invoice form which requires a
redraw of the invoice form it is fine as usual. But when a button is
pressed which leads to another webform, then .... what? Redirect the
webbrowser to another form with a quazillion bytes long URL? Or can this
happen "in memory", on the Server?

Regards,
Philipp

Nov 18 '05 #4
You might be able to pull this off with Server.Transfer: this
technique moves processing to another ASPX page without going back to
the client. All of the state you need to pass along can go into the
HttpContext.Items collection.

A couple more articles to investigate this method:

The HttpContext Items Collection
http://odetocode.com/Articles/111.aspx

Passing Server Control Values Between Pages
http://msdn.microsoft.com/library/de...tweenpages.asp

--s

Then when somebody presses a button on the invoice form which requires a
redraw of the invoice form it is fine as usual. But when a button is
pressed which leads to another webform, then .... what? Redirect the
webbrowser to another form with a quazillion bytes long URL? Or can this
happen "in memory", on the Server?

Regards,
Philipp


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #5
Hi!
Scott Allen schrieb:
You might be able to pull this off with Server.Transfer: this
technique moves processing to another ASPX page without going back to
the client. All of the state you need to pass along can go into the
HttpContext.Items collection.
[...]
Passing Server Control Values Between Pages
http://msdn.microsoft.com/library/de...tweenpages.asp


Thank you for the information. I m reading the infos.

Is it possible to have two or more references in the second page, so
that it can be called from two or more pages?

How can I find out which button was pressed into the first page context?
Can I ask the Context.Handler what it has in its bag?
For example:
<%@ Page Language="C#" Inherits="SecondPageClass" %>
<%@ Reference Page="firstpage.aspx" %>
<%@ Reference Page="otherpage.aspx" %>
void Page_Load()
{
public FirstPageClass fp;
public OtherPageClass op;

if (!IsPostBack)
{
fp = (FirstPageClass) Context.Handler;
op = (OtherPageClass) Context.Handler;
}
}

Thank you,
regards,
Philipp
Nov 18 '05 #6

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

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
11
by: ElmoWatson | last post by:
I tried on the Security newgroup, as well as other places, and haven't gotten an answer yet - - I'm pulling my hair out over this one. I'm trying to get Forms Authentication working.....I can get...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
5
by: Gavin Stevens | last post by:
I'm trying to figure out the ASP.NET Forms Auth I have 3 or 4 pages i want to allow anonymous access to.. Then I have 5 or 6 pages I placed in another directory in the webproject. These I want...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
6
by: Manny Chohan | last post by:
I am using forms authetication in the web config. i can validate a user against a database and click on images which makes hidden panels visible.However when i click on the link inside a panel...
5
by: ~~~ .NET Ed ~~~ | last post by:
Hi, As you all know when an ASP.NET web form is created that will include web controls and such, it contains a FORM that that identifies the web form and its containing controls. Well, I have a...
7
by: Alan Silver | last post by:
Hello, Sorry this is a bit wordy, but it's a pretty simple question... I have a web site, http://domain/ which is a public site, part of which (http://domain/a/) is protected by forms...
5
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.