Moses' Blog

Living {.net} lifestyle

Muhammad Mosa

Name of author
mosesofegypt logo
Software Engineer.
MCT, MCSD.NET,
MCTS: .Net 2.0 Web, Windows, Distributed Applications
MCTS: .Net 3.5 WF Application Development
MCTS: WSS 3.0, MOSS 2007 Configuration & App Dev
MCPD: Enterprise Application Developer

Send mail My Live Space Facebook Twitter Moses's profile on Technorati


Calendar

<<  August 2008  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar

Recent Comments

Comment RSS

Community Credit

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

.Net 3.5 Enhancements Training Kit

Brief Description:
.NET Framework 3.5 Enhancements Training Kit containing Labs, Demos and PPTs.

Overview:
The .NET Framework 3.5 Enhancements Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the .NET 3.5 Enhancement features including: ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET AJAX History, ASP.NET Silverlight controls, ADO.NET Data Services and ADO.NET Entity Framework.

I think it is different thanThe Visual Studio 2008 and .NET Framework 3.5 Training Kit which you can also have a look at it.

You can subscribe to Microsoft Download Notificationsto alwasy be updated about new downloads from Microsoft.

Download

Posted: Apr 19 2008, 16:00 by mosessaur | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Visual Studio
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

WebResourceAttribute And VB.NET, Not Like in C#!

Refering to my previous post "Working with System.Web.UI.WebResourceAttribute". During surfing in ASP.NET forums I noticed a question about this issue! and in the question it is mentioned that the way I descriped didn't work. I noticed also that the guy was using VB.NET not C# on which I was working on!!

The deference, or the issue came up because C# & VB.Net treat or compile resources in deferent ways -this is my own observation-. Return to the issue post on ASP.NET Forums to know what was exactly the problemand how it was resolved.

kick it on DotNetKicks.com

Posted: Feb 17 2008, 23:53 by mosessaur | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: ASP.NET | Tips | Visual Studio
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Working with System.Web.UI.WebResourceAttribute

You may've heared about new ASP.NET 2.0 System.Web.UI.WebResourceAttribute class. It defines the metadata attribute that enables an embedded resource in an assembly. It is valid only when used on assembly declarations and it is used to enable a specified embedded resource in an assembly for use as a Web resource.

For example, suppose you are building a web server control, or custom HttpHandler that would render some javascript "js" files and may few images etc...
Where you would store these files "resources"?! The answer is you can embed them in your assembly and reference them as web resources from your code.

To register a resource as WebResource you would use this line of code, you can do that in AssemblyInfo file:

[assembly: System.Web.UI.WebResource("imagename.jpg", "image/jpeg")]

For more information about WebResource parameter, please return to MSDN, currenlty I can mention that the 1st on is the resource name, and the 2nd one is the content-type of the resource, in our case it is an image so the content type is image/jpeg. If your resouece file is javascript, then the content-type would be text/javascript

And you can reference your resource using ClientScriptManager class through Page.ClientScript Property as the following

string resUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(YouControlType), "imagename.jpg");

Now use your resUrl to display your image!.... BUT WAIT, this is not going to work!!

If you followed the MSDN code while you are VS.NET this is not going to work at all, your image or your resource file never appear.
Here are the Rule:

  1. You should know your Assembly default namespace.
  2. Recognize where exactly your resource file located in your project, "Its Path"
  3. Define the correct resource name.

Suppose your default namespace is Moses.WebControls, while your resource file name is ComboBox.js, this file is located on a folder named Resources/Scripts in your project -Dont care about your project name or assembly name, just focus on your Default namespace name-.

Now your resource file should be name "Moses.WebControls.Resources.Scripts.ComboBox.js".

The rule simpley is [Default namespace].[Resource Path from the project root -replace '/' with '.' of course-].[Resource FileName]

So you'll register your WebResource as the following:

[assembly: System.Web.UI.WebResource("Moses.WebControls.Resources.Scripts.ComboBox.js", "text/javascript")]

And you can get your resource URL as the following:

string resUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(YouControlType), "Moses.WebControls.Resources.Scripts.ComboBox.js");

Hope this would help somebody

kick it on DotNetKicks.com

Posted: Feb 17 2008, 23:43 by mosessaur | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: ASP.NET | Tips | Visual Studio
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Tip: Generating Local Resource Files

As I was working on multingual User Interface project; it was needed to generate resource files for all aspx & ascx files.
I knew that VS.NET 2005 has a local resource file generator. But it was weird when I select my ASPX page or user control and go to Tool menu and find that there are no Generate Local Resources command on the menu!

It didn't take so much time, I found the solution on ASP.NET Forums. It was simple: "he menu 'Tools > Generate Local Resources' is available when you display an aspx page or ascx". Also you must switch to design veiw before you Generate your local resources.

kick it on DotNetKicks.com

Posted: Feb 17 2008, 23:35 by mosessaur | Comments (0) RSS comment feed |
  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: ASP.NET | Tips | Visual Studio
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

How to build Multi-Language Web Sites with ASP.NET 2.0 and Visual Studio.Net 2005

Last year I wrote an article about how to build multi-languange web sites with ASP.NET 2.0 and Visual Studio.Net 2005. This is a bookmark to the articles (C#,VB.NET) [poste migrated from old blog]

Introduction: In order to reach international markets through the Internet, supporting different cultures through our applications is essential for being successful. The .NET Framework 2.0 as well as 1.x comes with an integrated infrastructure for creating international applications. Basically, the CLR supports a mechanism for packaging and deploying resources with any type of application. The CLR and the base class library of the .NET Framework come with several classes for managing and accessing resources in applications. These classes are located in the System.Resources and System.Globalization namespaces. Here we will explore the necessary details for working with resources in ASP.NET applications and for creating international ASP.NET applications based on embedded resources and the integrated localization support.

Assumptions: This article assumes that you already know how to build web forms and to use controls and validation controls.

Localization and resource files: Localization support in .Net Framework 2.0 in general and in ASP.Net 2.0 specifically become much more easier and brings fun during localization process. Usually resources are created for every culture the application should support. More specifically, each Web Form -Page- in your web site should have a resources for every culture -language- it should support. For example:If you have a web form with name default.aspx and your web site support English, German and Arabic, then you should have 3 resource files for each culture. The CLR defines a behavior for finding culture-specific resources. With that said, every set of resources has to define a base name that is specified through the first part of the name of the resource file. The second part of the name defines the culture. If the culture portion in the name is not specified, the resources defined in the resource file are used as default resources. For example:Your page name is default.aspx., you have 3 resource files as mentioned earlier, each one resource file should be named as:default.aspx.en-US.resx, default.aspx.de-DE.resx and default.aspx.ar-EG.resx. Not here that we are using United States English, German's Gemran, and Egyptian's Arabic. You can use general English or general German or general Arabic like this:default.aspx.en.resx, default.aspx.de.resx and default.aspx.ar.resx. Also you can use another specific culture like using Switzerland German culture this way: default.aspx.de-CH.resx. For list of supported cultures in .Net Framework return to MSDN.

Read the complete article at C-SharpCorner.com
Read the VB.Net version as VBDotNetHeaven.com

kick it on DotNetKicks.com

Posted: Feb 17 2008, 18:43 by mosessaur | Comments (1) RSS comment feed |
  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Visual Studio 2008 and .NET Framework 3.5 Training Kit Available

Few weeks ago Microsoft released a useful training kit for Visual Studio 2008 and .NET Framework 3.5 containing Labs, Demos and PPTs.
The Visual Studio 2008 and .NET Framework 3.5 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application Lifecycle Management.
Before you start downloading, I recommend that you read the System Requirement section if you are using Windows XP. Windows XP is not listed!!
Click here for the download page.
Posted: Dec 13 2007, 09:11 by mosessaur | Comments (0) RSS comment feed |
  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Visual Studio
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us