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
>
查看全文
相关阅读:
php RabbitMQ使用
phalcon: 开启模板缓存和缓存路径
phalcon:整合官方多模块功能,方便多表查询
mysql: 模糊查询 feild like keyword or feild like keyword , concat(feild1,feild2,feild3) like keyword
php的http数据传输get/post...
java大数字操作:BigInteger,BigDecimal(浮点型)
DecimalFormat数据格式函数
MySQL比like语句更高效的写法locate position instr find_in_set
mysql中使用instr替换like
mysql中的多行查询结果合并成一个
原文地址:https://www.cnblogs.com/Microshaoft/p/137098.html
最新文章
〔原创〕Ubuntu Linux Server 9.04 安装全程图解
Mount CIFS
程序员必须知道的10大基础实用算法
linux内核设计学习
Linux 调度器发展简述
linux 调度总结(转载)
ALSA lib调用实例
ubuntu 12.04安装alsa-lib、alsa-utils【转】
Ubuntu下声卡驱动解决方法alsa
ubuntu:undefined reference to `snd_pcm_open'
热门文章
ubuntu下如下错误alsa/asoundlib.h: No such file or directory
怎样使用alsa API
/dev/sda2 is mounted; will not make a filesystem here!
如何配置DSI时钟频率
mtk6589显示子系统笔记(一)
如何只在堆或者栈上分配类对象
C语言一个双向链表的实现
linux 一个超简单的makefile
C语言一个单链表的实现
秒懂单链表及其反转(reverse)
Copyright © 2011-2022 走看看