Can't find Partial Code file

L

Lucky

Hi guys!

it's me againe! this time i'm facing some problem with the .NET 2005
IDE.
i've created one "website" and i've added one webform. now i can see 2
files default.aspx and default.aspx.cs but i can see the "Windows
Generated Code" in CS file.
i searched for it and found that that code is written in the
default.Designer.aspx.cs but what surprised me is THAT FILE DOESNT
EXISTS in my project neigther in the web folder.

anyone know what could be the problem? i need to find out that
InitializeComponent() method to add some custom code for initializing
other component.

please help me out.

Lucky
 
B

Balasubramanian Ramanathan

Hi,

No more .net generated code for aspx pages. its changed in .net 2. the
partial class for the aspx controls will be generated dynamically at
runtime. write your code page_load or oninit.
 
L

Lucky

Thanks Pal,
I had this doubt but i didnt find any blog on that so far and the book
i have says that there is a designer code in different file so i was
quite confused.

thanks for help,
Lucky
 
B

Bruno Alexandre

ASP.NET 2.0 is completelly diferent from ASP.NET 1.1 in that matter


you do not have code written by the VS on files.

when you create a new page you have the chance to have a separate code file
(check the checkbox for that) and choose a master page file (below that
opition).

just add the page to your project add some code inside the DIV tag that is
inside the form like "Hello World", click with the right mouse button and
choose see in browser to see it

the only code that VS add's to the code file (if you choose this options) is
a particial class and in the aspx page it mentions the codefile="" and
inherits=""

in the default.aspx.vb
Partial Class Default2 Inherits System.Web.UI.Page

End Class

and in aspx page:
<%@ Page ... CodeFile="Default2.aspx.vb" Inherits="Default2" ...

if you still have the blue underline, just change the Class Name and the
Inherits to a name without _ (underlines)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top