Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 December 23rd, 2005, 10:07 AM
Authorized User
 
Join Date: Oct 2004
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving Code behind in another folder Visual Studio

Hai,

    I have a module "Country"

    I want to store the code behind file in another folder say "CodeBehind". So I used the Src instead of CodeBehind.

<%@ Page language="c#" Src="CodeBehind/countryListing.aspx.cs" AutoEventWireup="false" Inherits="Admin.Country.countryListing" %>

    But the aspx page is not opening in Design view in Visual Studio .Net

Anybody have idea on saving Code behind in another folder in Visual Studio .Net

Thanks!
 
Old December 23rd, 2005, 10:21 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The "CodeBehind" attribute in the page tag tells visual studio where the code-behind file lives. This attribute is for the convenience of visual studio only.

The "Src" tag tells the ASP.NET engine that you want that ASPX page to compile the referenced file. It does not make any direct link between the file referenced and the file referencing it.

The "Inherits" attribute tells the ASP.NET engine what class the ASPX page should derive from. The desired class can live in the code file referenced by the "Src" file or in any assembly found in the application's \bin folder or in the .NET global assembly cache (that's where System and System.* are found).

If your goal is to "hide" the code files used for the pages just precompile everything so you don't have to distribute the code-behind.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using ASP.NET Code-Behind Without Visual Studio.NE rupen ASP.NET 1.0 and 1.1 Basics 0 October 12th, 2005 05:21 AM
Using Visual Studio vb.Net to build code sirandre007 Classic ASP Basics 1 March 28th, 2005 07:52 PM
Visual Studio solution file for sample code? davem1958 ASP.NET 1.0 and 1.1 Professional 1 October 10th, 2003 12:06 PM





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