将值从aspx传递给ascx [英] Pass a value from aspx to ascx
本文介绍了将值从aspx传递给ascx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网页,其中包含一个用户控件.我在aspx页面上有一个属性,该属性在pageinit方法中设置,因此我需要在ascx页面上使用该属性.我怎么能得到它?
I have a web page and it contains an user control inside of it. I have a property on the aspx page which gets set in the pageinit method and I need to that propery on ascx page. How can I get it?
推荐答案
在ascx内创建一个公共属性,并在设置aspx页面的同时对其进行设置.
Create a public property inside the ascx and set it at the same time you set in the aspx page.
让您知道,PreInit是 EventHandler 不是方法.
Just to let you know, PreInit is a EventHandler not a method.
这篇关于将值从aspx传递给ascx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文