473,795 Members | 2,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a simple start but im hving problems

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 SimpleControlSa mples or one of its
dependencies. The system cannot find the file specified.

Can anyone help please.

thanks
<%@ Register TagPrefix="Simp leControlSample s"
Namespace="Simp leControlSample s" Assembly="Simpl eControlSamples VB" %>

<html>

<body>

<form method="POST" runat="server">

<SimpleControlS amples:SimpleIn nerContentVB id="MyControl"
runat=server>
My Message Is Inside the Control Tag!!!!
</SimpleControlSa mples:SimpleInn erContentVB>

</form>

</body>

</html>
using System;
using System.Web;
using System.Web.UI;

namespace SimpleControlSa mples {

public class SimpleInnerCont ent : Control {

protected override void Render(HtmlText Writer output) {

if ( (HasControls()) && (Controls[0] is LiteralControl) ) {
output.Write("< H2>Your Message: " + ((LiteralContro l)
Controls[0]).Text + "</H2>");
}
}
}
}
Jun 5 '07 #1
3 1089
On Jun 5, 1:16 pm, "kal" <a...@noplace.c omwrote:
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 SimpleControlSa mples 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="Simpl eControlSamples VB"
public class SimpleInnerCont ent

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
is the assembly is in your bin directory?
Jun 6 '07 #3
Does the assembly SimpleControlSa mplesVB exist in the bin folder? Also, I
guess the name of the control class should be SimpleInnerCont entVB. Or
<SimpleControlS amples:SimpleIn nerContentVB ...should actually be
<SimpleControlS amples:SimpleIn nerContent ...>

"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 SimpleControlSa mples or one of its
dependencies. The system cannot find the file specified.

Can anyone help please.

thanks
<%@ Register TagPrefix="Simp leControlSample s"
Namespace="Simp leControlSample s" Assembly="Simpl eControlSamples VB" %>

<html>

<body>

<form method="POST" runat="server">

<SimpleControlS amples:SimpleIn nerContentVB id="MyControl"
runat=server>
My Message Is Inside the Control Tag!!!!
</SimpleControlSa mples:SimpleInn erContentVB>

</form>

</body>

</html>
using System;
using System.Web;
using System.Web.UI;

namespace SimpleControlSa mples {

public class SimpleInnerCont ent : Control {

protected override void Render(HtmlText Writer output) {

if ( (HasControls()) && (Controls[0] is LiteralControl) ) {
output.Write("< H2>Your Message: " + ((LiteralContro l)
Controls[0]).Text + "</H2>");
}
}
}
}
Jun 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
8299
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct code? many thx!
9
2048
by: robbie.carlton | last post by:
Hello! I've programmed in c a bit, but nothing very complicated. I've just come back to it after a long sojourn in the lands of functional programming and am completely stumped on a very simple function I'm trying to write. I'm writing a function that takes a string, and returns an array of strings which are the result of splitting the input on whitespace and parentheses (but the parentheses should also be included in the array as...
5
2143
by: sarge | last post by:
I would like to know how to perform simple multithreading. I had created a simple form to test out if I was multithreading properly, but got buggy results. Sometime the whole thig would lock up when I got two threads going at the same time. What I have is two text boxes (textBox1 and textBox2) and four buttons(cmdStartThread1, cmdStartThread2, cmdStopThread1, cmdStopThread2)
2
8404
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
10
2379
by: serge calderara | last post by:
Dear all, I need to build a web application which will contains articles (long or short) I was wondering on what is the correct way to retrive those article on web page. In orther words, when there is such information to be displayed are they coming from imported files, database ? Where and how this type of information is stored ? What is the way to retrieve such information in order to display it in page ?
26
495
by: jacob navia | last post by:
Summary: I have changed (as proposed by Chuck) the code to use isalpha() instead of (c>='a' && c <= 'z') etc. I agree that EBCDIC exists :-) I eliminated the goto statement, obviously it is better in a tutorial to stick to structured programming whenever possible...
4
34909
true911m
by: true911m | last post by:
Here's a little walkthrough to get py2exe up and running. I'm not an expert, so I can't help much with any problems you might have. This is what worked for me. The result here will be to convert a simple python app into a single .exe file that can be copied and run on any Windows XP machine. It may work on many other Windows platforms, but I haven't tested it. You'll need a working Python installation first, preferably v2.3 or later. ...
176
8469
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write their own unit test framework, and then in a lab session see if I can get them to write their own. To give them an example I've created the following UTF class (with a simple test program following). I would welcome and suggestions on how anybody...
6
28874
kenobewan
by: kenobewan | last post by:
Congratulations! You are one of the few who realise that over 80% of errors are simple and easy to fix. It is important to realise this as it can save a lot of time. Time that could be wasted making unnecessary changes, that in turn can cause further problems. Programming is a humbling experience. An experience that causes one to reflect on human error. One major cause of these errors is syntax, syntax, syntax. We tend not to notice when we...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7541
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.