Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2005, 11:01 PM
Authorized User
 
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form question

I am using .Attributes["src"]="form.aspx" to insert a form into a table cell of page1.aspx. I want form.aspx to post to page1.aspx but even when I declare action="page1.aspx" in form.aspx's form tag it posts to itself. I looked at the source and in the form tag it had form.aspx as the action. What do I have to do to get form.aspx to post to page1.aspx?

 
Old June 30th, 2005, 05:18 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Use a standard postback on the page, then do a Server.Transfer to the desired page. This will serve basically the same purpose. All the posted form values will be available but you'll need to use Request.Form to get at them instead of using member control instances.

-Peter
 
Old June 30th, 2005, 07:15 AM
Authorized User
 
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think that will work because the form action is being reassigned at runtime by VS.

 
Old June 30th, 2005, 07:48 AM
Authorized User
 
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I pulled runat="server" and the child form retained the assigned action. Now it's opening a new instance of the whole project in the iframe. And the page.ispostback is being ignored, bypassed or reset.

 
Old June 30th, 2005, 08:04 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by Scott Rider
 I don't think that will work because the form action is being reassigned at runtime by VS.

Did you try it? The .NET runtime is setting the form action to the same page so that the webform will work using the postback method. That is my whole point. Let it do a regular postback. Then change the behavior on the server processing by transferring page execution to the other page you want to go to.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello! And A Question on Form Opacity... robzyc C# 4 August 1st, 2007 11:05 AM
PHP Form Question IP076 PHP How-To 1 December 8th, 2004 05:12 AM
Form question dsealer Access 7 September 14th, 2004 12:36 PM
Login form question Jams30 PHP Databases 1 December 4th, 2003 12:10 PM
form / listbox question nkrukovsky Access VBA 2 November 4th, 2003 09:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.