CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!
Free 3 Months



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 7/23/2005 9:06:19 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 24 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
Fredrik K
Asp.Net User
Adding codebehind file7/23/2005 9:06:19 AM

0/0

I often find myself in the position where I've initially thought a page doesn't require a codebehind page, and thus untick the "place code in separate file" box when I "add new item"... then later realise that I'd like to have it after all. I'm using VS2005 Express, and I can't seem to find any menu choice for "add codebehind" to a given file - that would be very useful instead of manually having to add the .cs and hook it up to the page :)

Is there such an option hidden away somewhere?

Or should I just always tick the box? I just have this idea stuck in my head that it's better/cleaner/faster not to if you're not gonna use it :)
Blog: http://blog.iridescence.no
BrockAllen
Asp.Net User
Re: Adding codebehind file7/23/2005 3:52:41 PM

0/0

1) Create a new class in your project and do not put it in App_Code
2) Derive that class from System.Web.UI.Page
3) Change your @Page directive in the ASPX by adding CodeFile="YourNewFile.cs/vb" and Inherits="NamespaceOfNewClass.NameOfNewClass"

-Brock

DevelopMentor
http://staff.develop.com/ballen
Fredrik K
Asp.Net User
Re: Adding codebehind file7/25/2005 8:25:42 AM

0/0

I realise you can do it the way you've described, BrockAllen - what I was wishing for was a shortcut buildt into the IDE (f.ex, if one could right-click a file in the file explorer and select "Add Codebehind" and have the IDE add update the Page directive and all that) - and also, wether having an empty codebehind file (in case you might need it later) is considered bad practice?

cheers :)
Fredrik


Blog: http://blog.iridescence.no
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Microsoft Expression Blend Bible: The Book You Need to Succeed! Authors: Gurdy Leete, Pages: 734, Published: 2007
Beginning Visual Web Programming in VB .NET: From Novice to Professional Authors: Daniel Cazzulino, Craig Bowes, Victor Garcia Aprea, Mike Clark, James Greenwood, Chris Hart, Pages: 648, Published: 2005
Beginning DotNetNuke 4.0 Website Creation in C# 2005 with Visual Web Developer 2005 Express: From Novice to Professional Authors: Nick Symmonds, Pages: 391, Published: 2006
Programming C#: Building .NET Applications with C# Authors: Jesse Liberty, Pages: 644, Published: 2005
Beginning ASP.NET 1.1 with Visual C# .NET 2003 Authors: Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry, Pages: 888, Published: 2004
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Beginning ASP.NET 1.1 with VB.NET 2003 Authors: Chris Ullman, John Kauffman, Chris Hart, David Sussman, Pages: 888, Published: 2003
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Professional Web Parts and Custom Controls with ASP.NET 2.0 Authors: Peter Vogel, Pages: 449, Published: 2005
Visual Basic 2005: How to Program Authors: Harvey M. Deitel, Pages: 1513, Published: 2006

Web:
Adding Code-Behind Files to Master Pages and Page Layouts in ... Summary: Learn to use code-behind files within master pages and page layouts that are used in Microsoft Office SharePoint Server (MOSS) 2007 Web content ...
Adding Code-Behind Files to Master Pages and Content Pages in ... Summary: Learn how to use code-behind files in custom content pages in Windows SharePoint Services 3.0.
Mikhail Arkhipov (MSFT)'s WebLog : How to add code behind file to ... Apr 13, 2006 ... If you have an existing page that uses code inline and want to associate a code file with it, do the following: 1. Assuming that name of the ...
One-stop for information related to SharePoint: How to add Code ... Adding code-behind files in ASPX or ASCX files within a traditional ASP.NET 2.0 environment is quite simple thanks to Microsoft Visual Studio. ...
Adding CodeBehind for Global.asax file in asp.net 2.0 We need to explicitly add a new class file with the name Global.cs and inherit it with System.Web.HttpApplication [As the Global.asax codebehind file in ...
Codebehind files in ASP.NET MVC *ARE NOT* evil - LA.NET [EN] There are times when a code-behind file is absolutely necessary. For those times , I'd like to see a right-click to add the code-behind. ...
Macro to add a Codebehind file to an ASPX page in VS2005 - Jon ... The problem: If you're working with a page wasn't created with a codebehind file , there's no "right-click / add code file" option. ...
Minimizing code behind in ASP.NET 2.0 - Onion Blog - Pluralsight Blogs What I'd really like to be able to do is right-click on a .aspx file with no associated code behind file in my Solution Explorer and say 'Add code behind'. ...
How to work with code-behind class files in an ASP.NET application ... In the code-behind file, add the following code to the Page_Load event: .... If you do not precompile the code-behind class file and do not add the Src ...
ASP.NET - Wikipedia, the free encyclopedia Code-behind files typically have names like MyPage.aspx.cs or MyPage.aspx.vb based ..... NET 2.0 CSS Control Adapters, a free add-on that produces compliant ...

Videos:
Zero Configuration networking with Bonjour Google TechTalks November 2, 2005 Dr. Stuart Cheshire, Apple Computer http://www.stuartcheshire.org/ ABSTRACT The desirability of making ...
An Introduction to Visual Studio .NET And C# Windows Forms ... An introduction to the Visual Studio .NET 2005 development environment with a bias to programming windows forms with C#. We look at resources ...
[Tutorial] Hosting games in unreal tournament 3 Click on more info please I thought about posting this video because there isnt much information about this on the internet, and there is no ...
Spell Menu using TSFC This video shows an Oblivion mod which adds a spell menu with your own categories. This plugin uses TSFC, an extension to the Oblivion ...




Search This Site:










how to use windows authentication with active directory in asp.net?

is customizable field level security possible?

accessing secure area of website from image link

complex roles and views - need advice

resetting client credentials to force re-authentication

what is the default encryption for password in asp.net configuration?

directoryentry.invoke() makes aspnet_wp.exe hang at 100% cpu

help login fails despite information in sql 2005 updated properly

looking for guide for membership/my account

add <membership> tag

simple login... if possible?!!

content for specific user logins

add/edit/delete data rules for user login account

profile object not picking up username or isannomymous

what's wrong with my code?

windows authentication box appears

error "document not saved" while automating excel

query string encryption

how to set multiple login pages in forms authentication?

problem with sqltableprofileprovider

secure query string

web service as a membership provider

email validation

profileparameter control

activation codes generator ?

using webapp cache in seperate assembly

asp.net 2.0 login form problem

very strange iis7 behavior when using forms authentication

configure under specific credentials. how?

secure connection causing problems

  Privacy | Contact Us
All Times Are GMT