Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

dynamic controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Mat - 15 Aug 2007 18:36 GMT
hi,

In my aspx page I do have some dynamic aspx controls. I am using
document.getElementById('pageID_Ctl1_text1') in the javascript to copy some
values from these controls. It is working in the first time, and these
controls id values are changing after the page reloaded. I am getting the
error on this getElementById.

This was working in 2003 and after migrating to 2005, it is not working.

Any help would be appreciated.

Thanks
Kevin
Ladislav Mrnka - 15 Aug 2007 20:10 GMT
Hi Kevin,
how does the id change and where is your control placed?

Regards,
Ladislav

> hi,
>
[quoted text clipped - 10 lines]
> Thanks
> Kevin
Kevin Mapppov - 15 Aug 2007 20:28 GMT
thanks for the reply,
the controls are in a user control and it is placed in an aspx page. the
controls in the user controls are dynamic.
it will create new id after the page got reloaded.
Eg: pageid_ctl1_text1 will change to pageid_ctl2_text1

> Hi Kevin,
> how does the id change and where is your control placed?
[quoted text clipped - 17 lines]
>> Thanks
>> Kevin
Alexey Smirnov - 15 Aug 2007 21:10 GMT
On Aug 15, 9:28 pm, "Kevin Mapppov" <kevin.Mapp...@yahoo.nospam.com>
wrote:
> thanks for the reply,
> the controls are in a user control and it is placed in an aspx page. the
[quoted text clipped - 3 lines]
>
> "Ladislav Mrnka" <LadislavMr...@discussions.microsoft.com> wrote in message

use a mix of ASP.NET and javascript

document.getElementById("<%=text1.ClientID%>");

where text1 is id of your Control, e.g.

<asp:TextBox id="text1" runat="server"/>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.