数据绑定:"DatePickerControl.DatePicker"不包含名称为"SelectedDate"的属性. [英] DataBinding: 'DatePickerControl.DatePicker' does not contain a property with the name 'SelectedDate'.

查看:70
本文介绍了数据绑定:"DatePickerControl.DatePicker"不包含名称为"SelectedDate"的属性.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

异常详细信息:System.Web.HttpException:数据绑定:"DatePickerControl.DatePicker"不包含名称为"SelectedDate"的属性.

源错误:

第31行:DataSource.InsertParameters.Add("UserId",UserGUID.ToString());
第32行:
第33行:DataSource.Insert(); //这里是错误

当我点击createuserwizard的创建用户"按钮时,会出现此错误.我在想也许我不能将datepicker存储到我的sqldatasource中.

这是我的html代码:

Exception Details: System.Web.HttpException: DataBinding: ''DatePickerControl.DatePicker'' does not contain a property with the name ''SelectedDate''.

Source Error:

Line 31: DataSource.InsertParameters.Add("UserId", UserGUID.ToString());
Line 32:
Line 33: DataSource.Insert(); //here is the error

This error appear when I hit "create user" button of the createuserwizard. I was thinking maybe I can''t store the datepicker into my sqldatasource.

This is my html code:

<asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"

      InsertCommand="INSERT INTO [UserDetails] ([UserId], [CustName], [CustNum], [CustRole], [CustStatus], [PName], [PEmail], [PRole], [WedDate]) VALUES (@UserId, @CustName, @CustNum, @CustRole, @CustStatus, @PName, @PEmail, @PRole, @WedDate)"

      ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>">
      <InsertParameters>
          <asp:ControlParameter Name="CustName" Type="String" ControlID="CustName" PropertyName="Text" />
          <asp:ControlParameter Name="CustNum" Type="String" ControlID="CustNum" PropertyName="Text" />
          <asp:ControlParameter Name="CustRole" Type="String" ControlID="CustRole" PropertyName="Text" />
          <asp:ControlParameter Name="CustStatus" Type="String" ControlID="CustStatus" PropertyName="Text" />
          <asp:ControlParameter Name="PName" Type="String" ControlID="PName" PropertyName="Text" />
          <asp:ControlParameter Name="PEmail" Type="String" ControlID="PEmail" PropertyName="Text" />
          <asp:ControlParameter Name="PRole" Type="String" ControlID="PRole" PropertyName="Text" />
          <asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedDate"/>
      </InsertParameters>

  </asp:SqlDataSource>




这是数据选择器的代码:




here is code for datapicker:

<td class="style1">
                             <cc1:DatePicker ID="WedDate" runat="server" CalendarDate=""

                                 TextCssClass="" />
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" ControlToValidate="WedDate"

                                 ErrorMessage="Wedding date required"/>
                         </td>

推荐答案

ConnectionStrings:ASPNETDBConnectionString1 %> " InsertCommand =" ProviderName =" <%
ConnectionStrings:ASPNETDBConnectionString1 %>" InsertCommand="INSERT INTO [UserDetails] ([UserId], [CustName], [CustNum], [CustRole], [CustStatus], [PName], [PEmail], [PRole], [WedDate]) VALUES (@UserId, @CustName, @CustNum, @CustRole, @CustStatus, @PName, @PEmail, @PRole, @WedDate)" ProviderName="<%


ConnectionStrings:ASPNETDBConnectionString1.ProviderName %> " < InsertParameters > < asp:ControlParameter 名称 =" 类型 字符串" ControlID 客户名称" 属性名称 文本" / > < asp:ControlParameter 名称 =" 类型 字符串" ControlID 客户编号" PropertyName 文本" / > < asp:ControlParameter 名称 =" 类型 字符串" ControlID 客户角色" PropertyName 文本" / > < asp:ControlParameter 名称 =" 类型 字符串" ControlID 客户状态" PropertyName 文本" / > < asp:ControlParameter 名称 =" 类型 字符串" ControlID PName" 属性名称 文本" / > < asp:ControlParameter 名称 =" 类型 字符串" ControlID PEmail" 属性名称 文本" / > < asp:ControlParameter 名称 =" 类型 字符串" ControlID PRole" 属性名称 文本" / > < asp:ControlParameter 名称 =" 类型 DateTime " ControlID 结婚日期 PropertyName SelectedDate" > < /InsertParameters > < /asp:SqlDataSource >
ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>"> <InsertParameters> <asp:ControlParameter Name="CustName" Type="String" ControlID="CustName" PropertyName="Text" /> <asp:ControlParameter Name="CustNum" Type="String" ControlID="CustNum" PropertyName="Text" /> <asp:ControlParameter Name="CustRole" Type="String" ControlID="CustRole" PropertyName="Text" /> <asp:ControlParameter Name="CustStatus" Type="String" ControlID="CustStatus" PropertyName="Text" /> <asp:ControlParameter Name="PName" Type="String" ControlID="PName" PropertyName="Text" /> <asp:ControlParameter Name="PEmail" Type="String" ControlID="PEmail" PropertyName="Text" /> <asp:ControlParameter Name="PRole" Type="String" ControlID="PRole" PropertyName="Text" /> <asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedDate"/> </InsertParameters> </asp:SqlDataSource>




这是数据选择器的代码:




here is code for datapicker:

<td class="style1">
                             <cc1:DatePicker ID="WedDate" runat="server" CalendarDate=""

                                 TextCssClass="" />
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" ControlToValidate="WedDate"

                                 ErrorMessage="Wedding date required"/>
                         </td>


Soooo ...您正在使用谁的DatePicker控件?从错误消息中很明显,它没有公开"SelectedDate"属性.除了阅读控件上的文档并查看实际的属性名称并修改ControlParameter ProeprtyName字段以使其匹配之外,我不知道该告诉您什么.
Soooo...whos DatePicker control are you using? It''s pretty obvious from the error message that it doesn''t expose a "SelectedDate" property. I don''t know what to tell you, other than read the documentation on the control and see what the property name actually is and modify your ControlParameter ProeprtyName field to match it.


这篇关于数据绑定:"DatePickerControl.DatePicker"不包含名称为"SelectedDate"的属性.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆