473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Including an extended control in webform

Sorry for the similar post, but I have clarified the problem a bit more. The
issue is: how do I use an extended .NET control in a webform using VS2005.
In my case, I am overriding the Render for a RadioButtonList control, so I
don't need a user control. So, I just have a very simple class file that
inherits the RadioButtonList and overrides the Render. I am trying to use
this in a Web Site project on a webform.

<%@ Register TagPrefix="MY" TagName="MyRadioButtonList" %>

<MY:MyRadioButtonList ID="myID" Runat="server">
</MY:MyRadioButtonList>

Why doesn't this work?

The compiler doesn't understand the tags and complains. But, when I try to
add a Src attribute, it complains that it has to be a usercontrol. But, it
can't be a user control because its not a Page or UserControl...its a custom
RadioButtonList.
Aug 31 '06 #1
1 1131
Jibber,

You could probably get it to work in a single solution but if you....

1) Split the control into a class library
2) Add the Class library solution to your project
3) Add a Project reference to the Class Library to you web solution
4) Add your @Register line as: <%@ Register Assembly="<ASSEMBLY_NAME"
Namespace="<CONTROL_NAMESPACE>" TagPrefix="MY" %>

Should work. Worked for me and it allows for easier reuse of the control in
other web projects!

Michael
"Jibber" wrote:
Sorry for the similar post, but I have clarified the problem a bit more. The
issue is: how do I use an extended .NET control in a webform using VS2005.
In my case, I am overriding the Render for a RadioButtonList control, so I
don't need a user control. So, I just have a very simple class file that
inherits the RadioButtonList and overrides the Render. I am trying to use
this in a Web Site project on a webform.

<%@ Register TagPrefix="MY" TagName="MyRadioButtonList" %>

<MY:MyRadioButtonList ID="myID" Runat="server">
</MY:MyRadioButtonList>

Why doesn't this work?

The compiler doesn't understand the tags and complains. But, when I try to
add a Src attribute, it complains that it has to be a usercontrol. But, it
can't be a user control because its not a Page or UserControl...its a custom
RadioButtonList.
Sep 1 '06 #2

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

Similar topics

1
by: Newbie | last post by:
Hello! I am working with 2 webforms. The first webform has a 2 weborm textboxes that I use as a placeholders. The second webform is a popup window that has a DataGrid in it. The DataGrid has 2 ...
0
by: titof | last post by:
What is the code for including an image control in a Table control of a WebForm ???? regards
2
by: Matt Theule | last post by:
I need to be able to allow users to drag files to a list box on a web page. To this end, I created a Windows Control and hosted it in a WebForm. When the file is dropped onto the listbox, the...
1
by: Rahim | last post by:
i want to change all the label control style Properties, server control properties at runtime how should i call all the label at runtime, which is present at webform, any collections???? i...
4
by: Andrea Williams | last post by:
I'm trying to set up a user control and change some values from the aspx page, but I keep running into trouble. What I really would like to do is be able to set a Label.Text in the user control...
5
by: George Durzi | last post by:
I have a simple user control with a text box and a submit button. When the user enters some text into the textbox and clicks the submit button, a record is created in the database. I'm using...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
3
by: Joe | last post by:
Hello All, I am developing a webform which creates ArrayLists of people's names and addresses (the values are retrieved from an xml file) and dynamically drops a user control onto the webform...
2
by: adiel_g | last post by:
I added a user control to a webform in Asp.net 2.0. I am also adding several other user controls to this webform. Now I am trying to find a way to stop the user controls from loading up when I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.