views:

258

answers:

5

Can we use asp page with master page in asp.net

A: 

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

[Edit]

Maybe you can. Check this out.

[/edit]

Bobby Cannon
+1  A: 

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.

Wayne Hartman
A: 

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.

AdamRalph
A: 

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

jalpesh
A: 

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.

Dominic Zukiewicz