Web User Controls(ascx) 1.1 VS 2.0

P

Pony Tsui

I writed a user controls in vs2003, it's work fine, recently i move it to
VS2005, open IE, everything is fine, but when i open the firefox, the control
can not run, the control use client side javascript, so i check the firefox's
javascript console, it show a error: myControlID(in ascx)_controlID(in aspx)
not found, i open the Vs2003 & 2005 web page from IE & FireFox and view the
rend out html page source, i found the control ID in page source is different:

in vs2003 page IE & Firefox is myControlID(in ascx):controlID(in aspx)
in vs2005 page IE myControlID(in ascx):controlID(in aspx)
but Firefox is myControlID(in ascx)$controlID(in aspx)
the different is ':' & '$'

i don't know the exact problem is, can anyone help me, thanks.
 
W

Walter Wang [MSFT]

Hi Pony,

Thank you for your post.

Based on my understanding, the problem is: you're reference some server
control in your client-side javascript and found that the generated control
id is different in different browser. If I've misunderstood anything,
please feel free to post here.

It is recommended that you do not rely on directly referencing the IDs as
you can see them in the browser. The formula used to generate unique IDs
for child controls can change. Instead, get the value of the child
control's ClientID property and use that value to reference the child
control. For more info, please refer to following MSDN documentation:

#Client Script in ASP.NET Web Pages
http://msdn2.microsoft.com/en-us/3hc29e2a.aspx#IdentifyingServerControlsInCl
ientScript


Regards,
Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top