Posts

Showing posts from February, 2011

Thin Vs. Thick Clients

Image
Basically, a thin client is a web based application and most of the processing is done on the server side.

A thick client is installed into the client side. It is still connected to the server, but most of the processing is done on client side. With thick client, there won't be much processing via the network. In a way, it will be a much faster option if your network is slow or congested.


The codes are different for thick and thin clients. I think if you code in components, you can reuse the code about 60% - 80% of the time depending on the requirements.

More specific..

Thin Client: Is a Web Application, and runs on Internet Explorer. You access the application using http://hostname:portNumber/iSupport=20 Here you have a webserver and database in the background. It can be 2-tier or N-tier.

List of protocols used with thin clients

* Appliance Link Protocol
* Citrix ICA
* Remote Desktop Protocol
* Secure Shell or SSH, an encrypted replacement for telnet.
* Virtual Network Computing
* …

String Format for Double [C#]

This information help me a lot to solve my currency related calculation... so share with you. Hope that it may also helpful for other guys...

The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString() and float.ToString().

Digits after decimal point

This example formats double to string with fixed number of decimal places. For two decimal places use pattern „0.00“. If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded.
[C#]

// just two decimal places
String.Format("{0:0.00}", 123.4567); // "123.46"
String.Format("{0:0.00}", 123.4); // "123.40"
String.Format("{0:0.00}", 123.0); // "123.00"

Next example formats double to string with floating number of decimal places. E.g. for maximal two decimal places use pattern „0.##“.
[C#]

//…

Handling JSON Arrays returned from ASP.NET Web Services with jQuery

The Web Service methods that I will use revolve around cars. Having set up a web site in Visual Studio 2008, I have added a new item of type "Web Service" to the project, calling it EmpInfoService.asmx. The code-behind - EmpInfoService.cs - is automatically generated within the App_Code folder. The full code for that class file is as follows:

Code: asmx

public class Employee
{
public string FullName;
public string Designation;
public string PhoneNo;
}


/// <summary>
/// Summary description for Emp info
/// </summary>


[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]


[ScriptService]
public class EmpInfoService : WebService
{
List Employees = new List{
new Employee{FullName="Shakil",Designation="Manager",PhoneNo=5555454},
new Employee{FullName="Ahsan",Designation="Director",PhoneNo=4545454},
new Employee{FullName="Murhsed",Designation="Director&…

JScript Editor Extensions for the Visual Studio 2010 JScript editor

Image
This really a nice extensions which is make life easy for developer specially for JavaScript development.

Bundles the following extensions for the Visual Studio 2010 JScript editor:

Brace Matching

Adds support for automatically highlighting the matching opening or closing brace to the one currently at the cursor. Supports matching parenthesis: (), square brackets: [], and curly braces: {}. Braces in strings, comments and regular expression literals are ignored.



Outlining / Cold-folding

Adds support for automatically creating outlining regions for JScript blocks. Blocks are detected via opening and closing curly braces. Braces in strings, comments and regular expression literals are ignored.

Current Word Highlighting

Adds support for highlighting all instances of the word currently at the cursor.
IntelliSense Doc-Comments Support

Adds support for the element in JScript IntelliSense doc-comments to allow display of new lines in IntelliSense tooltips, e.g.

function hello(name) {
/// A…

Check/Uncheck all items in a CheckBoxList using Javascript

In my previous article show how to check/uncheck all items in a CheckBoxList using ASP.NET. Today we do the same using javascript.

Note: If you use the master page in your application remember that you need to use 'Control.ClientID'. Because When the page is rendered in the browser, the content and master pages get merged into a single page. This means that the IDs for the controls get renamed. ASP.NET renames the IDs to prevent naming conflicts. Now to handle the renamed controls, ASP.NET provides the ‘Control.ClientID’ and ‘Control.UniqueID’ to get the renamed ID’s.


Use the following code at the Page load event to add items to the CheckBoxList programmatically:

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
cblTest.Items.Add(new ListItem("Dhaka", "Dhaka"));
cblTest.Items.Add(new ListItem("Chittagong", "Chittagong"));
cblTest.Items.Add(new ListItem("Shylet", "Shylet&qu…

Check/Uncheck all items in a CheckBoxList using ASP.NET

The CheckBoxList control in ASP.NET 2.0 is one of the useful control for asp.net developer. But it is not so easy(also not complicated :))to handling like checkbox. This control provides a group of checkboxes that can be dynamically generated by binding it to a data source.

You can handling its operation programmatically using both asp.net or JavaScript. Today I discuss how to checked and unchecked items in CheckBoxList using ASP.net/C#.

First you can bind data to CheckBoxList control using a smart tag appears which allows you to specify a datasource or add items manually to the CheckBoxList.Click on the ‘Edit Items’ to open the ListItem Collection Editor and add items.

Bind data into this control from data source like this:


// Assuming that GetCityList() returns a list of CityID and CityName items in a sqldatareader

SqlDataReader dr = GetCityList ();
cblTest.DataSource = dr;
cblTest.DataValueField = "CityID ";
cblTest.DataTextField = "CityName ";
cblTest.DataBind…

"System.Security.SecurityException: Security error" error message when the virtual directory points to a remote share in ASP.NET

Very recently, We have faced a problem to deploy application. The problem is raised when virtual directory points to a remote PC. The scenario is describe below..
PC1-- Web server(where IIS and .net framework is installed)
PC2-- Remote pc where precompile application directory located.

When deploy application virtual directory is created in PC1 but precompile application folder is points to remote PC2. After configure everything it shows me exception about security permission. After searching I added <trust level="Full"/ > in web.config file. Unfortunately, it shows me the same error

Parser Error Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
After search in various site I found the solution in msdn.

Why this problem occur?

The System.Web namespace does not have the AllowPartiallyTrusted CallersAttribute applied to it.