<asp:Repeater ID="RepDetails" runat="server">
<HeaderTemplate>
<table style=" border:1px solid white; width:100%;" cellpadding="0">
<tr style="background-color:darkgray; color:White">
<td colspan="7">
<tr style="background-color:darkgray; color:White">
<td colspan="1">
<b>#</b>
<td colspan="4">
<b>Section 1</b>
<td colspan="1">
<b>Strongly Agree</b>
<td colspan="1">
<b>Agree</b>
<td colspan="1">
<b>Neutral</b>
<td colspan="1">
<b>Disagree</b>
<td colspan="1">
<b>Strongly Disagree</b>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:#EBEFF0">
<td colspan="1">
<asp:Label ID="lblRowNumber" Text='<%# Container.ItemIndex + 1 %>' runat="server" />
<asp:Label ID="Label1" runat="server" Text=" * "/>
<asp:Label ID="HiddenLabel" runat="server" Text=""/>
<td colspan="4">
<asp:Label ID="LabelID" runat="server" Font-Bold="true" Visible="false" ForeColor="#ED700E" Text='<%#Eval("ID") %>'/>
<asp:Label ID="lblComment" runat="server" ForeColor="#ED700E" Text='<%#Eval("Question") %>'/>
<%--ForeColor="DeepPink" / ForeColor="SteelBlue" link color--%>
<%--<td colspan="1">
<asp:Label ID="lblUser" runat="server" Font-Bold="true" ForeColor="#ED700E" Text='<%#Eval("sectionNo") %>'/></td>--%>
<td colspan="1" >
<asp:RadioButton ID="R1" runat="server" style="margin-left:50%;" GroupName='<%#Eval("ID") %>' /></td>
<td colspan="1">
<asp:RadioButton ID="R2" runat="server" style="margin-left:50%;" GroupName='<%#Eval("ID") %>' /></td>
<td colspan="1">
<asp:RadioButton ID="R3" runat="server" style="margin-left:50%;" GroupName='<%#Eval("ID") %>' /></td>
<td colspan="1">
<asp:RadioButton ID="R4" runat="server" style="margin-left:50%;" GroupName='<%#Eval("ID") %>' /></td>
<td colspan="1">
<asp:RadioButton ID="R5" runat="server" style="margin-left:50%;" GroupName='<%#Eval("ID") %>' /></td>
<%--<td colspan="1">
<asp:RadioButton ID="R6" runat="server" /></td>--%>
<%--<td colspan="1">--%>
<%--<asp:LinkButton ID="lnkEdit" Text="Edit" runat="server" commandname="Click"
OnClientClick="OnUpdateText"
CommandArgument='<%#DataBinder.Eval(Container.DataItem,"surveyID") %>' />--%>
<%-- <asp:HyperLink ID="lnkEdit" runat="server" ForeColor="Blue" NavigateUrl='<%# "EditPublishSurvey.aspx?sid=" + Eval("surveyID")%>'>Edit</asp:HyperLink>
<asp:LinkButton ID="lnkUpdate" Text="Update" runat="server" Visible="false" />
<asp:LinkButton ID="lnkCancel" Text="Cancel" runat="server" Visible="false" />
<asp:LinkButton ID="lnkDelete" Text="Delete" runat="server" Visible="false" ForeColor="DeepPink" OnClientClick="return confirm('Do you want to delete this Question?');" />
<tr style="background-color:#EBEFF0; border:1px solid gray;"></tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
protected void BindRepeaterData()
string com34 = "select * from tblQuestionsWithAnswers where surveyID = '" + DropDownListSurveyNotSolved.SelectedItem.Text + "' And questionTypeID = 1";
using (SqlConnection con3 = new SqlConnection(StrSqlDbConStringTT))
using (SqlCommand cmd1 = new SqlCommand(com34, con3))
con3.Open();
//count1 = (int)cmd3.ExecuteScalar();
//count = count1;
//Label11.Text = count1.ToString();
if (cmd1.ExecuteScalar() == null)
divHeader.Visible = false;
divRepeater.Visible = false;
//Show the survey divs
divHeader.Visible = true;
divRepeater.Visible = true;
//where questionID = '" + TextBoxSurveyName.Text + "'
SqlCommand cmd11 = new SqlCommand("select * from tblQuestionsWithAnswers where surveyID = '" + DropDownListSurveyNotSolved.SelectedItem.Text + "' And questionTypeID = 1", con);
DataSet ds11 = new DataSet();
SqlDataAdapter da11 = new SqlDataAdapter(cmd11);
da11.Fill(ds11);
RepDetails.DataSource = ds11;
RepDetails.DataBind();
ScreenShot:
section 1 is not showing
Does anyone know the reason why its not showing ?
Did you check which branch of the if is executed (using Debugger)?
Maybe you should use con3 instead of con.
Maybe there are no data in database for your query. Check if ds11 contains the table and rows.
Hi @P!nk ,
SqlCommand cmd11 = new SqlCommand("select * from tblQuestionsWithAnswers where surveyID = '" + DropDownListSurveyNotSolved.SelectedItem.Text + "' And questionTypeID = 1", con);
DropDownListSurveyNotSolved
is not provided in your code, maybe there is something wrong with (where surveyID = '" + DropDownListSurveyNotSolved.SelectedItem.Text + "' And questionTypeID = 1")
.
It's better to check if there is any eligible data.
and if you have con. Because it is not provided in your code, if not you need to change to con3.
You'd better provide more detailed information so that we can better solve the problem.
Best regards,
Lan Huang