hi, I have a problem with Operator '&'
someone may help me with this problem. thank u :)

Protected Overloads Overrides Sub Render(ByVal writer As HtmlTextWriter)
        If String.IsNullOrEmpty(Name) Then
            Throw New NullReferenceException("Name must be set on a widget")
        End If

        Dim sb As New StringBuilder()

        [B]sb.Append(("<div class=""widget " & Me.Name.Replace(" ", String.Empty).ToLowerInvariant() & """ id=""widget") + WidgetID & """>")

                  sb.Append(("<a class=""delete"" href=""javascript:void(0)"" onclick=""BlogEngine.widgetAdmin.removeWidget('" & WidgetID & "');return false"" title=""") + Resources.labels.delete & " widget"">X</a>")
 [/B]
Member Avatar for Dukane

The concatenation character in VB.NET is the "+", not the "&". Use the "+" instead.

Don't use +. Use & to concatenate strings.

sb.Append(("<div class=""widget " & Me.Name.Replace(" ", String.Empty).ToLowerInvariant() & """ id=""widget") & WidgetID.ToString() & """>")

sb.Append(("<a class=""delete"" href=""javascript<b></b>:void(0)"" onclick=""BlogEngine.widgetAdmin.removeWidget('" & WidgetID.ToString() & "');return false"" title=""") & Resources.labels.delete & " widget"">X</a>")

Thanks guys, this was driving me crazy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.