My user's requirement is simple: have two buttons on the page, one that displays a PDF in a new window, and another that performs a calculation and displays the result in the same window. If I set
Form.Target = "_blank";
in the Page_Init, it puts the results for both buttons in a new window. If I leave it alone, it puts both of them in the same window. As far as I can tell, I need two forms with separate targets, one for each button, but all my searchy-fu seems to indicate that this is not possible with ASP.Net. Has anyone done anything like this?
No, ASP.NET requires only one. If you add another form tag, it won't have viewstate.
Like Christian said, ASP.NET only allows for a single Form tag per page.
But, it would require restructing your site and code, you could use straight HTML or some other framework, like MVC, which doesn't have the single form limit.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)