Page_Init()上的用户控件属性 [英] Usercontrol properties on Page_Init()

查看:74
本文介绍了Page_Init()上的用户控件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,
如何在.ascx页面的Page_Init()事件上设置Usercontrol属性.
我的属性如下:

Dear Friends,
how to set the Usercontrol properties on Page_Init() event of .ascx page.
my properties is like below:

public string Tablename
   {
       get
       {
           return this.tablename;
       }
       set
       {
           this.tablename = value;
       }
   }
protected void Page_Init(object sender, EventArgs e)
    {

    }


问候,
Aamir


regards,
Aamir

推荐答案

您设置了它们,仅此而已.在init中执行此操作的主要原因是要确保它在任何页面加载事件触发之前发生,但是您只需对其进行设置即可.问题出在哪里?
You set them, that is all. The main reason to do it in init is to make sure it happens before any page load events fire, but you just set them. Where is the issue ?


got回答了我的问题.
在ascx.cs页面的page_load()上
我必须打电话给
TextBox.Maxlength = length
及其工作原理:)
got Answer to my Question.
on page_load()of the ascx.cs page
i have to call the,
TextBox.Maxlength=length
and its working :)


这篇关于Page_Init()上的用户控件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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