I have a page that functions fine like this
<%
YouTube youtube = new YouTube();
youtube.DeveloperID = ConfigurationManager.AppSettings["DeveloperID"];
Video[] videos = youtube.GetTaggedVideos("Beginner Guitar Lessons");
for (int i = 0; i < videos.Length; i++) {
%>
<a href="GetVideo.aspx?VideoID=<%=videos[i].VideoID %>"><%=videos[i].Title %><br /><img src="<%=videos[i].ThumbnailUrl %>" alt="<%=videos[i].Title %>"/></a><br /><br />http://www.youtube.com/watch?v<%=videos[i].VideoID %><br />
<iframe src="http://rcm.amazon.com/e/cm?t=blabla-20&o=1&p=9&l=st1&mode=books&search=yo%20mama&fc1=000000<1=&lc1=3366FF&bg1=FFFFFF&f=ifr" marginwidth="0" marginheight="0" width="180" height="150" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe><br />
<%
}
%>
now, I want to add an if statement in that so that the ad shows only after every third video like this
<%
YouTube youtube = new YouTube();
youtube.DeveloperID = ConfigurationManager.AppSettings["DeveloperID"];
Video[] videos = youtube.GetTaggedVideos("Beginner Guitar Lessons");
for (int i = 0; i < videos.Length; i++) {
%>
<a href="GetVideo.aspx?VideoID=<%=videos[i].VideoID %>"><%=videos[i].Title %><br /><img src="<%=videos[i].ThumbnailUrl %>" alt="<%=videos[i].Title %>"/></a><br />copy/paste into RewindRewind<br />http://www.youtube.com/watch?v<%=videos[i].VideoID %><br />
<%if(i=3){ %>
<iframe src="http://rcm.amazon.com/e/cm?t=pilatesforpre-20&o=1&p=9&l=st1&mode=books&search=yo%20mama&fc1=000000<1=&lc1=3366FF&bg1=FFFFFF&f=ifr" marginwidth="0" marginheight="0" width="180" height="150" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe><br />
<%
}
}
%>
I get all kinds of errors that have nothing to do with that page in particular. Any ideas?