关于c#.net里aspx页面,用insertAdjacentHTML添加相同行的问题?

关于c#.net里aspx页面,用insertAdjacentHTML添加相同行的问题?,第1张

为什么一定要用DropDownList啊,DropDownList是州裂肆服务器端控件,不能在客户端生成,可以用select啊

************************已测试***************************

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">

<title>Untitled Page</title>

<link href="../index.css" rel="stylesheet" type="text/css" />源慎

</head>

<script type="text/javascript">

var picNum=0

var No_sys=0

function Add_button()

{

if(No_sys<8)

{

c_input.insertAdjacentHTML("beforeEnd",'<table style="position: relativewidth: 429pxborder-left:1px solid #E0E0E0border-right:1px solid #E0E0E0border-bottom:1px solid #E0E0E0"><tr bgcolor="white"><td align="center" style="width: 100px">类别</td><td><select name="ddlcate1" id="ddlcate1" style="position: relative"><册轿option value="啊啊啊啊">啊啊啊啊</option></select></td></tr></table>')

picNum++

No_sys++

}

}

</script>

<body>

<form action="" runat="server" >

<div id="c_input">

<table style="position: relativeleft: 0pxwidth: 429pxborder: 1px solid #E0E0E0">

<tr bgcolor="white">

<td align="center" style="width: 100px">

类别</td>

<td>

<select name="ddlcate1" id="ddlcate1" style="position: relative">

<option value="啊啊啊啊">啊啊啊啊</option>

</select>

<%--<asp:DropDownList ID="ddlcate1" runat="server" Style="position: relative">

<asp:ListItem Value="啊啊啊啊">啊啊啊啊</asp:ListItem>

</asp:DropDownList>--%></td>

</tr>

</table>

</div>

<table style="position: relativewidth: 429pxborder: 1px solid #E0E0E0border-top: 0px">

<tr>

<td style="width: 100pxheight: 26px">

</td>

<td style="width: 100pxheight: 26px">

<input type="button" onclick="Add_button()" value="动态加">

</td>

<td style="width: 100pxheight: 26px">

</td>

<td style="height: 26px">

<input id="button" type="button" value="上传图片" runat="server"

style="position: relativewidth: 69pxleft: 9pxcursor: hand" causesvalidation="true" /></td>

</tr>

</table>

</form>

</body>

</html>

******************************************************

比如1.aspx

你再新缺乱颂建一个1.aspx.cs文件

然后在1.aspx的源视图里伏郑面加上

<%@ Page Language="C#" validateRequest="false" AutoEventWireup="true" CodeFile="1.aspx.cs" Inherits="你的类" %>陪旦


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/bake/11994652.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存