Last year we moved all our new functionality to Asp.Net MVC.
However we still have a load of legacy WebForms pages with lots of Javascript, and we're not going to get the chance to upgrade them any time soon.
More recently we also moved to Asp.Net 4, and that seems to have broken a load of the Javascript on these legacy pages.
Where before the client id would be:
ctl001_masterControlName_panelControlName_controlWeWant
Now they have become:
ctl001_masterControlName_panelControlName_controlWeWant_0
Where's that _0
suffix come from? There's only one controlWeWant
in panelControlName
, so the suffix adds no value.
I know hardcoded client ids are a bad idea with WebForms; one of the reasons we moved to MVC was the awful HTML produced by WebForms. However for this legacy code we're stuck with it, and I'd rather not go changing it (until the day comes when we have some free time to do it properly).
Why is Asp.Net 4 adding the _0
suffix at all?
Can I turn it off?
Is there any other way to avoid it?