我在我们的海关管理系统中使用了控制,我们没有这方面的源码,我想做的是改变这一控制的成果。
现在,我可以在我的基页表中检查,如果控制在网页上使用,然后改变需要改变的html,但这似乎比仅仅1次使用过度。
因此,没有来源法,是否还有其他改变控制行为的方法? 我的想法不像上文所述的方式。
增 编
我在我们的海关管理系统中使用了控制,我们没有这方面的源码,我想做的是改变这一控制的成果。
现在,我可以在我的基页表中检查,如果控制在网页上使用,然后改变需要改变的html,但这似乎比仅仅1次使用过度。
因此,没有来源法,是否还有其他改变控制行为的方法? 我的想法不像上文所述的方式。
增 编
在习俗控制下进行治疗:
public class MyCMSControl: CommercialCMSControl
{
protected override void Render(HtmlTextWriter writer)
{
StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter = new StringWriter(stringBuilder );
using (HtmlTextWriter myWriter = new HtmlTextWriter(stringWriter ))
{
base.Render(myWriter);
string newOutput;
// the original output is in stringBuilder, do whatever you want, and
// put it in newOutput
writer.Write(newOutput);
}
}
}
如果你想能够操纵该页具体编码中的产出,就添加一个活动,例如:
public delegate void OnRenderHandler(object sender, string originalOutput, HtmlTextWriter writer)
public OnRenderHandler OnRender;
...
/// before writer.Write above...
if (OnRender!=null) {
OnRender(this,stringBuilder.ToString(),writer);
}
为了在设计师中提供您的习惯版本,你需要网上查阅。
<pages>
<controls>
<add namespace="My.Control.Namespace" assembly="My.Control.Assembly" tagPrefix="MyControlsPrefix"/>
</controls>
</pages>
In my webpages I have references to js and images as such: "../../Content/Images/"Filename" In my code if I reference a file as above, it doesnt work so i have to write: "c:/miscfiles/"filename" 1-...
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
I m looking for best practices here. Sorry. I know it s subjective, but there are a lot of smart people here, so there ought to be some "very good" ways of doing this. I have a custom object called ...
I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...
i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...
For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?
I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!