473,403 Members | 2,293 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,403 software developers and data experts.

Web User Control Issue

Hi Everyone,

I have created a user control that contains two buttons. The buttons have
been created using <asp:Button> tag. I have then created another user
control that contains an <asp:Table>, that I dynamically add rows and cells
to. I am trying add my first user control to a TableCell. If I add any of
the usual .NET controls, it works fine. If I add my first user control, it
does not seem to appear.

I have turned page tracing on and the control appears in the Control Tree in
the TableCell, the visibility of user control has been dynamically to true.
What am I doing wrong?

[in .vb file]

<< this does not work >>
cell.Controls.Add(New MyButton(param1, param2))

<< this works >>
cell.Controls.Add(New Button)

[in mybutton user control]

<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="MyButtonButton.ascx.vb" Inherits="MyNameSpace.MyButtonButton"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:Button ID="FirstButton" Runat="server" Visible="True" Text="No.
1"></asp:Button><asp:Button ID="SecondButton" Runat="server" Visible="True"
Text="No. 2"></asp:Button>

Landers
Nov 19 '05 #1
1 1013
Sorted it.

I am now using LoadControl and my user control did not have a constructor
with no parameters.

L.

"Landley" <ne**@creations-software.co.uk> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
Hi Everyone,

I have created a user control that contains two buttons. The buttons have
been created using <asp:Button> tag. I have then created another user
control that contains an <asp:Table>, that I dynamically add rows and cells to. I am trying add my first user control to a TableCell. If I add any of the usual .NET controls, it works fine. If I add my first user control, it does not seem to appear.

I have turned page tracing on and the control appears in the Control Tree in the TableCell, the visibility of user control has been dynamically to true. What am I doing wrong?

[in .vb file]

<< this does not work >>
cell.Controls.Add(New MyButton(param1, param2))

<< this works >>
cell.Controls.Add(New Button)

[in mybutton user control]

<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="MyButtonButton.ascx.vb" Inherits="MyNameSpace.MyButtonButton"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:Button ID="FirstButton" Runat="server" Visible="True" Text="No.
1"></asp:Button><asp:Button ID="SecondButton" Runat="server" Visible="True" Text="No. 2"></asp:Button>

Landers

Nov 19 '05 #2

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

Similar topics

1
by: Ian | last post by:
I have a parent MDI with a menu that calls all the children forms and that works fine. My issue is I created a user control that looks like a toolbar and it has various windows controls on it and...
6
by: George Economos | last post by:
I am trying to display a user control contained within an c++ assembly in internet explorer. When I create an equivalent user control in c#, it displays just fine. Before I get into specifics,...
5
by: Drew | last post by:
I have a user control written in C#. This user control uses some of my mixed mode C++ libraries. My user control is currently residing on a .NET Windows Form. Everything works nicely. Now I am...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
6
by: Jim Heavey | last post by:
Hello, I have a user control which I place at the top of each page. I want to have code in this user control which sets the value of a couple of module variables and I was wondering if I create a...
1
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
3
by: c676228 | last post by:
Hi all, If I developed a phone user control which has requiredfieldvalidator, regularexpressionvalidator etc. The quesiton is if on a web form which have three phone fields and only any one of...
2
by: mikeingenito | last post by:
Hello, I have a a web form where i dynamically load a user control. The web page is an issue log, and each user control I add is a specific issue. I load them as follows: Try ...
9
by: timnels | last post by:
I have an issue where I have a user control that is launched into a floating form. At some point later, I allow the user to "unfloat" the user control by reparenting it on a split container in...
11
by: Brad Baker | last post by:
I'm building a small web application - I started out placing all my code in one file (config.aspx). As I continue to add code though it was becoming very unwieldy. After doing some searching...
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: 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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.