I’ve got an error in a datatable , that I want to present it in the aspx code. (%>)
it throw me an exception :
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
this is the code :
<%for (int i = 0; i < DTview.Rows.Count; i++)%>
<% {%>
<tr><%=DTview.Rows[i]["blog_total_views"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["first_name"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["is_affiliate"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["rating"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["price"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["current_city"].ToString(); %></tr>
<%}%>
Thanks
Try this:
You have to drop semi-colons(;) when using <%=%>, coz it will writer the output of the variable directly, also you will get a Null Exception using .ToString() when the field value is null.