추가 (즉, 직원 추가) 기능을위한 동적 양식을 만들고 싶습니다. 모든 컨트롤 (TextBox, RadioButtonList, CheckBoxList, DropDownList)을 만들 수 있지만 DateTime 컨트롤을 만드는 방법을 모르겠습니다. :(DNN 7에서 .ascx 파일로 DNNDateTimePicker를 동적으로 만드는 방법은 무엇입니까?
DNN은 기성품 제어 (http://uxguide.dotnetnuke.com/UIPatterns/DatePicker.html)를 제공하지만 난 내 코드에서 동적으로 생성하는 방법을 모르겠어요.
나는이 (http://www.ashishblog.com/assign-datepicker-to-runtimedynamic-textboxes-in-asp-net-using-jquery/)을 읽고도하지만
작동하지 않습니다 아무도 나에게 링크 나 그것을 달성하는 방법을 제안 할 수 있습니다 그것이 내가 DNNDateTime 선택 도구를 사용하여 더 나은 것 여기
내 코드입니다 :?. View.ascx<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="View.ascx.cs" Inherits="Customer.Modules.CustomerDemo.View" %>
<div id="div_customer" style="visibility: visible">
<asp:PlaceHolder ID="mainPlaceHolder" runat="server"></asp:PlaceHolder>
</div>
,
View.ascx.cs -> 페이지로드 이벤트 당신은 당신의 모듈에 DotnetNuke.Web 및 Telerik.Web.UI 어셈블리를 포함 할 필요가
foreach (FieldsDetails item in listOfFields)
{
switch (item.FieldType)
{
case FieldTypes.Text:
TextBox textControl = new TextBox();
textControl.ID = "txt_" + item.FieldName;
textControl.Text = item.FieldValue;
textControl.TextChanged += TextControl_TextChanged; ;
mainPlaceHolder.Controls.Add(textControl);
break;
case FieldTypes.DropDown:
//code to create DropDown
break;
case FieldTypes.Checkbox:
//code to create Checkbox
break;
case FieldTypes.DateTime:
//code to create DateTime
//create TextBox control and apply class or Is there readyname DNN Control?
break;
}
}