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# TreeNode与TreeView ]关于载入树形目录问题
- (50分)跪求:resx資源文檔編輯器
- 页面传值问题,嘴常用的、才发现的、不能理解的、......求解释
- c#中函数与方法的区别,如何定义的?新手求救!!!!!!
- 大家的B/S页面都是怎么组织的?请留下你们的意见,有相关链接最好!
- 谁有ActiveReport for net 的注册机 100 分赠
- 如何把Exception定义为接口,并重写Message{get;}方法,让其他的类继承?
- C#控件中DevExpress XtraGrid中GridView的RowStyle事件颜色不变问题
- WPF,请问如何关联Binding的更新事件的?
- 求VS2003,C#的JSON解析类代码
- 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里声明是怎么做呢?