For converting from binary to decimal you could do it like in the next code:
string temp = "00010010";
decimal myDecimal = Convert.ToInt64(temp,2);
If you really want to do your conversion into a view you should do it in a code block
@{ ...}
or by using
@(myDecimal = Convert.ToInt64(temp,2))