RE: Theming custom created WebParts in ASP.NET 2.0

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I get your point about using simple strings. One thing though, say you expose
a color, this can be specified using a name like 'Red' or it may be specified
using hex notation, like '#FFCC66'. The controls require a Color object, how
does one map between the different representations and the Color object. Are
there any utility classes I can use?

I have now done a bit more experimenting. If I declaratively add the webpart
to a webpartzone, then the theme is correctly applied. If I add the same
webpart to the zone using a catalog, the style is not applied. The catalog
I'm adding from is a custom created one, not one of the predefined types.

Any suggestions?

"Steven Cheng[MSFT]" wrote:

> Hi c_kimbell,
>
> Thanks for your followup.
> As you mentioned that
> =================
>
>
> 1. On the webpart I have exposed the Calendar as a property with the name
> FromCalendar.
> 2. I have added the following to the .skin file
>
> <%@ Register Assembly="IMK.WebParts" Namespace="IMK.WebParts"
> TagPrefix="IMK" %>
>
> <IMK:IMKDateWebPart runat="server">
> <FromCalendar BackColor="#FFFFCC">
> <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
> <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
> ForeColor="#FFFFCC" />
> </FromCalendar>
> </IMK:IMKDateWebPart>
> =======================
>
> I'm not sure whether this will cause error since I haven't tested it.
> However, IMO, I'd prefer expose a single string property on my custom web
> control which represent the nested child calendar's Theme(or
> stylesheettheme). Since the ASP.NET 2.0 's Theme are mostly for those
> simple type properteis (such as string, int), I think just exposing a
> single string type property will be much better). You can do the actual
> Theme adjusting in the Property's Setter method.
> How do you think ?
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
.



Relevant Pages

  • Re: Is this good use of Properties?
    ... >>> is a property bag which is not a valid class. ... String has no application domain, ... >>No-one has suggested that all classes should expose everything about ... I still don't see your points Rick. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is this good use of Properties?
    ... The idea that a class should be able to draw itself just in case ... >> is a property bag which is not a valid class. ... String has no application domain, ... >No-one has suggested that all classes should expose everything about ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Overloading in ooRexx
    ... working on getting my mind around the simplicity of Rick's suggested class, and trying to figure out "how it understands" to do so much with so little code. ... like the string method for example. ... expose value use arg value ...
    (comp.lang.rexx)
  • Re: Is this good use of Properties?
    ... >> practice Pattern example to use Properties instead of telling the ... Never expose the length of the string ... design then not doing it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: OOP question - multiple value properties
    ... With 2.0, you could create a generic type, which you would use to expose ... >> string Description; ... >>> public class Person { ... >>> public DateTime Date ...
    (microsoft.public.dotnet.languages.csharp)