mattgcon
mattgcon

Reputation: 4848

ASP.Net UpdatePanel error when trying to find TargetControlID

I have a web app, with MasterPages. On one of the content pages I am trying to use an UpdatePanel, to disable and enable certain fields.

The UpdatePanel trigger is set to a dropdownlist, however when the page loads I receive an error saying that the control ID of the dropdownlist cannot be found. I tried the simple ID (cboEventType) and the full registered ID within the HTML Markup during runtime (ctl00_maincontentholder_wpControls_cboEventType), but after trying both of the these I am still receiving the error that the TargetControlID cannot be found.

The dropdownlist control is set to visible during design time so it is not hidden on page load. What can be the issue?

Upvotes: 0

Views: 266

Answers (2)

James Johnson
James Johnson

Reputation: 46047

You're receiving this error because the control does not exist in the master page; it exists on the page.

I think you'll have to do something like this to get it working:

ScriptManager.GetCurrent(Page).RegisterAsyncPostBackControl(cboEventType);

Upvotes: 1

Michael D. Irizarry
Michael D. Irizarry

Reputation: 6302

Are you using the ClientID? or the ID? My guess is that your not using the ClientID.

Upvotes: 0

Related Questions