Reputation:

Possible to use an ASP page with a master page?

Is it possible to use an ASP page with a master page in ASP.NET?

Upvotes: 0

Views: 862

Answers (6)

SawyerWare
SawyerWare

Reputation: 11

Are you still having this issue? There is a really old tool to help convert to the early version of .ASP. Unfortunately, I don't believe this is the best practice to convert to the later versions of asp.net. I am working on a project to convert a classic ASP app, with many, many, pages and it is still using recordsets with an old SQL database. I have found that taking each page's "view source" results and creating a new page inside my VS2010, web project, using a master page to help keep the results consistent across the site works pretty good.

The only issue is that this is very tedious and requires frequent testing to insure the page is consistent with the old page.

Back to the original issue of using Classic ASP in a new ASP.net app, I believe the issue may be resolved by having two application pools, and two applications separate apps on the web server, and referencing the old pages as a link in an iframe. Just a thought...

Cheers

Upvotes: 1

Dominic Zukiewicz
Dominic Zukiewicz

Reputation: 8444

I am having this problem at the moment. Some of the ASP pages are so complex that changes to the site's functionality are way more important than porting some of the more difficult pages.

If you have to work side by side for the time being, slowing moving them over do the following.

  1. Get your business logic in a .NET assembly, "tlbimp.exe" it so it can interop with ASP and then move your page decisions to communicate with this component. This way you can now share business logic and therefore only have the UI data to move.

  2. Pass Session/QueryString data via the DB, not by query string. This means that you should commit your Session/QueryString data to XML or Key/Value pair and store it in the DB (with an expiry time). Then redirect to your ASP with a GUID. There is a potential for someone to hijack the session by grabbing a previous GUID. Therefore have a scheduled job run regularly to clear out session data older than 1 minute.

  3. When transferring to/from .NET, try and make the pages perform their operations before transferring across boundaries. This way the pages can be ported easier. For example lets say .NET displays the order and ASP does the search for a product & adds it to your shopping basket. Make sure that the operations are separate, instead of passing the product across via query string parameters. This way you can then do something like redirect to the order page via query string parameters - http://...../Order.aspx?id= (so long as your user has permission to view the order).

  4. Make sure your ASP code is using stored procedures and not inline SQL as this means code reuse is easier.

  5. I have found creating a dedicated redirect.asp and Redirect.aspx pages are useful as you can see the data passing across the boundaries - its easier for debugging but you'll hear lots of clicks as a user ASP -> ASP_REDIRECT -> ASP.NET_REDIRECT -> ASP.NET.

  6. Globalization is a major problem and has caused problems with our users. Changing a language and redirecting to/from the site in ASP has sometimes caused their language to default to English - and English to Chinese!

There aren't really many ways to ease the transitions, its mainly a case of getting your head down and changing those pages.

Upvotes: 0

Jalpesh Vadgama
Jalpesh Vadgama

Reputation: 14216

You can use master page in asp.net mvc as a shared resource.

Upvotes: 0

Adam Ralph
Adam Ralph

Reputation: 29956

I recommend creating a new ASP.NET MVC (as opposed to WebForms) project and converting all your ASP pages into ASP.NET in a single exercise.

Performing a phased conversion and running a mix of ASP and ASP.NET will cause you sorts of headaches and, although it may be perceived to deliver more quickly, the total cost is likely to be higher than a one-off conversion exercise.

ASP.NET MVC lends itself to conversion from ASP far more nicely than ASP.NET WebForms in most cases.

Upvotes: 0

Wayne Hartman
Wayne Hartman

Reputation: 18477

Unfortunately, not programatically. The closest you could get would be creating a .NET master page and web form, and then embedding your classic asp page via an iFrame.

Upvotes: 2

Bobby Cannon
Bobby Cannon

Reputation: 6923

I don't think so. Are you talking about classic asp? I just found this discussion.

[Edit]

Maybe you can. Check this out.

[/edit]

Upvotes: 0

Related Questions