html代码是由我ascx.cs page_load事件部件自动生成的。
然后,我想直接获取要保存的html元素的值。那么我该怎么做呢
这。html代码没有属性(Runat)。
这是一个关于我的Html代码生成的例子。
function genWorkOpinion(UserId) {
var col;
var tta;
var Label;
var now = new Date();
var id = now.getHours().toString() + now.getMinutes() + now.getSeconds() + now.getMilliseconds();
var bossCount = 0;
col = window.jQuery("<div class='col-md-12'>");
Label = window.jQuery("<Label>").text("SomeText");
tta = window.jQuery("<textarea id='" + id + "'>").attr("style", "width:100%; height:100px");
col.append(Label);
col.append(tta);
window.jQuery("#workOpinion").append(col);
}发布于 2016-06-15 12:30:17
您应该将name属性添加到input标记或任何html元素中,例如:
<input type="text" id="name" name="name"/>然后你可以在代码中获得它,如下所示:
if (IsPostBack)
{
nameBox = Request.Form["name"];
Response.Write("Name: " + nameBox);
}https://stackoverflow.com/questions/37824717
复制相似问题