locked
Question About GlobalResoureces RRS feed

  • Question

  • User-821533197 posted

    ..Hello every body...

    ..I want to Edit  GlobalResources...

    ..Can You Help Me?????..

    Monday, May 10, 2010 2:41 AM

All replies

  • User-1636183269 posted

    http://forums.asp.net/t/1024778.aspx


    Monday, May 10, 2010 6:32 AM
  • User-1200560727 posted

    Please check the following link:

    http://forums.asp.net/t/1152145.aspx

    http://support.microsoft.com/kb/917414


    Tuesday, May 11, 2010 12:21 AM
  • User-821533197 posted

    Tancks a lot honey i understand  tancks

    Tuesday, May 11, 2010 2:36 AM
  • User-821533197 posted

    hey

     i can add globalresources in run time but whene i add one value values in resources file all values become delete can you help me???

    this is my code


    public static void AddResources
    (string name, string value, string culture)
    {
    try
    {
    if (!System.String.IsNullOrEmpty(culture))
    {
    culture = "." + culture;
    }
    //--------------------------------------
    //Set  ResXResourceWriter
    //--------------------------------------
    System.Resources.ResXResourceWriter writer =
    new System.Resources.ResXResourceWriter
    (System.Web.HttpContext.Current.Server
    .MapPath(
    "~/App_GlobalResources/Labels" + culture + ".resx")
    );
    System.Resources.ResXDataNode orxDataNode
    = new System.Resources.ResXDataNode(name, value);
    writer.AddResource(orxDataNode);
    //writer.AddResource(name, value);
    writer.Close();
    //--------------------------------------
    //Set  ResXResourceWriter
    //--------------------------------------
    }
    catch (System.Exception ex)
    {
    System.Collections.Hashtable oHashtable =
    new System.Collections.Hashtable();
    oHashtable.Add("Culture", culture);
    oHashtable.Add("Value", value);
    oHashtable.Add("Name", name);
    oHashtable.Add("Path", Path);
    MJX.LogHandler.Report(typeof(Settings), oHashtable, ex);
    throw (new MyWebApplication.ApplicationException
    (Resources.Labels.UnexpectedError));
    }
    }


    public static void AddResources

    (string name, string value, string culture)

    {

    try

    {

    if (!System.String.IsNullOrEmpty(culture))

    {

    culture = "." + culture;

    }

    //--------------------------------------

    //Set  ResXResourceWriter

    //--------------------------------------


    System.Resources.ResXResourceWriter writer =

    new System.Resources.ResXResourceWriter

    (System.Web.HttpContext.Current.Server

    .MapPath(

    "~/App_GlobalResources/Labels" + culture + ".resx")

    );

    System.Resources.ResXDataNode orxDataNode

    = new System.Resources.ResXDataNode(name, value);

    writer.AddResource(orxDataNode);

    //writer.AddResource(name, value);

    writer.Close();

    //--------------------------------------

    //Set  ResXResourceWriter

    //--------------------------------------

    }

    catch (System.Exception ex)

    {

    System.Collections.Hashtable oHashtable =

    new System.Collections.Hashtable();

    oHashtable.Add("Culture", culture);

    oHashtable.Add("Value", value);

    oHashtable.Add("Name", name);

    oHashtable.Add("Path", Path);


    MJX.LogHandler.Report(typeof(Settings), oHashtable, ex);


    throw (new MyWebApplication.ApplicationException

    (Resources.Labels.UnexpectedError));

    }

    }

     

    Tuesday, May 11, 2010 5:13 AM