|
I saw an example of linkage of a drop-down list box. Problems encountered during implementation:
The original example is to use the control directly in .aspx, the code is as follows:
<SELECT id = "province" runat = "server" NAME = "province"> </ SELECT>
The generated HTML is as follows:
<select name = "province" id = "province"> </ select>
When I implemented it, I used a web user control (.ascx). The code in the control is the same as above.
Generated HTML:
<select name = "CtrlUserCenter1: _ctl0: province" id = "CtrlUserCenter1__ctl0_province"> </ select>
The example javascript needs to use the ID of the control, a piece of code is as follows:
for (i = 0; i <s.length-1; i ++)
document.getElementById (s [i]). onchange = new Function ("change (" + (i + 1) + ")");
But now the generated IDs are too different.
How to do?
What if I start with .net?
What if I start with javascript? |
|