Welcome Guest Search | Active Topics | Sign In | Register

DatePicker dynamic naming Options
Gaturro
Posted: Tuesday, May 4, 2010 11:09:03 AM
Rank: Newbie
Groups: Member

Joined: 5/4/2010
Posts: 5
Hi. I'd like to create controls dynamically. That means adding '<eo:DatePicker id="<%= valName %>" ...' to a .ascx file and then calling the .ascx file.

Or, making a for bucle, and do the same....

Is it possible?


If it were possible, is also possible create new object from javascript?

Thank you in advance...
eo_support
Posted: Tuesday, May 4, 2010 11:44:26 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

I don't think you can do that with ID attribute. You can do that with other attribute but not ID. This is a general ASP.NET rule and would be the same for any server control. It is not something special for our control.

In order to set the ID dynamically, you must set them in your code. For example, you can put ID="DatePicker1" in your .aspx and then do DatePicker1.ID = "whatever" in your code.

You can not create DatePicker control from JavaScript.

Thanks!
Gaturro
Posted: Wednesday, May 5, 2010 4:19:36 AM
Rank: Newbie
Groups: Member

Joined: 5/4/2010
Posts: 5
Yes, I was not very lucid about the ID, you're right.

But there is not a way of creating dinamically (at least on the .aspx.vb code) a new control? Just to simplify, I'd like to put a button that adds 1 new line with a datepicker, so I can push that button X times.

I understand that I can't do that on javascript, but is there any way of doing it on the .vb code. The way you are telling me, I have to predefine the object on the .aspx, is that right?

Thanks for your quick answer.
eo_support
Posted: Wednesday, May 5, 2010 8:29:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

Of course you can always dynamically create control inside your .aspx.vb code. We told you that you can put a static DatePicker and then change ID because we thought you only needed to dynamically change IDs. However you can dynamically create a DatePicker just fine. It will be the same dynamically creating any other control. The DatePicker control is an ASP.NET server control. So there is no difference between it and any other standard server control in this regard.

As previously stated, you can not dynamically create the DatePicker control from JavaScript.

Thanks!
Gaturro
Posted: Wednesday, May 5, 2010 8:33:11 AM
Rank: Newbie
Groups: Member

Joined: 5/4/2010
Posts: 5
Thanks for you quick answer, I'm gonna test this (and the others) controls, and I'm linking them very much...


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.