How to define and use a local variable in aspx page?
- by Bruskvilla
Hello how can I define a local variable in aspx page.
I just did the below code it gives errors. I'm new please help. Thanks.
<% Devamsizlik.Models.DevamDurumu obj; %
<% foreach (var item in Model){ %>
.....blabla
<% obj = item; %>
<%} %>//end of foreach
< p
<%: Html.ActionLink("Create New", "DevamsizEkle", new { ogrId = obj.devamOgrenciID }, new { subeId = obj.devamsizlikSubeID })%
< / p >
....< /p cause a compilation error
Compiler Error Message: CS0165: Use of unassigned local variable 'obj'