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. Advertisements

  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
     
    Matt Dinovo, Feb 1, 2006
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.