zoukankan
html css js c++ java
我提了愚蠢的问题: 如何在 Codebehind 中访问 WebUserControl (.ascx)?
卖个关子! 答案明天揭晓! 不要骂我!
其实很简单,在 ASPX 的 HTML 里可以访问到:
<%
@ Page language
=
"
c#
"
Codebehind
=
"
WebForm1.aspx.cs
"
AutoEventWireup
=
"
true
"
Inherits
=
"
WebApplication1.WebForm1
"
%>
<%
@ Register TagPrefix
=
"
uc1
"
TagName
=
"
WebUserControl1
"
Src
=
"
WebUserControl1.ascx
"
%>
<!
DOCTYPE HTML PUBLIC
"
-//W3C//DTD HTML 4.0 Transitional//EN
"
>
<
HTML
>
<
HEAD
>
<
title
>
WebForm1
</
title
>
<
meta name
=
"
GENERATOR
"
Content
=
"
Microsoft Visual Studio .NET 7.1
"
>
<
meta name
=
"
CODE_LANGUAGE
"
Content
=
"
C#
"
>
<
meta name
=
"
vs_defaultClientScript
"
content
=
"
JavaScript
"
>
<
meta name
=
"
vs_targetSchema
"
content
=
"
http://schemas.microsoft.com/intellisense/ie5
"
>
</
HEAD
>
<
body MS_POSITIONING
=
"
GridLayout
"
>
<
form id
=
"
Form1
"
method
=
"
post
"
runat
=
"
server
"
>
<
uc1:WebUserControl1 id
=
"
WebUserControl11
"
runat
=
"
server
"
></
uc1:WebUserControl1
>
<
script language
=
"
C#
"
runat
=
"
server
"
>
void
Page_Load(
object
sender, EventArgs e)
{
Response.Write(
"
HTML
"
);
this
.WebUserControl11.TextBox1.Text
=
"
HTML
"
;
//
调用在 Codebehind 里声明的 foo 方法将 WebUserControl 传到 Codebehind
this
.foo(WebUserControl11);
}
</
script
>
</
form
>
</
body
>
</
HTML
>
查看全文
相关阅读:
三、Antd react 组件调用ref的用法获取实例
三、gitextension 报错无法检出版本库的时候
二、安装引入 antd
一、React项目骨架搭建
一、JAVA基础知识
五、Maven创建Spring(IDEA2019-3-3)
python爬取快手ios端首页热门视频
接口测试之基础篇--http协议
一些测试面试题
性能测试一些相关的概念
原文地址:https://www.cnblogs.com/Microshaoft/p/137098.html
最新文章
svchost.exe
网络性能指标
dhcp
家用小路由器弊端
tcp udp
wireshark抓包获取好友ip,定位所在位置
Saltstack 安装与常用模块
ansible的playbook简单使用
Ansible入门与实践
rsync: chgrp "/.hosts.NBCxBB" (in test) failed: Operation not permitted (1)
热门文章
Docker入门与实践
k8s使用Glusterfs动态生成pv
python3 写的一个压测脚本(有待开发)
k8s使用glusterfs做存储
GlusterFS 安装配置
python3 自动识图
设置mysql允许远程连接
四、Antd组件扩展
一、CE的安装
一、Easy Mock的使用
Copyright © 2011-2022 走看看