Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 May 25th, 2005, 08:25 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to convert my asp.net code to code behind

Hi every body. Is there a way to convert my asp.net code to code behind like the one in visual studio.net 2003 and be able to open it using visual studio.net 2003 and be able to update and modify the code easily without writin the code from start.Looking forward for some tutorials and responses.Thanks
 
Old May 25th, 2005, 11:24 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

You dont need to do much. Just create a Visual Studio Project and drag your page onto the project explorer. It will ask you whether to create a code behind file or not. Say "Yes" and Visual Studio will create the class file for you. Once it is created, you can copy your methods from the aspx file to the class file.

Regards
Ganesh
 
Old June 1st, 2005, 06:46 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Keep in mind that you may need to add some details to the @ Page directive to indicate the ASPX files should not inherit from the classes that are created in the code-behind files. Also, because the methods to handle control events in the page most likely do not have access modifiers (Public, Private, Protected) you may also need to add those as appropriate so that the controls can see the methods in the inherited code-behind class. I forget off hand what the default access is for a method that does not have an explicit access modifier but if it is Private then your event handlers may not fire as expected.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net code sabbir ASP.NET 2.0 Basics 2 July 31st, 2007 06:58 PM
Can'T find code to Beginning Asp.net using VB.NET darruler All Other Wrox Books 1 August 12th, 2004 05:04 PM
ASP.NET Using VB.NET Chapt 3 Code error? uh6uj All Other Wrox Books 1 February 26th, 2004 10:46 AM
Help 'beginning asp.net using vb.net' source code jkmf Wrox Book Feedback 1 January 18th, 2004 08:09 AM
help convert this code from asp to php rehana SQL Server 2000 0 December 12th, 2003 03:06 PM





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