Why usercontrol id change?

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
10/13/2010 10:08:21 AM
Gravatar
Total Posts 2

UserControl's id change?

Hi!

I has made a module use jqgird or other usercontrols,but they are not effect.Main reason is usercontrols's id is change,why?

For example,

the html code is :
<table id="JQGrid1"></table>
<input id="ctl00$mainContent$JQGrid1_SelectedRow" name="ctl00$mainContent$JQGrid1" type="hidden"></input>

The table's id is "JQGrid1",input's id is "ctl00$mainContent$JQGrid1"+_SelectedRow,is not same as below.

so,the jQuery('#JQGrid1_SelectedRow').attr('value', grid.getGridParam('selrow'));,this code is No effect.
 

please help me!

thank!

10/15/2010 8:53:45 AM
Gravatar
Total Posts 18439

Re: Why usercontrol id change?

you should not post problems with your custom code as mojoPortal bugs, this question should have been in the developer forum.

you need to understand how ASP.NET generates control ids, client ids must be unique for the entire page so asp.net makes them unique.

Especially in a grid control, the ids of controls in a row will be unique for each row, it cannot be otherwise.

so the server side id is not the same as the clientID of a control

in some cases you can use <%= JQGrid.ClientID %> but that only would select the table or the specific control it won't work as well for items in a grid.

probably you can solve it using class selectors instead of id selectors for jquery

10/17/2010 3:07:28 AM
Gravatar
Total Posts 2

Re: Why usercontrol id change?

Thanks much!

You must sign in to post in the forums. This thread is closed to new posts.