473,785 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Custom Control (Button)

Hello,

I'm creating a list of buttons in web custom control. When I'm creating them
I'm giving the name of each button as this.UniqueId. But this is aslways
giving me the "WebCustomContr ol1" as the UniqueId. So for each button the
UniqueId is "WebCustomContr ol". Is there anyway I can declare the UniqueID
to be the 'Integer x', which will increment in a loop starting from 1. So
Button1 will get UniqueID as 1,...

How can I do this?
Please help

Thanks
Steven
Nov 19 '05 #1
4 1108
Hi Steven:

You can always set the ID property of the control to whatever you
need. Are you having trouble setting up the variable and the loop?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 21 Apr 2005 18:40:50 -0700, "Steven" <st*****@anonym ous.com>
wrote:
Hello,

I'm creating a list of buttons in web custom control. When I'm creating them
I'm giving the name of each button as this.UniqueId. But this is aslways
giving me the "WebCustomContr ol1" as the UniqueId. So for each button the
UniqueId is "WebCustomContr ol". Is there anyway I can declare the UniqueID
to be the 'Integer x', which will increment in a loop starting from 1. So
Button1 will get UniqueID as 1,...

How can I do this?
Please help

Thanks
Steven


Nov 19 '05 #2
Hi Scott,

Thanks for your reply. I want to set the ID property for each Button in the
control. Since name is the unique property for button, I want to set it
different for each button.
If I set it to any value instead of 'this.UniqueId' , I'm unable to get the
response back from button. (eg., I'm unable to hit the Button_click event in
the program).
If I set it to this.UniqueID, eveything works fine. But this.UniqueID is
giving the same name 'WebControl1' for each button.

How should I resolve this problem.

Regards
Steven
"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:jl******** *************** *********@4ax.c om...
Hi Steven:

You can always set the ID property of the control to whatever you
need. Are you having trouble setting up the variable and the loop?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 21 Apr 2005 18:40:50 -0700, "Steven" <st*****@anonym ous.com>
wrote:
Hello,

I'm creating a list of buttons in web custom control. When I'm creating
them
I'm giving the name of each button as this.UniqueId. But this is aslways
giving me the "WebCustomContr ol1" as the UniqueId. So for each button the
UniqueId is "WebCustomContr ol". Is there anyway I can declare the UniqueID
to be the 'Integer x', which will increment in a loop starting from 1. So
Button1 will get UniqueID as 1,...

How can I do this?
Please help

Thanks
Steven

Nov 19 '05 #3
Steven:

Could you post some code? The version that does not use UniqueID?
this.UniqueID would be the ID of the ascx web control - the parent
control. You wouldn't want to use this to name the child controls.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 22 Apr 2005 08:41:48 -0700, "Steven" <st*****@anonym ous.com>
wrote:
Hi Scott,

Thanks for your reply. I want to set the ID property for each Button in the
control. Since name is the unique property for button, I want to set it
different for each button.
If I set it to any value instead of 'this.UniqueId' , I'm unable to get the
response back from button. (eg., I'm unable to hit the Button_click event in
the program).
If I set it to this.UniqueID, eveything works fine. But this.UniqueID is
giving the same name 'WebControl1' for each button.

How should I resolve this problem.

Regards
Steven
"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:jl******* *************** **********@4ax. com...
Hi Steven:

You can always set the ID property of the control to whatever you
need. Are you having trouble setting up the variable and the loop?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 21 Apr 2005 18:40:50 -0700, "Steven" <st*****@anonym ous.com>
wrote:
Hello,

I'm creating a list of buttons in web custom control. When I'm creating
them
I'm giving the name of each button as this.UniqueId. But this is aslways
giving me the "WebCustomContr ol1" as the UniqueId. So for each button the
UniqueId is "WebCustomContr ol". Is there anyway I can declare the UniqueID
to be the 'Integer x', which will increment in a loop starting from 1. So
Button1 will get UniqueID as 1,...

How can I do this?
Please help

Thanks
Steven


Nov 19 '05 #4
Steven:

Could you post some code? The version that does not use UniqueID?
this.UniqueID would be the ID of the ascx web control - the parent
control. You wouldn't want to use this to name the child controls.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 22 Apr 2005 08:41:48 -0700, "Steven" <st*****@anonym ous.com>
wrote:
Hi Scott,

Thanks for your reply. I want to set the ID property for each Button in the
control. Since name is the unique property for button, I want to set it
different for each button.
If I set it to any value instead of 'this.UniqueId' , I'm unable to get the
response back from button. (eg., I'm unable to hit the Button_click event in
the program).
If I set it to this.UniqueID, eveything works fine. But this.UniqueID is
giving the same name 'WebControl1' for each button.

How should I resolve this problem.

Regards
Steven
"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:jl******* *************** **********@4ax. com...
Hi Steven:

You can always set the ID property of the control to whatever you
need. Are you having trouble setting up the variable and the loop?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 21 Apr 2005 18:40:50 -0700, "Steven" <st*****@anonym ous.com>
wrote:
Hello,

I'm creating a list of buttons in web custom control. When I'm creating
them
I'm giving the name of each button as this.UniqueId. But this is aslways
giving me the "WebCustomContr ol1" as the UniqueId. So for each button the
UniqueId is "WebCustomContr ol". Is there anyway I can declare the UniqueID
to be the 'Integer x', which will increment in a loop starting from 1. So
Button1 will get UniqueID as 1,...

How can I do this?
Please help

Thanks
Steven


Nov 19 '05 #5

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

Similar topics

1
3552
by: Robert Neville | last post by:
I am having some trouble with some old code revolving around custom form navigation buttons. My main form has a sub-form with these custom navigation buttons. In other words, the code should be modular and work across forms and sub-forms. My previous code was taken from the Access Expert Solutions 97 (Leszynski) many years ago. As my database became more complex with multiple sub-forms and intricate combo boxes, the code faltered. Some...
19
4921
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
1
4814
by: rn5a | last post by:
I have created a custom control button which when clicked displays a message in the JavaScript alert dialog. I could successfully compile the VB class file into a DLL & also could add it to the Toolbox in Visual Web Developer 2005 Express Edition but the alert message isn't popping up when I am implementing this control in an ASP.NET page & clicking the Button in the ASPX page. This is the class file: Imports System Imports System.Web...
1
3231
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' & 'Cancel'). Till this point, no problem. Initially, the TextBox is empty. The Button has a property named 'ConfirmMessage' so that the developer using this custom control can modify the question in the confirm dialog. If the user clicks 'OK', I want the...
0
1393
by: rn5a | last post by:
A custom control is derived from the WebControl class & encapsulates a TextBox & a Button. When the Button is clicked, the user is shown the JavaScript confirm dialog with the 'OK' & 'Cancel' buttons. If the user clicks 'OK', the TextBox gets populated with 'true' & if 'Cancel' is clicked, the TextBox gets populated with 'false'. Note that when the user first comes to the ASPX page that uses this custom control, the TextBox is empty. This...
11
18151
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with ListView columns so it should be doable, thanks
15
6522
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then i added this line "" before my custom control class (i dont know what this line does). Now
2
19492
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
4
2492
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried unsuccessfully in creating the whole pane as a user control and have succeeded in adding the pane and then dynamically adding the content which is a user control to the pane, dynamically within the page. However I would like to have a single pane...
0
2897
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
9646
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
9483
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
10157
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
10096
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
9956
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
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...
0
5386
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
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
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

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.