Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I wonder if there is someone who can help me on this quest! :) here is my code:

<div id="container">
<div class="images">
        <%  for (int i = 0; i < images.Count; i++)
                Response.Write("<li><a target=\"_blank\" href=\"" + images[i].ImageLink + "\"><img src=\"" + images[i].ImageUrl + "\" id=\"img_" + i + "\" alt=\"" + images[i].ImageUrl + "\" title=\"" + images[i].ImageDesc + "\"/></a></li>");

This is a web part that I've deployed into my site: "http://site.com" I also added this web part into the default page: "http://site.com/default.aspx" Then I've created a wiki page: "http://site.com/SitePages/wpg.aspx" And added the same web part there!!

On the site I have this code:

<div id="container">
<div class="images">
        <li><a target="_blank" href=""><img src="http://s9.postimage.org/5309ep30v/symbol_error.png" id="img_0" alt="http://s9.postimage.org/5309ep30v/symbol_error.png" title=""/></a></li>

and on the page I have this one:

BUT THE LIST ITEM WAS CREATED MORE ON THE TOP!!! here (check the mid line):

<div class="ms-wikicontent ms-rtestate-field" style="padding-right: 10px"><div class="ExternalClass488AD6F7CAD342589EA01EF13B437513"><table id="layoutsTable" style="width:100%"><tbody><tr style="vertical-align:top"><td style="width:100%"><div class="ms-rte-layoutszone-outer" style="width:100%"><div class="ms-rte-layoutszone-inner" role="textbox" aria-haspopup="true" aria-multiline="true" aria-autocomplete="both"><div class="ms-rtestate-read ms-rte-wpbox"><div class="ms-rtestate-notify  ms-rtestate-read 69154d75-8f41-4f96-a50e-b7b7573fc6e3" id="div_69154d75-8f41-4f96-a50e-b7b7573fc6e3"><table style='width:100%' cellpadding='0' cellspacing='0'><tr><td id="MSOZoneCell_WebPartctl00_m_g_69154d75_8f41_4f96_a50e_b7b7573fc6e3" valign="top" class="s4-wpcell-plain">
<li><a target="_blank" href=""><img src="http://s9.postimage.org/5309ep30v/symbol_error.png" id="img_0" alt="http://s9.postimage.org/5309ep30v/symbol_error.png" title=""/></a></li><a href=#><img src="../../../_layouts/images/Banniere/bullet.png" id="0" alt="0" /></a><div><img src="http://s9.postimage.org/5309ep30v/symbol_error.png" id="thumb_0" alt="0" /><br /><img id="triangle" class="triang" src="../../../_layouts/images/Banniere/triangle.png" /></div>
<table class="s4-wpTopTable" border="0" cellpadding="0" cellspacing="0" width="100%">


share|improve this question
The site isn't using Post-Cache substitution, is it? I've seen strange things like this happen when using that –  Dave Wise Oct 24 '12 at 17:35
add comment

1 Answer


You should not use Response.Write... Instead take a server-side Literal control and make the <li>'s in code behind and then assign the string to Literal.Value

That should have proper results!

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.