S
Sully
Hi Everyone,
I am pretty new to coding in .net and need some help in showing and
hiding information from a repeater control. I am calling a list of
FAQ's from a Database and display both the question and answer. What i
would like to happen is to display the list of questions and when the
user clicks on one of them, the answer appears below.
There are about 50 or so FAQ's, so I don't really want to use the
Javascript of Show/Hide div's as was previously used. And these FAQ's
appear on about 7 sites, so I am trying to save myself from coding
several different pages for one FAQ change. What I have so in my code
behind is:
SqlConnection myConnection = new
SqlConnection("server=IP;uid=user;pwd=password;database=value");
SqlDataAdapter myCommand = new SqlDataAdapter("SELECT * from FAQ",
myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds);
rptQuestions.DataSource = ds;
rptQuestions.DataBind();
and my repeater is simply inserted as:
<asp:Repeater ID="rptQuestions" runat="server">
<ItemTemplate>
<p><b><%# DataBinder.Eval(Container.DataItem, "FAQ_Question") %></b><br
/>
<%# DataBinder.Eval(Container.DataItem, "FAQ_Answer") %></p><br />
</ItemTemplate>
</asp:Repeater>
All this does is just display the questions and answers in paragraph
format. Any help would be appreciated.
THANKS!
I am pretty new to coding in .net and need some help in showing and
hiding information from a repeater control. I am calling a list of
FAQ's from a Database and display both the question and answer. What i
would like to happen is to display the list of questions and when the
user clicks on one of them, the answer appears below.
There are about 50 or so FAQ's, so I don't really want to use the
Javascript of Show/Hide div's as was previously used. And these FAQ's
appear on about 7 sites, so I am trying to save myself from coding
several different pages for one FAQ change. What I have so in my code
behind is:
SqlConnection myConnection = new
SqlConnection("server=IP;uid=user;pwd=password;database=value");
SqlDataAdapter myCommand = new SqlDataAdapter("SELECT * from FAQ",
myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds);
rptQuestions.DataSource = ds;
rptQuestions.DataBind();
and my repeater is simply inserted as:
<asp:Repeater ID="rptQuestions" runat="server">
<ItemTemplate>
<p><b><%# DataBinder.Eval(Container.DataItem, "FAQ_Question") %></b><br
/>
<%# DataBinder.Eval(Container.DataItem, "FAQ_Answer") %></p><br />
</ItemTemplate>
</asp:Repeater>
All this does is just display the questions and answers in paragraph
format. Any help would be appreciated.
THANKS!