473,779 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

use this.controls.a dd inside an onclick event

Hi to all,

i have a web custom control(webcont rol1) that has a button(button1) , another webcontrol(webc ontrol2) 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(prot ected webcontrol2 mywebcontrol2 = new webcontrol2)
3) create the event Onclick (mywebcontrol.b utton1.click +=new systemeventhand ler....)
4) private void button1.click{t his.Controls.ad d(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 2127
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*******@disc ussions.microso ft.com> wrote in message
news:95******** *************** ***********@mic rosoft.com...
Hi to all,

i have a web custom control(webcont rol1) that has a button(button1) , another webcontrol(webc ontrol2) 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(prot ected webcontrol2 mywebcontrol2 = new webcontrol2) 3) create the event Onclick (mywebcontrol.b utton1.click +=new systemeventhand ler....) 4) private void button1.click{t his.Controls.ad d(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
9298
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 interface. When you click at a specific day, a specific hour, it will suggest to create a booking at the clicked day. I was having a load of troubble trying to find exactly where inside the div element the mouse was clicked - untill I found out...
4
1404
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 the string. I also have asp server controls(labels) in the datalist. When the form is processed, I am retrieving the values of the radio buttons through Request.form. To retrieve the values of the asp server controls , I am using FindControl...
9
1395
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 I am asking again. Someone please please help me!! How do I add a radiobuttonlist within a datalist programatically. My actual problem is with retrieving the user-input and
7
2006
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
2232
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 onClick event to the other 4 controls. Any help would be much appreciated! R.D. Harles
14
1940
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 ); } ClickableMenuItem( MenuItem mi ) {
2
1351
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 event created of dyanamically created button. Please help me, if any one having solution for my problem. I know that i can raise that event if i recreate these controls on page load but my reqirements doesn't allow me to do so. My code for...
2
1492
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
2743
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 will excuse me for bringing it up again but this issue is very frustrating. I created a new form in a brand new (Access 2003) database. This example does nothing useful other than to illustrate the problem. I've explained what I want to do in...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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
10138
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...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6724
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();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
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.