I have aspx page on which i have something like that:
<%
string image;
if(cond)
image = "somestring";
%>
...
<% if (cond) { %>
<img src="<%= image %>" /> <!-- HereI get CS0165 exception: Use of unassigned local variable 'image' -->
<% } else { %>
<div> ... </div>
<% } %>
So my question is why I get the exception? If I write string image = "";
this exception goes away. That's very strange. I guess that the exception has something to do with presentation of aspx page. Can someone explain why this happens?