why the error ?

Discussion in 'ASP .Net Building Controls' started by Jon Paal, Feb 1, 2006.

  1. Jon Paal

    Jon Paal Guest

    why the error ?

    Compiler Error Message: BC30452: Operator '&' is not defined for types 'System.Web.UI.WebControls.FontUnit' and 'String'.

    Source Error:


    Line 203: writer.AddAttribute("border", "1")
    Line 204: writer.AddAttribute("style", ("FONT-SIZE: " _
    Line 205: & (Font.Size & (";FONT-FAMILY: " _
    Line 206: & (Font.Name & ";BORDER-COLLAPSE: collapse")))))
    Line 207: writer.AddAttribute("borderColor", "#000000")

    Source File: C:\..\test.vb Line: 205
     
    Jon Paal, Feb 1, 2006
    #1
    1. Advertising

  2. Jon Paal

    Matt Dinovo Guest

    You need to add a .ToString() to the Font.Size statement. Example:

    & (Font.Size.ToString() & (";FONT-FAMILY: " _

    Also, based on what you're doing, you probably want to use the
    Font.SizeInPoints property.

    HTH,

    Matt Dinovo

    "Jon Paal" <Jon nospam Paal @ everywhere dot com> wrote in message
    news:%23VYR6$...
    > why the error ?
    >
    > Compiler Error Message: BC30452: Operator '&' is not defined for types
    > 'System.Web.UI.WebControls.FontUnit' and 'String'.
    >
    > Source Error:
    >
    >
    > Line 203: writer.AddAttribute("border", "1")
    > Line 204: writer.AddAttribute("style", ("FONT-SIZE: " _
    > Line 205: & (Font.Size & (";FONT-FAMILY: " _
    > Line 206: & (Font.Name & ";BORDER-COLLAPSE:
    > collapse")))))
    > Line 207: writer.AddAttribute("borderColor", "#000000")
    >
    > Source File: C:\..\test.vb Line: 205
    >
    >
    >
     
    Matt Dinovo, Feb 1, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGltOjouLg==?=

    Why, why, why???

    =?Utf-8?B?VGltOjouLg==?=, Jan 27, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    573
    Juan T. Llibre
    Jan 27, 2005
  2. Horace Nunley

    why why why does function not work

    Horace Nunley, Sep 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    465
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 27, 2006
  3. Mr. SweatyFinger

    VWD why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    384
    =?Utf-8?B?Q2lhcmFuIE8nJycnRG9ubmVsbA==?=
    Dec 21, 2006
  4. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    912
    Mark Rae
    Dec 21, 2006
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,007
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page