I having problem displays my information in a Datalist. It displays the Header Template but no data, I am setting the source and bind (Code Behind) to a SqlReader that is reading fine but for some reason I can't see it in my Datalist. I did a Response.Write on my Reader to make certain that it contains the right information, it does. Here is my HTML code for my DataReader and my Code Behind:
HTML Code...
<asp:datalist id="Datalist" runat="server" BorderColor="black" Width="696px" Visible="False" OnEditCommand="DataList_EditCommand"
EditItemStyle-BackColor="lightgreen" AlternatingItemStyle-BackColor="Gainsboro" HeaderStyle-BackColor="LightSteelBlue"
Font-Size="8pt" Font-Name="Verdana" CellSpacing="0" CellPadding="3" GridLines="Both" BorderWidth="1">
<HeaderTemplate>
<b>Select Volunteer:</b>
</HeaderTemplate>
<EditItemStyle BackColor="LightGreen"></EditItemStyle>
<AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
<ItemTemplate><asp:LinkButton id="Linkbutton6" runat="server" Text="Select" CommandName="edit">
</asp:LinkButton><I> <%# DataBinder.Eval(Container.DataItem, "ssn_mask")%> <%# DataBinder.Eval(Container.DataItem, "last")%>, <%# DataBinder.Eval(Container.DataItem, "first")%> <%# DataBinder.Eval(Container.DataItem, "middle")%></I>
<asp:TextBox id="Textbox21" visible=False runat="server" text='<%# DataBinder.Eval(Container.DataItem, "ssn") %>'>
</asp:TextBox><asp:TextBox id="Textbox22" visible=False runat="server" text='<%# DataBinder.Eval(Container.DataItem, "new_applicant") %>'>
</asp:TextBox>
<asp:Label ForeColor=#ff3300 Runat="server" ID="lblRenewal" Text=" * Renewal Needed" visible='<%# CheckStatus(DataBinder.Eval(Container.DataItem, "renewal"))%>'>
</asp:Label>
</ItemTemplate>
<HeaderStyle BackColor="LightSteelBlue"></HeaderStyle>
</asp:datalist>
(Code Behind) - I step through it and works fine...
ElseIf Session("User_org") = "0" Then
Datalist.DataSource = dm
Datalist.DataBind()
Datalist.Visible = True
txtSSN.Text = ""
txtlname.Text = ""
ButAdd.Visible = False
ButtryAgain.Visible = False
lblFound.Visible = False
I always thought that as long as you bind the datalist and there is data present it will display the information...
I've been staring at this for a couple of hours and can't see what the problem is...if there is anyone that can offer some suggestions I would appreciate it...thanks in advance.
HTML Code...
<asp:datalist id="Datalist" runat="server" BorderColor="black" Width="696px" Visible="False" OnEditCommand="DataList_EditCommand"
EditItemStyle-BackColor="lightgreen" AlternatingItemStyle-BackColor="Gainsboro" HeaderStyle-BackColor="LightSteelBlue"
Font-Size="8pt" Font-Name="Verdana" CellSpacing="0" CellPadding="3" GridLines="Both" BorderWidth="1">
<HeaderTemplate>
<b>Select Volunteer:</b>
</HeaderTemplate>
<EditItemStyle BackColor="LightGreen"></EditItemStyle>
<AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
<ItemTemplate><asp:LinkButton id="Linkbutton6" runat="server" Text="Select" CommandName="edit">
</asp:LinkButton><I> <%# DataBinder.Eval(Container.DataItem, "ssn_mask")%> <%# DataBinder.Eval(Container.DataItem, "last")%>, <%# DataBinder.Eval(Container.DataItem, "first")%> <%# DataBinder.Eval(Container.DataItem, "middle")%></I>
<asp:TextBox id="Textbox21" visible=False runat="server" text='<%# DataBinder.Eval(Container.DataItem, "ssn") %>'>
</asp:TextBox><asp:TextBox id="Textbox22" visible=False runat="server" text='<%# DataBinder.Eval(Container.DataItem, "new_applicant") %>'>
</asp:TextBox>
<asp:Label ForeColor=#ff3300 Runat="server" ID="lblRenewal" Text=" * Renewal Needed" visible='<%# CheckStatus(DataBinder.Eval(Container.DataItem, "renewal"))%>'>
</asp:Label>
</ItemTemplate>
<HeaderStyle BackColor="LightSteelBlue"></HeaderStyle>
</asp:datalist>
(Code Behind) - I step through it and works fine...
ElseIf Session("User_org") = "0" Then
Datalist.DataSource = dm
Datalist.DataBind()
Datalist.Visible = True
txtSSN.Text = ""
txtlname.Text = ""
ButAdd.Visible = False
ButtryAgain.Visible = False
lblFound.Visible = False
I always thought that as long as you bind the datalist and there is data present it will display the information...
I've been staring at this for a couple of hours and can't see what the problem is...if there is anyone that can offer some suggestions I would appreciate it...thanks in advance.