By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

a simple start but im hving problems

P: n/a
kal
Hi

I am trying this simple custom control. from here:
http://samples.gotdotnet.com/quickst...x#innercontent

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>");
}
}
}
}
Jun 5 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Jun 5, 1:16 pm, "kal" <a...@noplace.comwrote:
Hi

I am trying this simple custom control. from here:http://samples.gotdotnet.com/quickst...bctrlauthoring....

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.
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

Jun 5 '07 #2

P: n/a
is the assembly is in your bin directory?
Jun 6 '07 #3

P: n/a
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 ...>

"kal" wrote:
Hi

I am trying this simple custom control. from here:
http://samples.gotdotnet.com/quickst...x#innercontent

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>");
}
}
}
}
Jun 6 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.