Avatar of KFurness
KFurness asked on

ASP.NET C# Submit to Multiple Forms

I have a bit of a problem whereby I have single web page with 3 list boxes and 3 buttons on it.

The list boxes are dynamic based on what was selected in their parent list box. The list boxes use the "__DoPostBack" function for updating.

When I select an option from one of the lists I can click a button that post the data to one of 3 web pages to display a different reports in a new window using Target="_blank" .

However, this is okay until I go back to the main calling page and select another option from one of the list. At which point in opens up in a new window.

I have try to use an overrider to the "__DoPostBack" function but this does not work correctly .

Can anyone help
ASP.NET

Avatar of undefined
Last Comment
KFurness

8/22/2022 - Mon
Sammy

You can only have one form in asp.net
overriding the postback script is not a recommended solution at all
if you post  your code, we may be able to help you out finding a solution
ASKER
KFurness

I have 3 list boxes on a page

Area
Organisation
Individual

When you select Area is shows all the organisations in that area.  When you select Organisation it shows all Individuals in the organisation.  Area and Organisation are update using the  "__DoPostBack" function.

At the right of each list is a button which opens a new window to display the relevant report.

Problem is if I set the target to "_blank" it does open the reports however when I come back and select another Area or Organisation it also loads in a new window.

Hope this clarifies without the need of any code


ydramu

So you want to have the report selected second time also get populated in the same report window which was opened at the first report request???
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER
KFurness

Basically I need to use the page with the list boxes as a means to generate reports in a new window.
A new report can overwrite the old one or even open up in a new window.  

ydramu

In your post, you are saying that the problem you have is, in your words only:

"Problem is if I set the target to "_blank" it does open the reports however when I come back and select another Area or Organisation it also loads in a new window."

And the recent post saying.

A new report can overwrite the old one or even open up in a new window.


So I could not able to understand where you feel the issue is, if the new report opening in new window, then what is the problem you have?
ASKER
KFurness

Let me start again

I have a single aspx page that has a 3 list boxes on it (area, organisation and employee etc).  using these I wish to create a number of reports each to open in a new window.   When a list item is selected it updates the other lists (e.g. changing the area lists the organisations).  Updating these lists is done using the "__DoPostBack" function.

If I try to change the Target in my button click event it open the report in a new window (great!!).  However if I then go back to the main page and select another item in one of the lists, it opens a new window showing a duplicate of the lists. So I have now 2 pages with lists

basically all I need is a single control page where the list can be changed and generate reports in new windows.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
KFurness

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question