在formview中的Asp.net C#日期选择器 [英] Asp.net C# date picker in a formview

查看:55
本文介绍了在formview中的Asp.net C#日期选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上的人们,

需要一些帮助,希望这里有一些更聪明的。



基本上,我需要一个日期选择器ASP.net C#页面上的一个formview。



这是我到目前为止所提出的,但似乎无法使事情正常工作。< br $>


< asp:FormView ID =KeyDates_FVrunat =serverCellPadding =4DataKeyNames =IDDataSourceID =KeyDates_SQLForeColor =#333333 GridLines =两者OnDataBound =KeyDates_FV_DataBound>

< edititemtemplate>

LAA_PlanDate:

< asp:TextBox ID = LAA_PlanDateTextBoxrunat =serverText ='<%#Bind(LAA_PlanDate)%>'/>

< asp:Calendar ID =LAA_PlanDate_CALrunat =server ForeColor =White>



< asp:ImageButton ID =LAA_PlanDate_IMBrunat =serverImageAlign =BottomImageUrl =〜/ Images /Calendar_icon.pngWidth =16px/> ;



我的尝试:



提前感谢您的支持对此有任何帮助。

Evening folks,
Need some help and hopefully there are some smarter ones here.

Basically, I need a date picker in a formview on an ASP.net C# page.

This is what I have come up with so far but just can't seem to get things to work correctly.

<asp:FormView ID="KeyDates_FV" runat="server" CellPadding="4" DataKeyNames="ID" DataSourceID="KeyDates_SQL" ForeColor="#333333" GridLines="Both" OnDataBound="KeyDates_FV_DataBound">
<edititemtemplate>
LAA_PlanDate:
<asp:TextBox ID="LAA_PlanDateTextBox" runat="server" Text='<%# Bind("LAA_PlanDate") %>' />
<asp:Calendar ID="LAA_PlanDate_CAL" runat="server" ForeColor="White" >

<asp:ImageButton ID="LAA_PlanDate_IMB" runat="server" ImageAlign="Bottom" ImageUrl="~/Images/Calendar_icon.png" Width="16px" />

What I have tried:

Thank you in advance for any help on this.

推荐答案

引用:

表单视图咆哮着我。 (对象引用未设置为对象的实例)。

the form view barks at me. (Object reference not set to an instance of an object).





您的FormView ID设置为KeyDates_FV并且在您的代码中,您正在使用 FormView1.FindControl(LAA_PlanDate_CAL);



FormView1 首先不存在。所以你想做这样的事情:





Your FormView ID was set to "KeyDates_FV" and in your code, you are using FormView1.FindControl("LAA_PlanDate_CAL");

FormView1 doesn't exist in the first place. So you want to do something like this instead:

Calendar LAA_PlanDate_CAL = (Calendar)KeyDates_FV.FindControl("LAA_PlanDate_CAL");


Facepalm!捂脸! Facepalm!



@Vincent Maverick非常感谢你!我觉得后面是一头奶牛的后端。我一直在桌子上敲了两个星期来解决这个问题。



谢谢!谢谢!谢谢!
Facepalm! Facepalm! Facepalm!

@Vincent Maverick THANK YOU SOOO MUCH! I feel like the hind end of a cows rear. I have been banging my head on the desk for two weeks to figure this out.

Thank you! Thank you! Thank you!


这篇关于在formview中的Asp.net C#日期选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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