Често срещани Ajax грешки Prototype and jQuery comparison
Oct 24

Thats something really good! Now in the new Visual Studio 2008 you don’t have to use underscore when writing text on multiple lines. Here is an example how we used to write it:

Dim oldWay = "this is a string" & vbCrLf & _
               "with formatting" & vbCrLf & _
               "and stuff" & vbCrLf & _
               "look ma, underscores" & vbCrLf & _

Now we can do something like that:

Dim newWay = <string>
this is a string
with formatting
and stuff
look ma, no underscores!!!</string>

The text formatting is preserved as well. All you have to do is get the .Value of the XElement, which is the string literal. As you can see this is much cleaner than what we’re used to. And if you still like to see your string literals in the default reddish color, you can easily change the color settings for VB XML literals in Tools –> Options –> Environment –> Fonts and Colors, then select “VB XML Text” and set the custom color to RGB(163,21,21).

Even more, now we can embed expressions using the <%= syntax.

Dim simple = <string>
This is a simple text merge example:
Hello, <%= Environment.UserName %>
                     </string>

Here is Beth Massi’s post about these features! Thanks Beth!

Leave a Reply