Hello,
I am trying to set the text of the label control which is inside detailsview but it's not working.
can anyone guide me please.. ??
My HTML Code :-
<asp:Panel ID="sub_question_panel" runat="server">
<asp:DetailsView ID="DetailsView1" runat="server" CellPadding="6" ForeColor="#333333" AutoGenerateRows="false" GridLines="None" >
<Fields>
<asp:TemplateField>
<ItemTemplate>
<table id="Question_view_table">
<tr>
<td style="font-family:Arial Rounded MT;">
<label id="Question_no"><span style="font-size:20px;">Question</span>:</label>
<asp:Label ID="Ques_id_label" runat="server" Text="Label"></asp:Label></td>
<td style="height:20px"></td>
<td style="font-family:'Times New Roman'; font-size:18px; ">
<label id="Question_detail"><%# Eval ("Question") %></label>
<td style="font-family:'Times New Roman'; font-size:18px;">
<ol style="list-style:upper-alpha">
<label id="optn1">   <%# Eval ("Option1") %></label></li>
<label id="optn2">   <%# Eval ("Option2") %></label></li>
<label id="optn3">   <%# Eval ("Option3") %></label></li>
<label id="optn4">   <%# Eval ("Option4") %></label></li>
</table>
</ItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
</asp:Panel>
Code Behind :
i
protected void Page_Load(object sender, EventArgs e)
{
int question_id = 1;
Label Question_Id = DetailsView1.FindControl("Ques_id_label") as Label;
Ques_id_label.Text = Convert.ToString(question_id);
}
Please Help Me....