开发者

VS2010. Dropdownlist Autopostback works in IDE, not when deployed

I have a VS2010 RC ASP.NET web page,when a user changes the drop down selection on an auto postback dropdown, it refreshes a small grid and a few labels in various places on the page.

I know wrapping a whole page in a big UpdatePanel control will cause horror from many of you, but that's what I did. I really didn't want a full page refresh and I didn't know how to update a table on the client side using Javascript and I figured it would be a big change. Suggestions for avoiding this are welcomed, but my main desire is to understand teh error I am getting.

When I do the auto postbacks in the IDE, everything works fine, but if I deploy the code (IIS 5.5 on XP), the second auto postback works but the seconds one gives me his error. Ajax is one big nasty blackbox to me.

Can someone help, please?

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; MS-RTC EA 2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET4.0C; .NET4.0E)
Timestamp: Sun, 28 Mar 2010 17:23:23 UTC


Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 796
Char: 13
Code: 0
URI: http://localhost/BESI/ScriptResource.axd?d=3HKc1zGdeSk2WM7LpI9tTpMQUN7bCfQaPKi6MHy3P9dace9kFGR5G-jymRLHm0uxZ0SqWlVSWl9vAWK5JiPemjSRfdtUq34Dd5fQ3FoIbiyQ-hcum2开发者_如何学Python1C-j06-c0YF7hE0&t=5f011aa5


Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 796
Char: 13
Code: 0
URI: http://localhost/BESI/ScriptResource.axd?d=3HKc1zGdeSk2WM7LpI9tTpMQUN7bCfQaPKi6MHy3P9dace9kFGR5G-jymRLHm0uxZ0SqWlVSWl9vAWK5JiPemjSRfdtUq34Dd5fQ3FoIbiyQ-hcum21C-j06-c0YF7hE0&t=5f011aa5


Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 796
Char: 13
Code: 0
URI: http://localhost/BESI/ScriptResource.axd?d=3HKc1zGdeSk2WM7LpI9tTpMQUN7bCfQaPKi6MHy3P9dace9kFGR5G-jymRLHm0uxZ0SqWlVSWl9vAWK5JiPemjSRfdtUq34Dd5fQ3FoIbiyQ-hcum21C-j06-c0YF7hE0&t=5f011aa5


Do you have the 4.0 framework installed on your deploy box? And in IIS in your web application, set as the website's framework?


I think I figured it out. It was a lucky friggin' guess. I believe the code worked before I upgraded to VS2010 RC.

The UpdatePanel UpdateMode property is set to "Conditional". I do this:

UpdatePanel1.Update()
DropDownList1.Focus()

When I set focus to the dropdown before I called the Update method, it seemed to work.

Is there a replacement for the ScriptManager? I thought I saw somewhere that this is no longer needed in 2010

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜