62,074
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>
<!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>
<script language="javascript">
var controlValue;
function addRow(){
controlValue='<%=this.theValue %>';
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="s"></div>
<input id="Button1" type="button" value="button" onclick="addRow();document.getElementById('s').innerHTML=controlValue;" />
</div>
</form>
</body>
</html>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default4 : System.Web.UI.Page
{
protected string theValue;
protected void Page_Load(object sender, EventArgs e)
{
Session["theVal"] = "asdf";
theValue = Session["theVal"].ToString();
}
}
<script type="text/javascript">
function f()
{
var i='<%= Session["mysin"] %>';
alert(i);
}
</script>
<link href="Style/globe.css" rel="stylesheet" type="text/css" />
</head>
<body onload="f()">
var i=2;
while(i--)
{
var newcell = newrow.insertCell();
switch(i){
case 1: newcell.innerHTML= '<input type="button" onClick="javascript:removeRow(this.parentElement.parentElement)" value="删除">';break;
default: newcell.innerHTML= andOrValue+" "+ fieldItem + " " + operatorItem+ " "+controlValue;
break;