I have been trying to learn to develop my own module for some time now. Been all over Michael Washington's web site and have 4-5 books on module development. I've made some progress, but continue to encounter hurdles and I have to figure ways around because usually I can't get over them! I'm stuck at one that I can't figure out and need some help!
I'm using C# & LINQ. I've got the standard functionality working, but am having to modify some of the data before posting to the database. Specifically I'm trying to get 3 DropDownLists to gather date information (day, month, year) and then I want to concatenate them together for my date field. I am able to alter data correctly before posting to the database (I've tested with simple numbers), but I'm having trouble with the code behind recognizing my DropDownList ID's. I've checked the file inheritance and everything is configured correctly. Somehow just staring at the computer for several hours doesn't help me either.
I'm using a FormView on the page. In the source of the FormView I have 3 template areas "
EditItemTemplate", "
InsertItemTemplate", & "
Itemtemplate" where the code for each view is located. I've got these 3 DropDownLists inside of the
InsertItemTemplate area, but cannot get them to show up in the Intellisense or "Code Hinting" in the code behind when typing. Also, if I type them all the way out, it still doesn't recognize them.
I just noticed that If I move these DropDownLists outside of the FormView region that the code behind then recognizes them as normal and they show up in the intellisense. Obviously, I need for them to be inside of the "
InsertItemTemplate" in order to make it work.
Do you know of any way for the code behind to reference DropDownLists inside of the template areas in a FormView?
As always, thanks for your time!
Regards,
Clint
_____________________________________________________________
Here's the InsertItemTemplate Code
<InsertItemTemplate>
Date:
<asp:DropDownList ID="DateMonth" runat="server" Text='<%# Bind("Date") %>' >
<asp:ListItem Value="01">Jan</asp:ListItem>
<asp:ListItem Value="02">Feb</asp:ListItem>
<asp:ListItem Value="03">Mar</asp:ListItem>
<asp:ListItem Value="04">Apr</asp:ListItem>
<asp:ListItem Value="05">May</asp:ListItem>
<asp:ListItem Value="06">Jun</asp:ListItem>
<asp:ListItem Value="07">Jul</asp:ListItem>
<asp:ListItem Value="08">Aug</asp:ListItem>
<asp:ListItem Value="09">Sep</asp:ListItem>
<asp:ListItem Value="10">Oct</asp:ListItem>
<asp:ListItem Value="11">Nov</asp:ListItem>
<asp:ListItem Value="12">Dec</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DateDay" runat="server">
<asp:ListItem>01</asp:ListItem>
<asp:ListItem>02</asp:ListItem>
<asp:ListItem>03</asp:ListItem>
<asp:ListItem>04</asp:ListItem>
<asp:ListItem>05</asp:ListItem>
<asp:ListItem>06</asp:ListItem>
<asp:ListItem>07</asp:ListItem>
<asp:ListItem>08</asp:ListItem>
<asp:ListItem>09</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>11</asp:ListItem>
<asp:ListItem>12</asp:ListItem>
<asp:ListItem>13</asp:ListItem>
<asp:ListItem>14</asp:ListItem>
<asp:ListItem>15</asp:ListItem>
<asp:ListItem>16</asp:ListItem>
<asp:ListItem>17</asp:ListItem>
<asp:ListItem>18</asp:ListItem>
<asp:ListItem>19</asp:ListItem>
<asp:ListItem>20</asp:ListItem>
<asp:ListItem>21</asp:ListItem>
<asp:ListItem>22</asp:ListItem>
<asp:ListItem>23</asp:ListItem>
<asp:ListItem>24</asp:ListItem>
<asp:ListItem>25</asp:ListItem>
<asp:ListItem>26</asp:ListItem>
<asp:ListItem>27</asp:ListItem>
<asp:ListItem>28</asp:ListItem>
<asp:ListItem>29</asp:ListItem>
<asp:ListItem>30</asp:ListItem>
<asp:ListItem>31</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DateYear" runat="server">
<asp:ListItem>2010</asp:ListItem>
</asp:DropDownList>
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" Text="Insert" />
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>