![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2004
Posts: 37
Rep Power: 0
![]() |
Cleaning a Place Holder from a class
Hello:
From a class I want clean a place holder contained in a web form. I’m using this code: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace WUC_CreDes { public class Class1 { public static bool Hay_PostBack() { WUC_CreDes.WebForm1 parent1 = (WUC_CreDes.WebForm1) this.Page; parent1.Example.Controls.Clear(); return false; } } } Where “Example” is my place holder within the web form. When I compile my Project it’s sending me this error: “Keyword ‘this’ is not valid in a static property, a static method or as startup of static field”. Does somebody has some idea about how can I attain it? Thanks you in advance. Greetings. A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span> |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Just remove "this".
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Oct 2004
Posts: 37
Rep Power: 0
![]() |
Thanks you Ooble:
Finally I attained it thus: In WebForm1 I do: bool que = WUC_CreDes.Class1.Hay_PostBack(this); And in my class I do: public static bool Hay_PostBack(WUC_CreDes.WebForm1 parent1) { parent1.Example.Controls.Clear(); return false; } But now I need do same from a WUC, if I do: bool que = WUC_CreDes.Class1.Hay_PostBack(this); I understand I need replace 'this' with web form's name, here WebForm1.aspx Somebody know how can I do to attain it?
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span> |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Oct 2004
Posts: 37
Rep Power: 0
![]() |
Finally I attained it changing de call function thus:
bool que = WUC_CreDes.Class1.Lanza(this.Page as WUC_CreDes.WebForm1); Greetings. A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span> Last edited by see07; Mar 15th, 2005 at 10:45 AM. Reason: wrong wording |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|