|
反馈BUG
程序版本: |
FineUI v4.0.5.0 |
浏览器: |
IE9 |
BUG截图: |
|
BUG地址: |
- |
想动态生成表单控件后与数据表的字段建立关联,想到利用Attributes属性,可是发现页面设计的控件支持Attributes属性,可在查看源码中看得到,但是动态生成的控件却是在源码中看不到,应该是一个Bug
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FormEdit.aspx.cs" Inherits="Jazz.CRM.Setup.FormEdit" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
- <f:Panel ID="Panel1" runat="server" BodyPadding="5px" ShowBorder="true" ShowHeader="true" Title="Panel" Layout="Fit" BoxConfigAlign="StretchMax">
- <Items>
- <f:Form ID="Form2" runat="server" BodyPadding="5px" Title="Form" ShowHeader="false" ShowBorder="false">
- <Rows>
- <f:FormRow ID="FormRow1" runat="server">
- <Items>
- <f:TextBox ID="txtTitle" runat="server" Label="表单标题" Text=""></f:TextBox>
- </Items>
- </f:FormRow>
- </Rows>
- </f:Form>
- </Items>
- </f:Panel>
- </div>
- </form>
- </body>
- </html>
复制代码- using System;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- namespace Jazz.CRM.Setup
- {
- public partial class FormEdit : System.Web.UI.Page
- {
- protected void Page_Init(object sender, EventArgs e)
- {
- FineUI.TextBox dyTextBox = new FineUI.TextBox();
- dyTextBox.Label = "动态生成";
- dyTextBox.ID = "dy123";
- SetAttributes(dyTextBox);
- FormRow1.Items.Add(dyTextBox);
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- SetAttributes(txtTitle);
- }
- protected void SetAttributes(FineUI.TextBox textBox)
- {
- string jsonStr=@"{'FromTable':'111','FromFieldName':'aaa','ToTable':'222','ToFieldName':'bbb'}";
- JObject jObject = (JObject)JsonConvert.DeserializeObject(jsonStr);
- textBox.Attributes = jObject;
- }
- }
- }
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|