Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

a simple start but im hving problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kal - 05 Jun 2007 12:16 GMT
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]
>     }
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.