show.dll的代码如下using System;
using System.Web.UI;
namespace firstcontent
{
public class myshow:Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.Write("<textarea id=\"dcontent\" name=\"dcontent\" runat=\"server\" style=\"display:none\"><div></div></textarea><iframe id=\"my\" src=\"/Edit/index.htm?id=dcontent\" frameborder=\"0\" scrolling=\"no\" width=\"800px\" height=\"460px\"></iframe>");
}
}
}
我的一个页面default.aspx引用了这个dll文件,具体代码如下Default.aspx代码<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" Debug="true"%>
<%@Register TagPrefix="myfirstcontent" Namespace="firstcontent" Assembly="show"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<myfirstcontent:myshow runat="server" />
</div>
</form>
</body>
</html>Default.aspx.cs代码如下using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions; public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.dcontent.Value = "sdaflafasdfsdf"; //我这里是对show.dll中的 id="dcontent"的textarea赋值,但出现的问题是,总是提示错误“_Default”不包含“dcontent”的定义,并且找不到可接受类型为“_Default”的第一个参数的扩展方法“dcontent”(是否缺少 using 指令或程序集引用?)
}
}请问,我如果想对dll中的textarea赋值,请问该怎么做呢?
using System.Web.UI;
namespace firstcontent
{
public class myshow:Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.Write("<textarea id=\"dcontent\" name=\"dcontent\" runat=\"server\" style=\"display:none\"><div></div></textarea><iframe id=\"my\" src=\"/Edit/index.htm?id=dcontent\" frameborder=\"0\" scrolling=\"no\" width=\"800px\" height=\"460px\"></iframe>");
}
}
}
我的一个页面default.aspx引用了这个dll文件,具体代码如下Default.aspx代码<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" Debug="true"%>
<%@Register TagPrefix="myfirstcontent" Namespace="firstcontent" Assembly="show"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<myfirstcontent:myshow runat="server" />
</div>
</form>
</body>
</html>Default.aspx.cs代码如下using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions; public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.dcontent.Value = "sdaflafasdfsdf"; //我这里是对show.dll中的 id="dcontent"的textarea赋值,但出现的问题是,总是提示错误“_Default”不包含“dcontent”的定义,并且找不到可接受类型为“_Default”的第一个参数的扩展方法“dcontent”(是否缺少 using 指令或程序集引用?)
}
}请问,我如果想对dll中的textarea赋值,请问该怎么做呢?
解决方案 »
- 关于C++
- C#如何定义结构体数组?
- DataGridView的CellParsing事件问题
- 将numeric转换为数据类型numeric时发生算术溢出错误
- 在同一台服务器上的两个web应用程序之间怎么共享session呀,各位大侠是怎么解决的????
- datagridview,如何让某行成为当前可见行呢?(比如有100行,可是表格可见区域只有10行)
- {求助}读文件夹下所有的文件名以及修改时间、转移文件、重新命名的方法
- 请问:如何将两个Image中的图象合为一个图象?
- .net可以实现程序远程自动更新么?
- 比较急搞了几天了,OPENGL实现鼠标托动控制物体旋转的问题。
- C#关于程序卸戴的问题
- 在线等。。。在C#中用到了MultiRow控件,在选中一个textBoxCell的时候怎样实现这种效果:Excel中选择一个区域,然后CTRL+C,所选择区域的外围边框好像动态的一闪一闪的效果
writer.Write(" <textarea id=\"dcontent\" name=\"dcontent\" runat=\"server\" style=\"display:none\"> <div> </div> </textarea> <iframe id=\"my\" src=\"/Edit/index.htm?id=dcontent\" frameborder=\"0\" scrolling=\"no\" width=\"800px\" height=\"460px\"> </iframe>");
我的代码中写明了有runat="server"啊2楼兄弟,你说的在.cs里声明是怎么做呢?