Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does ClientIDMode work?
    text
    copied!<p>I'm preparing to do an .NET exam and I came across this question. I have been breaking my head over this but I can't figure it out :s I tried all of this but didn't come up with a clear answer...</p> <blockquote> <p>You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages. You add JavaScript code to periodically update specific types of data items in these GridView controls. You need to ensure that the JavaScript code can locate the HTML elements created for each row in these GridView controls, without needing to be changed if the controls are moved from one page to another. What should you do?</p> <p>A. Replace the GridView control with a ListView control. </p> <p>B. Set the ClientIDMode attribute to Predictable in the web.config file. </p> <p>C. Set the ClientIDRowSuffix attribute of each unique GridView control to a different value. </p> <p>D. Set the @ OutputCache directives VaryByControl attribute to the ID of the GridView control."</p> </blockquote> <p>This is what I came up with:</p> <blockquote> <p>A. Since the structure of the GridView and the ListView is similar and since they generate the same sort of IDs, I scratched this one.</p> <p>B. I tested this, but it doesn't seem to affect the IDs :s I think I would have to apply more settings than just this one to get some effect.</p> <p>C. This makes me wonder about what the question really says, this makes all rows unique. But is that what is supposed to happen, since you're not supposed to change code?</p> <p>D. This is for caching, so has nothing to do with the question.</p> </blockquote> <p>Can someone clear this out for me? Any ideas?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload