Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you looked into Xml literals? You can create the html template like this:</p> <pre><code>Public Function GetTemplate() As String Dim template As String = _ &lt;string&gt; &lt;div style='clear:both;margin-top:50px;'&gt;&lt;/div&gt; &lt;div&gt; &lt;div class='title'&gt;&lt;a href=&lt;%= Me.ArticleURL %&gt;&gt;&lt;%= Me.Title %&gt;&lt;/a&gt;&lt;/div&gt; &lt;div class='picto'&gt;&lt;/div&gt; &lt;div class='article'&gt;&lt;%= Me.Trailer %&gt;&lt;/div&gt; &lt;div style='clear:both;'&gt;&lt;/div&gt; &lt;div&gt; &lt;ul class='comments_box'&gt; &lt;li&gt;&lt;img src='site_images/picto_comments.png' alt='' width='14' height='14' border='0'/&gt;&lt;/li&gt; &lt;li class='comments'&gt;&lt;a href=''&gt;22 Comments&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;img src='site_images/picto_arrow.png' alt='' width='15' height='16' border='0'/&gt;&lt;/li&gt; &lt;li class='arrow'&gt;&lt;a href=''&gt;Share&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;img src='site_images/picto_photo.png' alt='' width='20' height='20' border='0'/&gt;&lt;/li&gt; &lt;li class='login'&gt;&lt;a href=''&gt;&lt;%= Me.Nickname %&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class='time'&gt;59 min ago&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/string&gt;.Value Return template End Function </code></pre> <p>Your "tokens" like &lt;%= Me.ArticleURL %> can be local variables, properties, functions, etc...</p> <p>For more info about xml literals and linqToXml check this sites:</p> <p><a href="http://www.ookii.org/post/xml_literals_in_visual_basic_9.aspx" rel="nofollow noreferrer">http://www.ookii.org/post/xml_literals_in_visual_basic_9.aspx</a></p> <p><a href="http://blogs.msdn.com/bethmassi/archive/2007/10/16/getting-started-with-linq-to-xml.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/bethmassi/archive/2007/10/16/getting-started-with-linq-to-xml.aspx</a></p> <p><strong>UPDATE:</strong> Xml literals only work in VB.NET. If you use C#, you can always have another assembly in vb where you keep all of your xml literals. Thanks for pointing it out <a href="https://stackoverflow.com/users/28260/keltex">Keltex</a></p> <p>Hope this helps,</p> <p>D.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload