Dynamically setting ressource in custom server control RRS feed

  • Question

  • User-1251705190 posted

     Hi ,

     I am creating a custom server control and I have a hyperlink control which will be pointing to a specific website.

    I want to set the localization at runtime as followed:

      string otherSite = "www.Mysite.com/Account/";

      HyperLink account = new HyperLink();
       account.Text = HttpContext.GetLocalResourceObject(otherSite  + "/App_LocalResources", "AccountHyperLink").ToString();


    the statement thows an exception :  www.Mysite.com/Account/App_LocalResources is not a virtual path...

    Please let me know if it is possible to set the local ressource to the other site..




    Monday, February 9, 2009 6:14 PM


  • User-1136466523 posted


    From your description, it seems that you want to get the value in resource file, and assign it to the HyperLink control's text property, right?


    Please make sure if the resouceId part matches the real resouce id you defined in the resource file.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 11, 2009 11:09 PM