Tip: Generating Local Resource Files

by mosessaur| 17 February 2008| 1 Comments

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

3 Parts ASP.NET WebParts tutorial

by mosessaur| 17 February 2008| 5 Comments

2 years ago, I wrote 3 parts ASP.NET WebParts tutorial. Bellow are summary of each parts and links to original tutorial on www.C-ShareCorner.com

  1. Creating a Simple WebPart Page and use WebServer controls as WebParts
    Introduction:
    Portal web sites such as MY MSN and MSN Spaces, often organize their data into discrete units that support a degree of personalization. Information is organized into standalone parts [WebParts], and users can rearrange those parts to suit their individual working styles. Such personalization also lets users hide parts that contain information in which they have no interest. What's more, users can save their settings so that the site will remember their preferences the next time they visit the site. In ASP.NET 2.0, you can now build web portals that offer this kind of modularization of information and personalization using the new Web Parts Framework.
    Scope of this Tutorial:
    Here we will see how to add web parts to a web part page. Developing advanced WebParts from scratch is out of this tutorial scope. This tutorial also may has subsequent tutorial that explains more about Web Parts Framework.
    Assumptions:
    This tutorial assumes you are familiar with Data Access Controls and Data Binding Controls such as SqlDataSource and GridView. Also it requires SQL Sever 2005 Express Edition and Visual Web Developer. If you don't have SQL Server Express 2005, install ASPNETDB in your SQL Server instance using aspnet_regsql tool. and configure your application to use this instance as your personalization provider.

    How to create WebParts Page:
    To create a WebParts Page, you need to work with a specific ASP.Net 2.0 Controls:
    • WebPartManager Control, which manages all Web Parts controls on a WebParts Page and must be the first control that you add to the page.
    • WebPartZone Control, which contains and provides overall layout for the Web Part controls that compose the main UI of a page. This control serves as an anchor for Web Part controls. Multiple controls of this control forms the WebParts Page. Read more....
  2. Working with WebParts Page, WebPart Zones & WebParts
    Introduction:
    This tutorial considered to be the second part of the first tutorial Creating a Simple WebPart Page and use WebServer controls as WebParts. Here we will see how can we remove and add WebParts during run time, adding personalizable properties to your WebParts and modifying there values also in run time.

    WebPart Zones:
    There are 4 types of WebPart Zones. Zones is used to host (anchor or dock) WebParts. In the previous tutorial we had a look at WebPartZone. At this tutorial we will have a look at the other another two WebPart Zones, CatalogZone & EditorZone. Read more...

  3. WebParts Communication: How WebParts on a page communicate with each other
    Introduction:
    In this tutorial we will describe how to make WebParts on a WebParts Page communicate with each other. So will see how to use ConnectionsZone and how to enable WebParts to talk to each other by connecting them.
    Assumptions:
    This tutorial assumes that you know how to work with web forms, creating user controls and connecting to data sources using SqlDataSource Control. Also you should know how to use WebPartZone control and to know what are WebParts and WebParts Pages. Read more...

These days many applications are being developed using ASP.NET, I suggest you find an provider suitable for your web development projects.

kick it on DotNetKicks.com

My first Wiki experiance, My first Wiki contribution

by mosessaur| 17 February 2008| 2 Comments

Last year (2007) on March I joind CSharp-Online community. It is Wiki Media based community web site. Actually that was the first time to use Wiki. I was always watching Wikies but never touch them. I liked that Wiki. It is easy and smart or may be I'm a dump.

Anyway, I had finalized my first contribution on there and it is about Creating Custom ASP.NET AJAX Client Controls. I've built this article on top of this tutorial
"Adding Client Capability to a Web Server Control Using ASP.NET AJAX Extensions".

Hope it will be useful for someone.

kick it on DotNetKicks.com

ASP.NET 2.0 AJAX Timer Hacks! How to Pause ASP.NET AJAX Timer

by mosessaur| 17 February 2008| 0 Comments

UPDATE:
Matt Berseth posted a detailed information about this tip on his post Bug Bash: Enabling/Disabling the ASP.NET AJAX Timer using the Control's Client Side API. Much clearer and explained in details. [May 08, 2008]
----------------------------------------------------------------------------------------------------------------------------------

from about 2 weeks I wrote an article about how you can use ASP.NET 2.0 AJAX Timer control in a real world scenario side by side with RssToolKit.

The idea it to display RSS feed from deferent location in cycle using ASP.NET AJAX Timer. I also had an idea of pausing the Timer when the user move his mouse over the update-able area "Group Box that display feeds inside it". Of course this should be down from client side.

I searched the documentation for Client Side APIs related to the AJAX Timer control but I didn't find any. I had to hack inside AJAX Timer client library downloaded with ASP.NET AJAX Extensions, and I found what I want.

First I though that by setting client side enabled property using set_enabled(false) of the AJAX Timer I could get what I want; actually I was wrong, this will not pause the Timer.

Dig deeper, but not for too long, I found 2 methods _startTimer() and _stopTimer(), those were excatly what I was looking for.

bellow is a sample client code of how you can use these 2 methods:

   1: function startTimer() { var timer = $find("<%=ajaxTimer.ClientID%>"); timer._startTimer(); }
   2: function stopTimer() { var timer = $find("<%=ajaxTimer.ClientID%>"); timer._stopTimer(); } 

The above code assuming that you have an AJAX Timer control on the page named ajaxTimer. Call these method from your client side code, or add them as event handlers on your target elements.

I don't know why these are not documented, or we are not supposed to use them?! Actually I don't know. I thought that after using these methods the browser will cause a problem regarding client scripts, but both Opera and IE worked just fine without any problem. Also I didn't notice any slow down or hanging in both browsers.

Hope you find it useful.

kick it on DotNetKicks.com

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

by mosessaur| 17 February 2008| 1 Comments

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

ASP.NET AJAX ComboBox

by mosessaur| 06 January 2008| 33 Comments

Back to April 2007 I posted about building an ASP.NET AJAX ComboBox. It was an attempt to rewrite a ComboBox Control I made to fulfil certain issues I faced with 3rd Party Controls. One of those issue was performance as most of 3rd Party control are rendering heavy HTML because of extinsive features they put on their controls which I do not need. So This post is supposed to be an extensions to my old post as well as my article about building Simple ASP.NET ComboBox.

Attached to this post is the ASP.NET AJAX ComboBox. The archive is also containing 3 other very simple controls. The controls are developed using ASP.NET AJAX 1.0. Client Side Controls are written using Script#. I've posted earlier about Script# and my experience with it, so feel free to have a look at that post.

Now back to ASP.NET AJAX ComboBox. The control is very simple, you can consider it as composite control of simple ListBox and TextBox, however it doesn't inherit from CompositeControl. It directly inherit from ListControl to support binding out of the box and many other features that do need any to be rewritten. More...

MSDN Magazine Cutting Edge: ASP.NET AJAX

by mosessaur| 06 November 2007| 0 Comments
Dino Esposito wrote a serious about ASP.NET AJAX on MSDN Magazine Cutting Edge section.
I would like to share these good links with you so here they are:
Have fun!

Tutorial: Getting Started, Creating a WSE 3.0 Enabled Web Service to Transfer Large Amount of Data using WSE 3.0 MTOM

by mosessaur| 11 June 2007| 3 Comments
Just published my artilce about getting started with WSE 3.0 on DotNetSlackers.com. In this article I'm walking through to build simple document transfer web service using ASP.NET 2.0 and make this web serice WSE 3.0 enabled. The article is covering the following topics:
  • How to configure a web service to use WSE 3.0
  • How to configure a client application to use WSE 3.0
  • How to configure a web service to use MTOM messaging mechanism
  • How to enable a client application to use MTOM while communicating with a MTOM enabled web service

As an extension to this article, currently I'm studying how to build WSS 3.0 Web Service to upload documents to document libraries and enable WSE 3.0 on this web service. Hope I could finalize this soon.

Your comments and suggestions are appreciated.

kick it on DotNetKicks.com

Sharepoint 2007 Installation with best pratice

by mosessaur| 10 June 2007| 1 Comments
Cris David founder of www.moss07.org blogged about how to Installation SharePoint 2007 with best practice. He prepared a very organized document about how to install and configure SharePoint 2007. The document is supposed to be in 2 parts. He published his first part while a go. I highly recommend reading this document if you are new to SharePoint or want to put your hand on the best pratice and smooth way to deploy SharePoint 2007.
I supposed to post this on my SharePoint blog but it seems to be down.