Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5849823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:03:17+00:00 2026-05-22T13:03:17+00:00

I am using local resource strings in ASP. My strings are something like This

  • 0

I am using local resource strings in ASP. My strings are something like "This is a {0}"
I am using String.Format to replace the {0} value.

In anycase, rather the put this code in every page, I wanted to create a Static/Shared method that any page could call. I had thought that I could pass the page in and call the GetLocalResourceObject() method. GetLocalResourceObject() is protected so its not valid.

Is there a way to call this external to the code-behind?

Shared Function GetPatternedResourceString(Byval P as Page, ByVal key As String, ByVal replacement As String) As String

        Return String.Format(p.GetLocalResourceObject(key), replacement)

    End Function

I realize there are some other ways to get a local resource, I think there is one on HttpContext but you need to do some extra work and pass in url paths, etc.

This is actually the same problem listed here
VB.NET: Extension method for pages that uses GetLocalResourceObject

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T13:03:18+00:00Added an answer on May 22, 2026 at 1:03 pm

    GetLocalResourceObject() – Gets a page-level resource object based on the specified VirtualPath and ResourceKey properties. For more clarification you should read this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using (local) in the connection string doesn't work on my cluster. I'm assuming it's
So i have this local SVN repo that i am using for my dev
I'm using local shared objects within flash both to store significant amounts of user
I know how to set up a local webserver using xampp on windows... I
Can any data exchanged on a local machine using the loopback IP 127.0.0.1 (localhost)
I am instantiating a local COM server using CoCreateInstance. Sometimes the application providing the
I have been using anonymous namespaces to store local data and functions and wanted
I am using the ReportViewer control from Visual Studio 2008 in Local Mode with
How can I create a local user account using .NET 2.0 and c# and
I am using git for windows to manage a local project. I have two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.