M
MLibby
How do I store an image and a web custom control's dll in a multifile
assembly so that the image can be retrieved and displayed while the control
is in design mode? This would allow the control to display a company logo
while in design and ensure that the logo's image file does not get deleted or
lost causing design mode problems.
I know that the possibility exists to have multifile assemblies which are
inclusive of the dll and other files. I found an example showing a web
application that retrieves text from a resource file embedded within a
multifile assembly. I can't find anything that deals with retrieving images
from a multifile assembly though.
Desired code example below:
using System;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace CustCtrlDesigner
{
/// <summary>
/// Summary description for CustCtrl.
/// </summary>
[DesignerAttribute(typeof(CustCtrlDesigner), typeof(IDesigner))]
public class CustCtrl : System.Web.UI.WebControls.WebControl
{
protected override void Render(HtmlTextWriter output)
{
output.Write("<center><font size='30'>");
output.Write( "Rendered!");
output.Write("</font></center>");
}
}
public class CustCtrlDesigner : System.Web.UI.Design.ControlDesigner
{
public override string GetDesignTimeHtml()
{
// Retrieve multifile assembly image here ! ! ! ! !
string html="<img src=''>";
return html;
}
}
}
assembly so that the image can be retrieved and displayed while the control
is in design mode? This would allow the control to display a company logo
while in design and ensure that the logo's image file does not get deleted or
lost causing design mode problems.
I know that the possibility exists to have multifile assemblies which are
inclusive of the dll and other files. I found an example showing a web
application that retrieves text from a resource file embedded within a
multifile assembly. I can't find anything that deals with retrieving images
from a multifile assembly though.
Desired code example below:
using System;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace CustCtrlDesigner
{
/// <summary>
/// Summary description for CustCtrl.
/// </summary>
[DesignerAttribute(typeof(CustCtrlDesigner), typeof(IDesigner))]
public class CustCtrl : System.Web.UI.WebControls.WebControl
{
protected override void Render(HtmlTextWriter output)
{
output.Write("<center><font size='30'>");
output.Write( "Rendered!");
output.Write("</font></center>");
}
}
public class CustCtrlDesigner : System.Web.UI.Design.ControlDesigner
{
public override string GetDesignTimeHtml()
{
// Retrieve multifile assembly image here ! ! ! ! !
string html="<img src=''>";
return html;
}
}
}