开发者

Is there a way to do low-level debugging of ASP.NET PostBacks

I'm having a problem with a user control I'm developing which contains a ListView bound to an ICollection<T> and a DataPager. What I'm finding is that when the pager links are clicked, a PostBack is initiated and the Page_Load and Page_PreRender events are hit, but my DataPager's PagePropertiesChanging event handler method is never fired. The control I'm developing is used in a Sitecore website which may possibly be causing ClientID's to get messed up preventing postback events to be handled correctly.

What I want to know is if there is any way to debug, at a low-level, the postbacks to see how postback information is mapped to the different event handlers.

I've already seen the following questions but they don't seem have a solution to this pro开发者_开发技巧blem. Question 1, Question 2.

Also this bug (archived) reported about the ListView.


Did you check against this issue?

Gridview empty when SelectedIndexChanged called

Further reading

typesThatShouldNotBeExpanded


Personally I'd set up a new test in your favourite testing framework (you are writing unit tests...right?) and mock out the HttpContext so as to easily test what's going on when you're initiating your postbacks.

This way you'll be able to see exactly what's going on at each step of the postback.

You'll be able to do a couple of interesting things this way. Firstly you'll be able to send the data in the same way that your web app is doing so, and secondly you'll be able to easily modify the data being sent to see which parts of it might be causing certain problems (such as ClientID's as mentioned above).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜