Pages

Wednesday, July 8, 2009

Using Jquery with ASP.NET simple example.

download source code for this example download

Prerequisites

Download jquery java script library from http://jquery.com/

Steps

1. Create new web site

1. Add jquery java script file(s) to solution.

2. Create new page (ajax_page.aspx) and add following code.

C# ajax_page.aspx.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

public partial class ajax_page : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

string sampleJSONObject =

"{\"FullName\" : \"Dilhan Jayathilaka\", \"Email\" : \"dilhan.jayathilaka@live.com\"}";

Response.Write(sampleJSONObject);

Response.End();

}

}

3. Add javascript to call ajax page using jquery.

default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

<script src="jQuery/jquery-1.3.2.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

// JQuery ajax call.

$.getJSON("ajax_page.aspx", function(json) {

$("#txtFullName").html(json.FullName);

$("#txtEmail").html(json.Email);

});

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<span id="txtFullName" ></span>

<br />

<span id="txtEmail" ></span>

</div>

</form>

</body>

</html>




Open Source JQuery ASP.NET - (DJ - jQuery Web Contorls for ASP.NET)http://dj.codeplex.com/

Wednesday, July 1, 2009

.NET Software Engineers Tool Set

Documentation Tool

The patterns & practices: Documentation Tools project includes a Word 2007 template and tools that you can use to convert Word documents to HTML, Help 1.0 (CHM), and Help 2.0 (HxS). It also includes a tool that helps you manage your table of contents for large documentation sets. You can use these tools to create your own documentation guidance or take existing patterns & practices Word documents, modify the content, and then convert the content to your desired output.
download and read more : http://www.codeplex.com/doctools

Debug View

DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don't need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.

download and read more : http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

Web Debugging Proxy - Http Viewer

Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.
Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.

download and read more : http://www.fiddler2.com/fiddler2/

Monday, June 22, 2009

Copy Dll from GAC

go to command line and type following to copy DLL files from GAC.

For example if you want to copy System.Data.Linq.dll then you have to enter following,

cd WINDOWS\ASSEMBLY\GAC_MSIL\System.Data.Linq\

windows stores GAC assemblies at (windows\assembly\GAC_MSIL\\__)

now type DIR to list all files/folders inside that folder.








Now you can see a folder(s) with version number and key.
(This is the place where actual dll file is saved inside GAC)

Monday, May 4, 2009

Add Top Link to MySite from Central Admin

you can add top links to all mysites,

1. Go to Central Administration Site
2. Go to Share Service Provider Settings
3. click on Personalization site links from User Profiles and My Sites group
4. Add new link with following pattern. ( http://yourportal/?# )
NOTE : dont forget "?#"

Wednesday, April 1, 2009

Workflow Task forms (Multiple task forms)

LINK : http://msdn.microsoft.com/en-us/library/ms550938.aspx

Add an element to the Metadata element of the workflow template definition. This element is TaskID_FormURN Element (Workflow), where N represents the integer you assigned to that task type within the workflow. Set this element to the URN of the Office InfoPath 2007 form you want to use with this task. For example:


…
urn:schemas-adventureworks-com:workflow:ReviewRouting-Review
…


To differentiate the task types that your workflow creates, you assign each task type an integer identifier within that workflow. The first task type is 0, the second 1, and so on. This enables you to assign different content types, and different forms, to each task type. These task type identifiers must be unique only within a given workflow. For example, any workflow that creates a task has a task 0 task type; however, the task type does not have to be the same across all workflows.