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

后端 未结 7 1844
广开言路
广开言路 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条回答
  •  猫巷女王i
    2020-12-11 14:01

    Your scoping is incorrect, try this:

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

提交回复
热议问题