Click to See Complete Forum and Search --> : visual studio auto generated code
mrvim
December 21st, 2006, 11:37 AM
hello,
is it possible to UNHIDE the auto generated code from visual studio 2005?
some where must exist the following code if i put the textbox on my website:
protected System.Web.UI.WebControls.TextBox TextBoxPassword;
but the line is not available in my test.aspx.cs code - where is it?
if i make the same with visual studio the code exist...
cheers....
TheCPUWizard
December 21st, 2006, 12:29 PM
Which version of Visual Studio. 2005 uses partial classes, so the definition will NOT be in the file.
mrvim
December 21st, 2006, 01:31 PM
hi,
the problem is, i cant compile the cs file with mcs on the linux-mono-machine. mcs error message is:
Login.aspx.cs(39,41): error CS0103: The name `TextBoxPassword' does not exist in the context of `Verwaltung.Login'
when i a add this line:
protected System.Web.UI.WebControls.TextBox TextBoxPassword;
all works fine.... but what should i do, with the other classes there are a lot of elements...
TheCPUWizard
December 21st, 2006, 03:03 PM
For the reading impared....
Which version of Visual Studio?
mrvim
December 22nd, 2006, 03:26 AM
lol
Microsoft Visual Studio 2005 Team Edition for Software Developers
yes, sometimes big red letters are a good choice...
TheCPUWizard
December 22nd, 2006, 06:36 AM
Then the generated code will be in a different (but similar) file name, not the file that contains your custom code.
Shuja Ali
December 22nd, 2006, 07:13 AM
With .NET Framework version 2.0 MS introduced Partial Classes. Which means a Class can be defined in multiple places with its definition spread across multiple files.
Same happens with the classes that VS generates automatically for you. Like the Forms, etc.
In case of the Forms, the other file is hidden at first. You can click on Show All Files Icon in your Solution Explorer and you will see the Form has one more file where all the autogenerated code is saved.
You should also take a look at Partial Classes on MSDN.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.