The name 'xyz' does not exist in the current context

后端 未结 7 1831
广开言路
广开言路 2020-12-11 13:45

This is probably really basic in C#, but I looked around a lot to find a solution.

In my MVC controller\'s action method, I have an incoming routeid (programid

7条回答
  •  北海茫月
    2020-12-11 13:54

    The scope of the accounttype is limited to the if statement. Do

    string accounttype;
    
    if (programid == 0)
    {
     accounttype = "Membership";
    }
    else
    {
     accounttype = "Program";
    }
    

提交回复
热议问题