W
wASP
Hello everyone,
I'm new to C# and ASP.NET, so pardon my stupidity on this one.
I'm having a problem with referencing methods/functions external
to a class member function.
My code is as follows:
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
/* - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - */
public class ccp_01 : base_create_ctrl_pair
{
public ccp_01 (ControlCollection pram_ph01_ctrl)
: base (pram_ph01_ctrl) {}
//{ base_create_ctrl_pair (pram_ph01_ctrl); }
public void create_ctrl_pair_01 ()
{ create_ctrl_pair_0x
("UserTextBox1", "DButton01", "Submit 01");
button0x.Click += new EventHandler (Submit_Click);
if (!Page.IsPostBack)
init_single_line_text_box (UserTextBox0x, 22);
ph01_ctrl.Add ( new LiteralControl("<br><br>") );
}
}
/* - - - - - - - - - - - - - - - - - - - - - - */
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
/* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */
public void Submit_Click(Object sender, EventArgs e)
{ // Retrieve the UserTextBox TextBox control from the TextBoxControlPlaceHolder
// PlaceHolder control.
TextBox TempTextBox
= (TextBox)TextBoxControlPlaceHolder.FindControl("UserTextBox1");
// Display the Text property.
Message.Text
= submit_click_str01 + '1' + submit_click_str02 + TempTextBox.Text;
}
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
The compiler issues diagnostics, and they are as follows
(with the offending lines in square brackets):
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\csc.exe"
/t:library /utf8output
/R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a
\system.enterpriseservices.dll"
/R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll"
/R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll"
/R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll"
/R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll"
/R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll"
/R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll"
/R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll"
/R:"c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll"
/out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
\webfolder01\08460e05\9c82db3e\rdoqxnq-.dll"
/debug- /optimize+ /warnaserror
/w:1 "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
\webfolder01\08460e05\9c82db3e\rdoqxnq-.0.cs"
Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
I:\Virtual Webfolders\ViewState02.aspx(123,50): error CS0038:
Cannot access a nonstatic member of outer type 'ASP.ViewState02_aspx'
via nested type 'ASP.ViewState02_aspx.ccp_01'
[button0x.Click += new EventHandler (Submit_Click);]
I:\Virtual Webfolders\ViewState02.aspx(125,19): error CS0120:
An object reference is required for the nonstatic field, method,
or property 'System.Web.UI.Page.IsPostBack'
[if (!Page.IsPostBack)]
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
This is probably a piece of cake for most of you.
Can anyone clue me in as to what I need to do to make the external references?
Thanks In Advance.
- wASP
I'm new to C# and ASP.NET, so pardon my stupidity on this one.
I'm having a problem with referencing methods/functions external
to a class member function.
My code is as follows:
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
/* - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - */
public class ccp_01 : base_create_ctrl_pair
{
public ccp_01 (ControlCollection pram_ph01_ctrl)
: base (pram_ph01_ctrl) {}
//{ base_create_ctrl_pair (pram_ph01_ctrl); }
public void create_ctrl_pair_01 ()
{ create_ctrl_pair_0x
("UserTextBox1", "DButton01", "Submit 01");
button0x.Click += new EventHandler (Submit_Click);
if (!Page.IsPostBack)
init_single_line_text_box (UserTextBox0x, 22);
ph01_ctrl.Add ( new LiteralControl("<br><br>") );
}
}
/* - - - - - - - - - - - - - - - - - - - - - - */
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
/* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- */
public void Submit_Click(Object sender, EventArgs e)
{ // Retrieve the UserTextBox TextBox control from the TextBoxControlPlaceHolder
// PlaceHolder control.
TextBox TempTextBox
= (TextBox)TextBoxControlPlaceHolder.FindControl("UserTextBox1");
// Display the Text property.
Message.Text
= submit_click_str01 + '1' + submit_click_str02 + TempTextBox.Text;
}
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
The compiler issues diagnostics, and they are as follows
(with the offending lines in square brackets):
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\csc.exe"
/t:library /utf8output
/R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a
\system.enterpriseservices.dll"
/R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll"
/R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll"
/R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll"
/R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll"
/R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll"
/R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll"
/R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll"
/R:"c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll"
/out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
\webfolder01\08460e05\9c82db3e\rdoqxnq-.dll"
/debug- /optimize+ /warnaserror
/w:1 "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
\webfolder01\08460e05\9c82db3e\rdoqxnq-.0.cs"
Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
I:\Virtual Webfolders\ViewState02.aspx(123,50): error CS0038:
Cannot access a nonstatic member of outer type 'ASP.ViewState02_aspx'
via nested type 'ASP.ViewState02_aspx.ccp_01'
[button0x.Click += new EventHandler (Submit_Click);]
I:\Virtual Webfolders\ViewState02.aspx(125,19): error CS0120:
An object reference is required for the nonstatic field, method,
or property 'System.Web.UI.Page.IsPostBack'
[if (!Page.IsPostBack)]
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
This is probably a piece of cake for most of you.
Can anyone clue me in as to what I need to do to make the external references?
Thanks In Advance.
- wASP