页面代码如下。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MYDDC.aspx.cs" Inherits="MYDDC.MYDDC" %><!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 type="text/javascript">
function pageLoad() {
}
</script> <style type="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table class="style1">
<tr>
<td colspan="2" style="text-align: center">
<asp:Label ID="lbl_BT" runat="server" Text="标题"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Label ID="lbl_NR" runat="server" Text="内容"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Table ID="tab_MYDDC" runat="server">
</asp:Table>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
就是只有一个Table控件。后台代码
/// <summary>
/// 设置满意度调查内容
/// </summary>
/// <returns></returns>
public void set_MYDDC(Table table)
{
TableRow tr = new TableRow();
TableCell tc = new TableCell();
table.HorizontalAlign = HorizontalAlign.Center;
tc.Text = "<asp:Label ID=\"lbl_YWB\" runat=\"server\" Text=\"您对医务部总体评价如何?\"></asp:Label><br />"
+ "<asp:RadioButtonList ID=\"rbl_YWB\" runat=\"server\" AutoPostBack=\"True\" OnSelectedIndexChanged=\"rbl_YWB_SelectedIndexChanged\">"
+ "<asp:ListItem>满意</asp:ListItem>"
+ "<asp:ListItem>基本满意</asp:ListItem>"
+ "<asp:ListItem>一般</asp:ListItem>"
+ "<asp:ListItem>不满意</asp:ListItem>"
+ "<asp:ListItem>不了解</asp:ListItem>"
+ "</asp:RadioButtonList>"
+ "<asp:Panel ID=\"Panel1\" runat=\"server\" Visible=\"false\">"
+ "<asp:CheckBoxList ID=\"CheckBoxList1\" runat=\"server\" Height=\"25px\" Width=\"1089px\">"
+ "<asp:ListItem>服务态度不好</asp:ListItem>"
+ "<asp:ListItem>缺少与临床沟通</asp:ListItem>"
+ "<asp:ListItem>帮助临床协调解决问题能力有待提高</asp:ListItem>"
+ "</asp:CheckBoxList>"
+ "<asp:Label ID=\"Label1\" runat=\"server\" Text=\"其它意见和建议\"></asp:Label><br />"
+ "<asp:TextBox ID=\"TextBox1\" runat=\"server\" Height=\"80px\" Width=\"1086px\"></asp:TextBox>"
+ "</asp:Panel>";
tr.Cells.Add(tc);
table.Rows.Add(tr);
}
但是这样根本不行。不知道是不是因为是asp:...控件的原因?
总之是希望实现网站内容用代码来实现。并不一定需要Table来控制。其它的也行
这个是个满意度调查系统。目的就是希望,所有内容能够自定义的去控制,方便后台维护
希望各路侠客赐教,求解脱
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MYDDC.aspx.cs" Inherits="MYDDC.MYDDC" %><!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 type="text/javascript">
function pageLoad() {
}
</script> <style type="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table class="style1">
<tr>
<td colspan="2" style="text-align: center">
<asp:Label ID="lbl_BT" runat="server" Text="标题"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Label ID="lbl_NR" runat="server" Text="内容"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Table ID="tab_MYDDC" runat="server">
</asp:Table>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
就是只有一个Table控件。后台代码
/// <summary>
/// 设置满意度调查内容
/// </summary>
/// <returns></returns>
public void set_MYDDC(Table table)
{
TableRow tr = new TableRow();
TableCell tc = new TableCell();
table.HorizontalAlign = HorizontalAlign.Center;
tc.Text = "<asp:Label ID=\"lbl_YWB\" runat=\"server\" Text=\"您对医务部总体评价如何?\"></asp:Label><br />"
+ "<asp:RadioButtonList ID=\"rbl_YWB\" runat=\"server\" AutoPostBack=\"True\" OnSelectedIndexChanged=\"rbl_YWB_SelectedIndexChanged\">"
+ "<asp:ListItem>满意</asp:ListItem>"
+ "<asp:ListItem>基本满意</asp:ListItem>"
+ "<asp:ListItem>一般</asp:ListItem>"
+ "<asp:ListItem>不满意</asp:ListItem>"
+ "<asp:ListItem>不了解</asp:ListItem>"
+ "</asp:RadioButtonList>"
+ "<asp:Panel ID=\"Panel1\" runat=\"server\" Visible=\"false\">"
+ "<asp:CheckBoxList ID=\"CheckBoxList1\" runat=\"server\" Height=\"25px\" Width=\"1089px\">"
+ "<asp:ListItem>服务态度不好</asp:ListItem>"
+ "<asp:ListItem>缺少与临床沟通</asp:ListItem>"
+ "<asp:ListItem>帮助临床协调解决问题能力有待提高</asp:ListItem>"
+ "</asp:CheckBoxList>"
+ "<asp:Label ID=\"Label1\" runat=\"server\" Text=\"其它意见和建议\"></asp:Label><br />"
+ "<asp:TextBox ID=\"TextBox1\" runat=\"server\" Height=\"80px\" Width=\"1086px\"></asp:TextBox>"
+ "</asp:Panel>";
tr.Cells.Add(tc);
table.Rows.Add(tr);
}
但是这样根本不行。不知道是不是因为是asp:...控件的原因?
总之是希望实现网站内容用代码来实现。并不一定需要Table来控制。其它的也行
这个是个满意度调查系统。目的就是希望,所有内容能够自定义的去控制,方便后台维护
希望各路侠客赐教,求解脱
解决方案 »
- 用正则表达式提取表格中的数据
- 送分了,求一个正则!标题要长········急···································
- 好奇怪的问题,你一定感兴趣......
- 怎么解决以下这个事件的参数问题?
- 烦了几天,为了这个错误,仍未解决!!!
- 送分,用asp.net如何实现自动读取mp3文件信息?
- 为什么我在dreamweaver中做asp的网页保存路径是http://localhost/index.htm,F12后的路径却是http://localhost/TMPjoo8kfbkw.asp
- 关于同时读取数据库中几个表的问题
- 关于流程管理,大家发表一下高见,谢谢
- 请问我放在datagrid中模版列页脚中的服务器端控件怎样进行控制?
- ext3.3 调用问题
- 求解决
<asp:Label ID=\"lbl_YWB\" runat=\"server\" Text=\"您对医务部总体评价如何?\"></asp:Label><br />"
+ "<asp:RadioButtonList ID=\"rbl_YWB\" runat=\"server\" AutoPostBack=\"True\" OnSelectedIndexChanged=\"rbl_YWB_SelectedIndexChanged\">"
+ "<asp:ListItem>满意</asp:ListItem>"
+ "<asp:ListItem>基本满意</asp:ListItem>"
+ "<asp:ListItem>一般</asp:ListItem>"
+ "<asp:ListItem>不满意</asp:ListItem>"
+ "<asp:ListItem>不了解</asp:ListItem>"
+ "</asp:RadioButtonList>"
+ "<asp:Panel ID=\"Panel1\" runat=\"server\"放在一个string str="这里面";前台用<%=str%>
如果包含CSS和JS
CSS和JS也不能丢这样肯定不能方便维护 维护的话 写XML里吧
TextBox tb = new TextBox();
tb.Text="动态添加的TextBox";
//tb.其他属性
this.Controls.Add(tb);
做个table,里面直接add控件?好像可行。我去试试。先谢谢大家了。