相关疑难解决方法(0)

母版页奇怪 - "内容控件必须是内容页面中的顶级控件或引用母版页的嵌套母版页."

这很奇怪.我在Visual Studio 2008中为我的解决方案添加了一个全新的Web应用程序项目.

创建了一个母版页.零修改.创建了一个新的webform.将其母版页设置为刚刚创建的MP.

仍然没有修改.没有标记.没有用户控制.没有参考.没有.但是,当我尝试运行它时,我得到:

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
HttpException (0x80004005): Content controls have to be top-level controls in a content page or a nested master page that references a master page.]
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8665016
   System.Web.UI.Page.get_Master() +51
   System.Web.UI.Page.ApplyMasterPage() +15
   System.Web.UI.Page.PerformPreInit() +45
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
Run Code Online (Sandbox Code Playgroud)

如果我在这个解决方案之外的独立项目中做同样的事情,它可以正常工作.请记住,如果这有任何区别,我正在使用Web应用程序项目与网站项目.

网络形式:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebUI._Default" MasterPageFile="~/Site1.Master" %>

<!DOCTYPE …
Run Code Online (Sandbox Code Playgroud)

asp.net master-pages visual-studio-2008

66
推荐指数
3
解决办法
14万
查看次数

从二进制数据转换为ASP.NET中的图像控件

我在我的数据库中有图像的二进制数据,我想在ASP.NET中的图像控件中显示它.怎么样?如果不可能,请找到另一种方法将其保存在数据库中并将其显示在图像控件中.

c# asp.net image binary-data

13
推荐指数
2
解决办法
7万
查看次数

从asp.net中的数据库中检索图像

如何使用c#从asp.net中的sql数据库中检索图像.

我想从数据库中检索图像文件,然后在标签中显示图像.

我尝试这个代码,但它无法正常工作

ASPX

 <asp:Image ID="Image1" runat="server" ImageUrl="" Height="150px" Width="165px" />
Run Code Online (Sandbox Code Playgroud)

代码背后

 Byte[] bytes = (Byte[])ds.Tables[0].Rows[0]["image"];
 Response.Buffer = true;
 Response.Charset = "";
 Response.Cache.SetCacheability(HttpCacheability.NoCache);
 Response.ContentType = "image/jpg";
 Response.BinaryWrite(bytes);
 Response.Flush();
 Response.End();
Run Code Online (Sandbox Code Playgroud)

如何给出ImageUrl=""这个图像的链接???

c# sql-server asp.net httphandler

8
推荐指数
1
解决办法
5万
查看次数