如何在运行时设置SkinId [英] How to set SkinId During runtime

查看:134
本文介绍了如何在运行时设置SkinId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用按钮控件,单击按钮时需要设置SkinId.

I am using a button control,I need to set the SkinId when Button is clicked.

protected void Page_PreInit(object sender, EventArgs e)
    {
        btCreateDocumentBox.SkinID = "selectedButton";
     }



我遇到类似
的异常 对象引用未设置为对象的实例"



I am getting an exception like
"Object reference not set to an instance of an object"

推荐答案

您是否尝试在OnPreInit方法中设置SkinID?这是通常动态应用主题等的地方.只是一个想法.
Have you tried setting the SkinID in the OnPreInit method? This is where Themes and such like are generally applied dynamically. Just a thought.


这篇关于如何在运行时设置SkinId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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