[MonoDevelop] ASP.NET and partial classes

Michael Hutchinson m.j.hutchinson at gmail.com
Thu Jun 7 20:45:52 EDT 2007


On 6/8/07, Łukasz Zachulski <lzachulski at gmail.com> wrote:
> Hi,
> How can I compile codebehind file with partial class declaration under
> MonoDevelop for ASP.NET project?
>
>
> Every time I try to do this using MD or gmcs I am getting the same error:
>
> Index.aspx.cs(22,25): error CS0103: The name `_tmpControl' does not
> exist in the context of `ScrollbarControl.Pages.Index'

Do you have _tmpControl' declared in another partial class, or are you
expecting it to be autogenerated? MD doesn't do this yet...

However, if you use the CodeFile attribute (<%Page
CodeFile="Index.aspx.cs" Codebehind="ScrollbarControl.Pages.Index" %>)
then the webserver will compile the codebehind for you, including
generating the partial class with control declarations (i.e. you don't
need to compile it in MD).

See http://mjhutchinson.com/journal/2007-06-04/rethinking_asp.net_project_models
for some info on this.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list