如何将master页面中的ajaxcontroltoolkit对象用于默认页面 [英] How to use ajaxcontroltoolkit object from master page into default page

查看:44
本文介绍了如何将master页面中的ajaxcontroltoolkit对象用于默认页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想使用在类库的母版页中定义的Scriptmanager对象。该类库已在另一个Web应用程序中引用,并且应用程序母版页引用了类库的母版页。现在我想从web应用程序向scriptmanager添加一个属性。目前我这样做: -



类库的代码: -



Hi,

I want to use Scriptmanager object defined in master page of a class library. That class library is been referred in another web application and the application master page is referencing to class library's master page. Now I want to add a attribute to scriptmanager from the web application. Currently I am doing like this:-

Class Library's code:-

protected void Page_Init(object sender, EventArgs e)
        {
            objscriptManager = new AjaxControlToolkit.ToolkitScriptManager();
            objscriptManager.ID = "scripManager";
            objscriptManager.CombineScripts = false;

         }



Web应用程序代码: -


Web application code:-

protected void Page_Load(object sender, EventArgs e)
        {
            AdminPage a = new AdminPage();
            a.objscriptManager.EnablePartialRendering = true;
        }





在wen应用程序中,我试图将scriptmanager的EnablePartialRendering属性更改为true;



可以有人帮助我使用此代码。执行此操作后,我在Web应用程序中收到Null引用错误。



谢谢



In wen application I am trying to change the "EnablePartialRendering" attribute of scriptmanager to true;

Could some one help me with this code. After doing this I am getting error for Null reference in the web application.

Thanks

推荐答案

你在默认的页面指令中看到EnablePartialRendering属性吗?!!



我的意思是<%@ Page
Cant you see "EnablePartialRendering" attribute in the default page directives ?!!

I mean at <%@ Page


其实您要求做的更改可以在我的Web应用程序中使用的dll中完成。我必须在我的Web应用程序中进行一些更改才能将EnablePartialRendering更改为TRUE。另外,在<%@ Page指令中不存在EnablePartialRendering。



谢谢,
Actually The change which you are asking to do can be done in the dll which is been used in my web application . I have to do some changes in my web application to change EnablePartialRendering to TRUE. Also EnablePartialRendering is not present in <%@ Page directives.

Thanks,


这篇关于如何将master页面中的ajaxcontroltoolkit对象用于默认页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆