I have a property set in my templated custom control as follows
public System.Drawing.Color tableColor;
public System.Drawing.Color TableColor
{
set
{
tableColor = value;
}
get
{
return tableColor;
}
}
In my Page Code, I would like to set the property to the color I want, Like
this (Except using code that works)
<cc:SpacerControl id="SpacerControl1"
TableColor="System.Drawing.Color.Red" runat="server">
<ItemTemplate>
Spacer Control
</ItemTemplate>
</cc:SpacerControl>
Is this possible???
Thanks
Earl 4 2934
This will not work.
You will have two publicly defined things (I can't think of the term) that
are cardinally the same.(only differ in case)
tableColor and TableColor.
So when the .aspx parser is executing, it doesn't know what to set. The
field called tableColor or the property called TableColor.
One solution is to declare the field private, or come up with another name.
Also I belive you can get away in your aspx file from just assigning
TableColor="red"
HTH,
bill
"Earl Teigrob" <ea******@hotmail.com> wrote in message
news:uJ**************@TK2MSFTNGP10.phx.gbl... I have a property set in my templated custom control as follows
public System.Drawing.Color tableColor; public System.Drawing.Color TableColor { set { tableColor = value; } get { return tableColor; } }
In my Page Code, I would like to set the property to the color I want,
Like this (Except using code that works)
<cc:SpacerControl id="SpacerControl1" TableColor="System.Drawing.Color.Red" runat="server"> <ItemTemplate> Spacer Control </ItemTemplate> </cc:SpacerControl>
Is this possible???
Thanks
Earl
Bill, you are correct, the field defintion was supposted to be private, not
public. I just created this example for demonstration purposes and missed
that...and yes, just assigning the enum name worked fine...
Earl
"William F. Robertson, Jr." <wf*********@kpmg.com> wrote in message
news:uU**************@TK2MSFTNGP09.phx.gbl... This will not work.
You will have two publicly defined things (I can't think of the term) that are cardinally the same.(only differ in case)
tableColor and TableColor.
So when the .aspx parser is executing, it doesn't know what to set. The field called tableColor or the property called TableColor.
One solution is to declare the field private, or come up with another
name. Also I belive you can get away in your aspx file from just assigning TableColor="red"
HTH,
bill
"Earl Teigrob" <ea******@hotmail.com> wrote in message news:uJ**************@TK2MSFTNGP10.phx.gbl... I have a property set in my templated custom control as follows
public System.Drawing.Color tableColor; public System.Drawing.Color TableColor { set { tableColor = value; } get { return tableColor; } }
In my Page Code, I would like to set the property to the color I want, Like this (Except using code that works)
<cc:SpacerControl id="SpacerControl1" TableColor="System.Drawing.Color.Red" runat="server"> <ItemTemplate> Spacer Control </ItemTemplate> </cc:SpacerControl>
Is this possible???
Thanks
Earl
So then what was your question? I wasn't trying to nit pick your code, I
wasn't sure if that is what you were driving at.
bill
"Earl Teigrob" <ea******@hotmail.com> wrote in message
news:e1*************@TK2MSFTNGP12.phx.gbl... Bill, you are correct, the field defintion was supposted to be private,
not public. I just created this example for demonstration purposes and missed that...and yes, just assigning the enum name worked fine...
Earl "William F. Robertson, Jr." <wf*********@kpmg.com> wrote in message news:uU**************@TK2MSFTNGP09.phx.gbl... This will not work.
You will have two publicly defined things (I can't think of the term)
that are cardinally the same.(only differ in case)
tableColor and TableColor.
So when the .aspx parser is executing, it doesn't know what to set. The field called tableColor or the property called TableColor.
One solution is to declare the field private, or come up with another name. Also I belive you can get away in your aspx file from just assigning TableColor="red"
HTH,
bill
"Earl Teigrob" <ea******@hotmail.com> wrote in message news:uJ**************@TK2MSFTNGP10.phx.gbl... I have a property set in my templated custom control as follows
public System.Drawing.Color tableColor; public System.Drawing.Color TableColor { set { tableColor = value; } get { return tableColor; } }
In my Page Code, I would like to set the property to the color I want, Like this (Except using code that works)
<cc:SpacerControl id="SpacerControl1" TableColor="System.Drawing.Color.Red" runat="server"> <ItemTemplate> Spacer Control </ItemTemplate> </cc:SpacerControl>
Is this possible???
Thanks
Earl
Bill, You answered my question, Thank You! I was getting to complicated in
trying to assign an enum value. Just use the value itself. Thats all I
needed.
Earl
"William F. Robertson, Jr." <wf*********@kpmg.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl... So then what was your question? I wasn't trying to nit pick your code, I wasn't sure if that is what you were driving at.
bill
"Earl Teigrob" <ea******@hotmail.com> wrote in message news:e1*************@TK2MSFTNGP12.phx.gbl... Bill, you are correct, the field defintion was supposted to be private, not public. I just created this example for demonstration purposes and
missed that...and yes, just assigning the enum name worked fine...
Earl "William F. Robertson, Jr." <wf*********@kpmg.com> wrote in message news:uU**************@TK2MSFTNGP09.phx.gbl... This will not work.
You will have two publicly defined things (I can't think of the term) that are cardinally the same.(only differ in case)
tableColor and TableColor.
So when the .aspx parser is executing, it doesn't know what to set.
The field called tableColor or the property called TableColor.
One solution is to declare the field private, or come up with another
name. Also I belive you can get away in your aspx file from just assigning TableColor="red"
HTH,
bill
"Earl Teigrob" <ea******@hotmail.com> wrote in message news:uJ**************@TK2MSFTNGP10.phx.gbl... > I have a property set in my templated custom control as follows > > public System.Drawing.Color tableColor; > public System.Drawing.Color TableColor > { > set > { > tableColor = value; > } > get > { > return tableColor; > } > } > > In my Page Code, I would like to set the property to the color I
want, Like > this (Except using code that works) > > <cc:SpacerControl id="SpacerControl1" > TableColor="System.Drawing.Color.Red" runat="server"> > <ItemTemplate> > Spacer Control > </ItemTemplate> > </cc:SpacerControl> > > Is this possible??? > > Thanks > > Earl > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Amir Eshterayeh |
last post by:
Dear Friends
Hope things goes well to you. I have this problem. Would you please give me
your solution?
I want to change a property that I define on my user control in my web form
that contains...
|
by: Russell |
last post by:
Morning,
I have been having trouble with a my embedded user control not being
able to see the view state that I set in its parent page.
I have done a test with the following and I still cant...
|
by: Earl Teigrob |
last post by:
I have a custom control that creates a textarea child control and diplays it
to the user. The control is defined as follows
System.Web.UI.HtmlControls.HtmlTextArea TextArea1;
I have a property...
|
by: jahyen |
last post by:
I'm having trouble getting my custom control to save properties that are
decorated with the PersistenceMode.InnerProperty attribute. The properties
that are saved with PersistenceMode.Attribute...
|
by: Ed Bick |
last post by:
I built a custom control. It has one custom property that I created
exposed. What I want to do though is to have the property show as a
dropdown with only a limited number of choices for...
|
by: Italian Pete |
last post by:
Hi,
I have a div control on an aspx page. I toggle the display property between
'block' and 'none' client side using the following javascript:
function toggleDivOnOff(divID) {
var x =...
|
by: rs36718 |
last post by:
Hi,
I have page called PageMain with an Iframe, and I will load a child page named PageChild into Iframe on click of a hyperlink.
Now I want to read a control/property/method of a PageMain from...
|
by: AleXmanFree |
last post by:
Hi , I have got problem with passing my inline based value to y user
control (or custom control, no matter which one I use, I have tried
both to make sure it doesnt matter) .
So say I have...
|
by: AleXmanFree |
last post by:
Hi , I have got problem with passing my inline based value to y user
control (or custom control, no matter which one I use, I have tried
both to make sure it doesnt matter) .
So say I have...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |