aspx后台代码写在前段
2024-09-03 13:55:11
合并cs的代码
<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %> <%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="WcfService1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
string message = "aaaabbb";
Class1 cl = new Class1();
message = cl.GetData();
Label1.Text = message; }
</script>
参考文章:
http://www.cnblogs.com/studyzy/archive/2007/07/25/830856.html
最新文章
- 对jquery分页的升级
- 高效能人士必知铁律--note
- js验证函数摘录
- 使用WMI控制Windows进程 和服务
- MySQL教程及经常使用命令1.1
- HDU Wolf and Rabbit
- Android View系统解析(上)
- spring boot自定义starter
- bzoj5107: [CodePlus2017]找爸爸
- oracle存储过程和存储函数&;触发器
- 如何理解MVC?
- 移动应用滑动屏幕方向判断解决方案,JS判断手势方向
- ToList()分组用法...
- Freemarker 基本数据类型
- NameError: name &#39;picamera&#39; is not defined
- Codeforces Round #191 (Div. 2) B. Hungry Sequence(素数筛选法)
- sqlmap中tamper脚本绕过waf
- 随机森林(Random Forest)详解(转)
- Web中的中文参数乱码
- 关于swift 单元测试的补充