Note that there are some explanatory texts on larger screens.

plurals
  1. POchange item template in ASP.NET grid view related to fields value
    primarykey
    data
    text
    <p>i have a grid view to show my blog posts, my posts are in video,image,text format and each has html template that is different with another:</p> <p>html:</p> <pre><code>&lt;!-- Image Format --&gt; &lt;div class="post format-image box"&gt; &lt;div class="frame"&gt; &lt;a href="post.html"&gt; &lt;img src="Templates/images/art/post1.jpg" alt="" /&gt; &lt;/a&gt; &lt;/div&gt; &lt;h2 class="title"&gt;&lt;a href="post.html"&gt;Morning Glory&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;text&lt;/p&gt; &lt;div class="details"&gt; &lt;span class="icon-image"&gt;&lt;a href="#"&gt;September 26, 2012&lt;/a&gt;&lt;/span&gt; &lt;span class="likes"&gt;&lt;a href="#" class="likeThis"&gt;44&lt;/a&gt;&lt;/span&gt; &lt;span class="comments"&gt;&lt;a href="#"&gt;3&lt;/a&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Video Format --&gt; &lt;div class="post format-video box"&gt; &lt;div class="video frame"&gt; &lt;iframe src="http://player.vimeo.com/video/40558553?title=0&amp;byline=0&amp;portrait=0" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;h2 class="title"&gt;&lt;a href="post.html"&gt;Fragments of Iceland&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;text&lt;/p&gt; &lt;div class="details"&gt; &lt;span class="icon-video"&gt;&lt;a href="#"&gt;September 13, 2012&lt;/a&gt;&lt;/span&gt; &lt;span class="likes"&gt;&lt;a href="#" class="likeThis"&gt;18&lt;/a&gt;&lt;/span&gt; &lt;span class="comments"&gt;&lt;a href="#"&gt;1&lt;/a&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Text Format --&gt; &lt;div class="post format-standard box"&gt; &lt;h2 class="title"&gt;&lt;a href="post.html"&gt;The Meridian Sun&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;text&lt;/p&gt; &lt;p&gt;text&lt;/p&gt; &lt;div class="details"&gt; &lt;span class="icon-standard"&gt;&lt;a href="#"&gt;August 13, 2012&lt;/a&gt;&lt;/span&gt; &lt;span class="likes"&gt;&lt;a href="#" class="likeThis"&gt;11&lt;/a&gt;&lt;/span&gt; &lt;span class="comments"&gt;&lt;a href="#"&gt;0&lt;/a&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>as you know if i want to have list of my posts in usually way i should add grid view with item template and set my template in it, but as you see i have 3 templates for my records, and i have a field in my table called 'PostMode' that accepts 3 string : Video, Image, Text. now my question is how can i use 3 templates in item template that if my record was Video display video template and if it was Text display Text format in my blogs list.</p>
    singulars
    1. This table or related slice is empty.
    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