asp.net mvc 4 - Resource in MVC 4 razor -


i have print key value pairs application resource file in table format in razor view.

i'm new please me out.

resource.resx:

key  | value --------------- name  |  john mob   | 9090909090 

to key value pairs application resource file use below method:

public dictionary<string,string> gtresource() {      system.resources.resourcemanager rm = new system.resources.resourcemanager("kdconsole.resources.resource", this.gettype().assembly);      dictionary<string, string> dic = new dictionary<string, string>();      system.resources.resourceset resourceset = rm.getresourceset(system.globalization.cultureinfo.currentculture, true, true);      foreach (system.collections.dictionaryentry item in resourceset)         {             dic.add(item.key.tostring(), item.value.tostring());         }      return dic; 

}


Comments