Parametervärden i resursfiler

Tänkte visa ett exempel på hur man kan byta ut parametrar i resursfiler. I mitt exempel hämtar jag ut en text för copyright-meddelande och byter ut en parameter {0} med string.format mot aktuellt år.

I resursfilern har jag en nyckel som heter Copyright och lägger in följande sträng.

Copyright © 2004-{0}, Code Odyssey, all rights reserved.

Sen på aspx-sidan lägger jag in strängen på följade vis.

<%=String.Format((String)GetLocalResourceObject("Copyright"), DateTime.Today.Year )%>

Och så slipper man gå in och ändra vid varje nyår.

Sen angående Copyright så funderar jag på att ändral licens på denna sajten. Kanske Copyleft eller nån Creative Common-variant.

Comments

We’re always looking for great resources to share with clients and my colleagues, and this post is definitely worth sharing!

http://www.janbaskdigitaldesign.com

Thanks for sharing great tips with us.

epson printer helpline number

Thanks for sharing great tips with us.thank you. http://www.onlinepromotionuae.ae

nice... thanks for sharing a amazing website................... www.andamandiscover.com"> www.andamandiscover.comlink text

thanks for sharing this information.............. http://onlinepromotionhouse.com"> http://onlinepromotionhouse.comlink text

Great Post.. Thank You for sharing... I am waiting your next post..A user friendly printer that Canon manufactures is unmatched by any other brand. But what will you do if it stops working and too late to go to service center? Well, you can dial Canon Printer Help Number UK anytime from anywhere and get support for any issue you face with the printer.If you need technical support for antivirus get in touch with Dell Printer Help Number UK, Epson Printer Help Number UK, HP Printer Help Number UK

It‘s actually a nice and useful piece of information. If you are facing any problem in your dell printer then just Call at the toll free Dell Printer Support Number UK 0800-098-8371.

Please fill out all the fields.

*
*