Trying to Convert VB.Net to C# ViewState Issue -


vb.net code

if viewstate("lstsetting") isnot nothing   username = viewstate("lstsetting")("email")   password = viewstate("lstsetting")("psw")   mhost = viewstate("lstsetting")("host").tostring.split(":")(1)   mport = viewstate("lstsetting")("port").tostring.split(":")(1) end if password = trim(dec(ondecrypt(trim(password)))) 

c# code

if (viewstate["lstsetting"] != null) {   username = viewstate["lstsetting"]("email");   password = viewstate["lstsetting"]("psw");   mhost = viewstate["lstsetting"]("host");   //.tostring.split(":")(1)   mport = viewstate["lstsetting"]("port");   //.tostring.split(":")(1) } password=strings.trim(modcommon.dec(modcommon.ondecrypt(strings.trim(password))));` 

error: method name expected...

error displayed here

viewstate["lstsetting"]("email")

viewstate["lstsetting"]("email") 

should be

((dictionary<string, string>)viewstate["lstsetting"])["email"] 

actually, should retrieve viewstate["lstsetting"] once , use it. goes both code snippets.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -