ClassLibraryWeiBao/WebSurvey/WebSurveyDesigner.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace sstchur.web.survey.designer
{
using System;
using System.IO;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class WebSurveyDesigner : ControlDesigner
{
public HtmlTable table = new HtmlTable();
public WebSurveyDesigner()
{
this.table.Border = 0;
this.table.CellSpacing = 0;
this.table.Width = "30%";
this.table.Attributes.Add("style", "border: dashed 1px #000000; background-color: #ffffcc; font-family: arial; font-size: 12px;");
}
public override string GetDesignTimeHtml()
{
HtmlTableRow row = new HtmlTableRow();
row.VAlign = "top";
row.Align = "center";
HtmlTableCell cell = new HtmlTableCell();
cell.InnerHtml = "<b>sstchur's WebSurvey Control</b>";
row.Cells.Add(cell);
this.table.Rows.Add(row);
row = new HtmlTableRow();
cell = new HtmlTableCell();
Label child = new Label();
child.Text = "<b>What is your name?</b>";
TextBox box = new TextBox();
box.Columns = 30;
cell.Controls.Add(new LiteralControl("<br>"));
cell.Controls.Add(new LiteralControl("<p>"));
cell.Controls.Add(child);
cell.Controls.Add(new LiteralControl("<br>"));
cell.Controls.Add(box);
cell.Controls.Add(new LiteralControl("<p>"));
cell.Controls.Add(new LiteralControl("<p>"));
RadioButtonList list = new RadioButtonList();
list.Attributes.Add("style", "font-size: 12px;");
list.Items.Add("Red");
list.Items.Add("Blue");
list.Items.Add("Green");
cell.Controls.Add(list);
cell.Controls.Add(new LiteralControl("</p>"));
Button button = new Button();
button.Text = "Submit";
cell.Controls.Add(new LiteralControl("<p>"));
cell.Controls.Add(button);
cell.Controls.Add(new LiteralControl("</p>"));
child = new Label();
child.Text = "<p><b>Note:</b> <small>The above questions are only samples displayed at design-time. Actual questions will be generated at run-time based on the XML in your SurveyFile.</small></p>";
cell.Controls.Add(child);
row.Cells.Add(cell);
this.table.Rows.Add(row);
后面还有 8 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。