Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Web Custom Control (Button)

Reply
Thread Tools

Web Custom Control (Button)

 
 
Steven
Guest
Posts: n/a
 
      04-22-2005
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 "WebCustomControl1" as the UniqueId. So for each button the
UniqueId is "WebCustomControl". 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


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      04-22-2005
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" <(E-Mail Removed)>
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 "WebCustomControl1" as the UniqueId. So for each button the
>UniqueId is "WebCustomControl". 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
>


 
Reply With Quote
 
 
 
 
Steven
Guest
Posts: n/a
 
      04-22-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)>
> 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 "WebCustomControl1" as the UniqueId. So for each button the
>>UniqueId is "WebCustomControl". 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
>>

>



 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      04-23-2005
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" <(E-Mail Removed)>
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" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed).. .
>> 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" <(E-Mail Removed)>
>> 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 "WebCustomControl1" as the UniqueId. So for each button the
>>>UniqueId is "WebCustomControl". 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
>>>

>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom control within a custom control J R M ASP .Net 2 06-01-2006 06:04 PM
Web user control - custom web control - java script. Leyla ASP .Net Web Controls 0 05-01-2006 10:05 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net 1 04-05-2005 01:39 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net Web Controls 2 04-05-2005 12:56 PM
ControlDesigner not invoked on custom control when control is rendered within another custom control Matt Sokol ASP .Net Building Controls 2 08-07-2003 07:13 AM



Advertisments