Can I assign the value like this?

Posted by kumar on Stack Overflow See other posts from Stack Overflow or by kumar
Published on 2010-05-13T18:13:31Z Indexed on 2010/05/13 18:24 UTC
Read the original article Hit count: 284

Filed under:
|
  Exactly I ned to do something like this is this possible?

<%
var Controller = null;
if (Model.ID== "ABC")
    {
        Controller = "Name";
    }
    else
    {
        Controller = "Detail";
    }
%>
<% using (Html.BeginForm("edit", Controller, FormMethod.Post, new { @id="exc-" + Model.SID}))
   {%>
<%= Html.Summary(true)%>

is this possible? if i do I am getting exception...

ERROR: Cannot assign to an implicitly-typed local variable

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#