开发者

ASP.Net UpdatePanel error when trying to find TargetControlID

开发者 https://www.devze.com 2023-03-28 01:37 出处:网络
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.

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?


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);


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号