服务器块格式不正确 [英] The server block is not well formed

查看:156
本文介绍了服务器块格式不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友...


我目前正在ASP.NET动态项目中工作,该项目从Application文件夹"Images"收集图像并将其显示在页面上.我已将其编码如下

Hello Friends...


I m currently working on ASP.NET dynamic project where it collects images from Application folder "Images" and displayed them on pages. I have coded it as follows

<% for (int i=0;i<filenames.Length; i++) %>
             <% { %>
                <% System.IO.FileInfo ObjFileInfo = new System.IO.FileInfo(filenames[i].ToString()); %>
                <div class="templatemo_product_box">
                    <h1>
                        Material Code : <span><%= ObjFileInfo.Name.Substring(0,7) %></span></h1>
                    <div class="product_info">

                        <img src="<%@ ObjFileInfo.FullName %>" height="255" width="250" />
                    </div>
                    <div class="cleaner">
                        &nbsp;</div>
                </div>
                <div class="cleaner_with_width">
                    &nbsp;</div>
                    <% } %>




但这引发了错误

服务器块的格式不正确."

在以下代码上




But it threw an error as

"The Server block is not well formed."

on following code

<div class="product_info">

                        <img src="<%@ ObjFileInfo.FullName %>" height="255" width="250" />
                    </div>




我也做了如下修改




i have also changed it as follows

<div class="product_info">

                        <img src="<%# ObjFileInfo.FullName %>" height="255" width="250" />
                    </div>




但是它不显示任何图像,只是为其创建了html div.

请帮助解决问题并在运行时在页面上显示图像.




But it doesn''t display any images, just created html divs for it.

Please help to resolve an issue and display images on page at run time.

推荐答案


这篇关于服务器块格式不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆