惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
腾讯CDC
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
博客园 - 司徒正美
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
Vercel News
Vercel News
爱范儿
爱范儿
Last Week in AI
Last Week in AI
G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园_首页
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
V
V2EX
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理

博客园 - Jason.Yi

远程机器上无法用Assembly.Load(path).CreateInstance(ClassName)? - Jason.Yi - 博客园 vs2005代码区出现问题 吉他自录之《回忆组曲》 吉他自录之《爱的罗曼史》 求助:Vs2005 asp.net development server未能开始侦听端口 为什么我的Cookie只能更新一个键值? 对Graphics.DrawImageUnscaledAndClipped的疑虑 哪些原因可能导致SQL操作操时呢? 二个算法题,大家有兴趣来看看 关于博客园的Calendar 费解的.net2.0中的ObjectDataSource控件 FormView在什么情况下自动生成模板项? 生成随机的颜色值 错误:已在多处定义 为什么本地sqlservr.exe进程占用内存如此之大? 简单的生成登录验证码的程序 遇到一个很奇怪的问题 连接SQL Server2005出错 能在web.config里做这样的配置吗?
这样的页面该如何实现?
Jason.Yi · 2006-01-21 · via 博客园 - Jason.Yi

十几个.aspx页面
每个页面都要根据用户是否登录来显示表单或欢迎信息。
所以想把这个登录的信息写成一个UserControl来实现。
uc写完以后

private void InitializeComponent()
        {
            
this.Button1.Click += new System.EventHandler(this.Button1_Click);
            
this.Load += new System.EventHandler(this.Page_Load);

        }

#endregionprivate void Button1_Click(object sender, System.EventArgs e)
        {
            
string username = TextBox1.Text.Trim();
            
string pwd = this.TextBox2.Text.Trim();
            Response.Write(
"hello");
            Response.End();
            username 
= function.safeString(username);
            pwd 
= function.safeString(pwd);
            
if(userBll.IsHas(username,pwd))
            {
                
this.logForm.Visible = false;
                
this.logSuss.Visible = true;
            }
        }

有了Button_click事件,在.aspx中调用该uc,为什么点击了button却不执行上面的事件?这是为何?难道uc中的所有控件事件都能只交给调用它的.aspx页面去处理?
盼解答!