Best practice - resources in ASP.Net Web Applications

  • Thread starter Peter Larsen [CPH]
  • Start date
P

Peter Larsen [CPH]

Hi,

I'm looking for some "best practice" help related to web applications and
recources (images, strings, files etc).

In Windows Forms Applications its normal to save all kinds of resources in
the applications recource file - its easy to access, and you always knows
where the resources are (and more).

In web applications, you would normally have lots of icons, buttons etc. for
use in the pages.
Where would you put these resources - in the recource file ??

Thank you in advance.

BR
Peter
 
B

bruce barker

for packaged components its handy to use resources for images,
stylesheets, etc. But for a website its a bad idea. the performance is
much lower and chaching may be effected. its common to have a common
image dir that is shared between websites (so the image is cached
between all).

-- bruce (sqlwork.com)
 
P

Peter Larsen [CPH]

Hi Bruce,

Yes it is slow to read images from the resource file - good point.
In winforms, i usually loads the resources into memory and keeps them there
as long as they are visible. But for webapplications, that works
differently.

Thanks for your comment.
BR
Peter
 
P

Peter Larsen [CPH]

Hi Sloan,

Thanks for the links.
GetWebResourceUrl() seems to be the answer - i will definitely read more
about that way to do it.

BR
Peter
 
S

Steven Cheng [MSFT]

Hi Peter,

For ASP.NET (start from 2.0), it also provide very rich support on
localization/globalization functionality. Generally there are two ways to
use localized resources:

1. Declarative approach via attribute and localize expression in aspx
template, you can bind resource in resource file to control property

2. Use code to programmtically load resource(global or local page resource).

here are some further good resource on ASP.NET globalization & localization:


#Internationalizing Your Application
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/localization/default.asp
x

#ASP.NET 2.0 Localization (Video, Whitepaper, and Database Provider
Support)
http://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_
2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx

#Extending the ASP.NET 2.0 Localization Model with a Database Resource
Provider
http://weblogs.asp.net/scottgu/archive/2006/11/29/extending-the-asp-net-2-0-
localization-model-with-a-database-resource-provider.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <[email protected]>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top