用户控件呈现为html问题

时间:2012-08-25 05:41:00

标签: c# asp.net user-controls rendering

如何解决错误:

Script control 'upProgress' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl.

使用代码将用户控件呈现为html时出错:

  private string RenderControl(Control ctrl)
  {
        StringBuilder sb = new StringBuilder();
        StringWriter sw = new StringWriter(sb);
        HtmlTextWriter hw = new HtmlTextWriter(sw);

        ctrl.RenderControl(hw);

        return sb.ToString();
  }

upProgress是一个ajax更新面板进度条。

0 个答案:

没有答案