weixin_33698823 2009-10-29 16:00 采纳率: 0%
浏览 27

ASP.NET UpdatePanel回发

I created a marker interface:

public interface ISupportAJAXPostsBacks{}

I added it to my Page..

public partial class MyWebForm : PageBase, ISupportAJAXPostsBacks

I have this check in my PageBase class...

if(this is ISupportAJAXPostsBacks)
{
   ... do some stuff ...
}

If I step through via the debugger, "this is ISupportAJAXPostsBacks" evaluates to true for the initial page load, but evaluates to false when an UpdatePanel posts back on that same page. (scratches head)

What is happening under the covers to cause this and what can I do about it?

  • 写回答

2条回答 默认 最新

  • weixin_33701564 2009-10-29 17:47
    关注

    I could not replicate your situation, but some ideas for things to check...

    -the if statement should be in an override of OnLoad in your PageBase

    -the if statement should be before the base.OnLoad(e) call in that override method

    -check settings on your ScriptManager control... in particular the EnablePartialRendering and EnablePageMethods

    I think the last item would only be an issue if you were actually using those methods, but if you do have them enabled I would try disabling them. Hope that helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法