Trouble with autogenerated id on differently configuerd machines

T

tonicvodka

Hi everyone!

On my development machine I'm running Windows XP Professional and
ASP.NET 2.0.50727.
On the production server we're running Windows Server 2003 and ASP.NET
2.0.50727.

When I deploy the same project on both, the asp:datalist autogenerates
it's objects id's differently;

DEV-server: <table id="lstEstates__ctl0_tblEstate"

PROD-server: <table id="lstEstates_ctl00_tblEstate"

Has anyone experienced this? Is there a workaround? Since I'm building
scripts with the autogenerated ID's from lstEstates_ItemDataBound-
function it's causing a problem.

Thanks for any help!

Niclas
 
T

tonicvodka

You can use a control's ClientID property in generating your script code (it
needs to be concatenated into the script string at execution time) in order
to ensure that you always are using the correct id.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com












- Visa citerad text -

Thanks Peter,

Excellent, it works! I was building my own clientids, this seems like
a better approach :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top