473,395 Members | 1,688 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,395 software developers and data experts.

use this.controls.add inside an onclick event

Hi to all,

i have a web custom control(webcontrol1) that has a button(button1), another webcontrol(webcontrol2) that has a label (label1), and another webcontrol (webcontrol_all).

in the webcontrol_all i make this steps:
1) i instanciate the button (protected webcontrol1 mywebcontrol = new webcontrol1)
2) i instanciate the second webcontrol(protected webcontrol2 mywebcontrol2 = new webcontrol2)
3) create the event Onclick (mywebcontrol.button1.click +=new systemeventhandler....)
4) private void button1.click{this.Controls.add(webcontrol2)}
My problem is that the webcontrol2 its added, if i add for example a button from the toolbar (a normal button), and i make clickon it in the browser, my webcontrol2 dissapear, i dont know why...

Could you send me anything, would be grateful...
Thanks.
Josema.

Nov 15 '05 #1
1 2111
Yet another idea - put the control you want to show/hide dynamically inside
asp:panel and turn the panel's Visible property on or off.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Josema" <an*******@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
Hi to all,

i have a web custom control(webcontrol1) that has a button(button1), another webcontrol(webcontrol2) that has a label (label1), and another
webcontrol (webcontrol_all).
in the webcontrol_all i make this steps:
1) i instanciate the button (protected webcontrol1 mywebcontrol = new webcontrol1) 2) i instanciate the second webcontrol(protected webcontrol2 mywebcontrol2 = new webcontrol2) 3) create the event Onclick (mywebcontrol.button1.click +=new systemeventhandler....) 4) private void button1.click{this.Controls.add(webcontrol2)}
My problem is that the webcontrol2 its added, if i add for example a button from the toolbar (a normal button), and i make clickon it in the
browser, my webcontrol2 dissapear, i dont know why...
Could you send me anything, would be grateful...
Thanks.
Josema.


Nov 15 '05 #2

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

Similar topics

4
by: Simon Pedersen | last post by:
Hi, I have a site here: http://www.atom.no/christiane/default.asp?menu=4&view=app_resource&app_id=20&app=20&response=1&body=0&RESOURCE_ID=2 which uses divs to create a outlook like calendar...
4
by: ani | last post by:
I have a datalist control in my aspx page(this is paginated and everytime submits to itself). I am calling a function within my datalist that returns a html control (radio button ) in the form of...
9
by: ani | last post by:
I have been posting this question for the past 2 weeks and there wasn't any response. I really don't understand why I am not getting any responses. Does my question sound very stupid? Anyway, here...
7
by: Shapper | last post by:
Hello, I have an ASP:ImageButton where I want to call a function and pass a string: OnClick="Change_Photo("John")" I am having problems with "". I tried
2
by: DataSmash | last post by:
Hello, I've created a simple form with 2 radio boxes, 2 text boxes and a button. When I click the button, I'd like to write each "choice" to a text file. I can't figure out how to "link" the...
14
by: Charles Jenkins | last post by:
I want to make a MenuItem that I can 'click' programmatically. I started by coding this: class ClickableMenuItem : MenuItem { public void DoClick( EventArgs e ) { OnClick( e ); } ...
2
by: Hellogeetu | last post by:
Hi All, I am creating dynamic controls but not on page_load event but on one of the button click event. I m able to get the controls value by using request.form but i m unable to handle the...
2
JimWu
by: JimWu | last post by:
Do anyone know how to layout in Panel control. The code as follows labels.Text = "Album Name :"; labels.Text = "Title :"; labels.Text = "Tag :"; labels.Text = "Description :";
2
by: DavidGeorge | last post by:
In an earlier thread I recounted a problem I was having, but it took a while to reduce the problem to it's basic components and the issue became somewhat confused in reaching that point. I hope you...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.