Hi
I am trying this simple custom control. from here:
http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx#innerc
ontent
when i browse the page it gives me an error:
Could not load file or assembly SimpleControlSamples or one of its
dependencies. The system cannot find the file specified.
Can anyone help please.
thanks
<%@ Register TagPrefix="SimpleControlSamples"
Namespace="SimpleControlSamples" Assembly="SimpleControlSamplesVB" %>
<html>
<body>
<form method="POST" runat="server">
<SimpleControlSamples:SimpleInnerContentVB id="MyControl"
runat=server>
My Message Is Inside the Control Tag!!!!
</SimpleControlSamples:SimpleInnerContentVB>
</form>
</body>
</html>
using System;
using System.Web;
using System.Web.UI;
namespace SimpleControlSamples {
public class SimpleInnerContent : Control {
protected override void Render(HtmlTextWriter output) {
if ( (HasControls()) && (Controls[0] is LiteralControl) ) {
output.Write("<H2>Your Message: " + ((LiteralControl)
Controls[0]).Text + "</H2>");
}
}
}
}
Alexey Smirnov - 05 Jun 2007 21:15 GMT
> Hi
>
[quoted text clipped - 6 lines]
>
> Can anyone help please.
You copied the code of ASPX VB-version and class in C#
There is no difference except the name of class
Assembly="SimpleControlSamplesVB"
public class SimpleInnerContent
Take a look in the View Source link again on gotdotnet.com and you
will see what was the original code of VB-class
XOR - 06 Jun 2007 09:51 GMT
is the assembly is in your bin directory?
Siva M - 06 Jun 2007 11:31 GMT
Does the assembly SimpleControlSamplesVB exist in the bin folder? Also, I
guess the name of the control class should be SimpleInnerContentVB. Or
<SimpleControlSamples:SimpleInnerContentVB ...> should actually be
<SimpleControlSamples:SimpleInnerContent ...>
> Hi
>
[quoted text clipped - 45 lines]
> }
> }