asp.net posting to classic asp problem.

G

Guest

Hi,

We currently have a classic asp web application.

We are currently looking at upgrading this to ASP.NET.

However I have a couple of problems that need to be resolved.

1. aspx forms always post back to themselves. how do I get it to post to
another web page.

2. I have an aspx page with several html text boxes when I submit the form I
need to be able to post to a classic asp page and get the contents of the
text boxes. Normally in classic asp I would do a request.form("controlname"),
how do I achieve this with ASP.Net posting to a classic asp page.
 
P

Patrice

You could use a modified form control that allows to post to another URL
than itself (you'll find likely several on the Internet). You could also
likely alter this using javascript.

That said it's likely better to tweak this only if you have a very solid
reason to. A third option would be to use System.NEt.WebCLient server side
so that the whole process is done using ASP.NET and the ASP page is just
seen as a "service". It could alllow more easily to convert later if
needed...

Hope it helps.
 
S

Steven Cheng[MSFT]

Thanks a lot for Patrice's informative suggestions.

Hi Rob,

In addition to Patrice's sugggestions, here are some of my understandings:

1. The ASP.NET web page use post back( post to self page) is because
that'll make all the things be done in one page and all the related tasks
can be centralized. And we don't have to use multi pages to finish a
certain workflow( what we do in asp). In other words , this may be
considered as the different design concept ion between asp.net and asp.
Also, if you do want to let the aspx page post to another page, you can
use some tricks as Patrice has mentioned, here is a tech article
demonstrate this:

#Post an ASP.NET form with JavaScript
http://www.thecodeproject.com/aspnet/jsnopostback.asp

2. As for you second question, how to retreive the values in the comming
asp.net page's textboxes in classic asp page( yes?). I think this is the
same as what we do between asp page's posting . Because all the asp.net
textbox control is also rendered into html as a <input type=text ...>
element so if the comming request is posted from an asp.net page which
contains some TextBoxes control, we can find their value in the Form
collection, (by default the "name" of the item in Form collection is just
the TExtBoxes's control ID on asp.net page).

If you have any other questions, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top