.Net Pakistan

A platform for .Net Evangelists, where they can indulge their passion with .Net

Friday, September 30, 2005

Windows Sharepoint Services service pack 2.0.

On September 27th Microsoft released Windows Sharepoint Services service pack 2.0.

You can download it from the following link:
Windows SharePoint Services Service Pack 2 (SP2): "

Windows SharePoint Services Service Pack 2 (SP2) contains stability and performance improvements. Some of the fixes included with SP2 have been previously released as separate updates. This service pack combines them into one update.(source MSDN)

Along with other noteworthy updates and fixes WSS SP 2.0 now supports SQL Server 2005 and ASP.NET 2.0 as well.

For more detailed information please visit Microsoft Support sites KB article here

Hammad Rajjoub
www.dotNetPakistan.com

Wednesday, September 21, 2005

Windows Workflow Foundation

Paul Andrew has got some webcasts targeting especially Windows Workflow Foundation, which will be held during September 26-30, 2005. Make sure you drop by at his blog for the webcasts links. All of you still wondering whats Workflow is, well I have some links to kill your curosity.

Windows Workflow Foundation
Channel 9 coverage




Zeeshan Muhammad.
INETA Pakistan EXCOMM
INETA Pakistan Speaker

Monday, September 19, 2005

PDC 2005 (US) Resource Box : Microsoft Tools & Techs for next Generation!

Microsoft Tools & Techs for next Generation!

Click here to download the slides of PDC 2005.

http://commnet.microsoftpdc.com/content/downloads.aspx (Contain good information about latest tools, like "Workflow in Windows Applicaton", etc.

Bill Gates Speech @ PDC 2005 http://www.microsoft.com/billgates/speeches/2005/09-13PDC05.asp

Regards,
Wajahat Abbas
http://www.wajahatabbas.com
http://www.dotnetpakistan.com

Saturday, September 17, 2005

Introducing LINQ!

Paul Vick introduces LINQ.

Here is an excerpt from his blog.

"To start with, LINQ stands for “Language Integrated QUery.” LINQ fundamentally is about integrating query operations into the .NET platform in a comprehensive and open manner. It’s also about providing a unified way for you to query across any kind of data that you have in your program, whether it’s relational, objects or XML. This, we believe, will represent a tectonic shift in the way that VB programmers will work with data. The possibilities that having query capabilities always available right at your fingertips, regardless of the type of data you’re working with, are immense and will fundamentally alter the way people program."

Read the entire post!

Friday, September 16, 2005

Cross Page Postback Techniques : Comparing ASP.NET 1.X and 2.0

In an every day life of ASP.NET programmer there are number of occassions when he/she would want to postback a page to some other target page. And then from target page he/she would like to fetch information from source page (the page that triggered the postback). With ASP.Net 1.x this was only possible thrgouh Server.Transfer (that keeps the state of posted page). And then on the target one would always use Context.Handler and type cast it into the page that orginated this request (i.e.source page) .


Following is a code snippet that shows how calling server.transfer transfers state of source page to the target page.



Source page (WebForm1.aspx)

Server.Transfer("WebForm2.aspx"); // Transfer to target page URL



Target page (WebForm2.aspx)



// variable to hold webform1 instance

private WebForm1 previousPage;



// type casting it

if(Context.Handler != null && Context.Handler is WebForm1)

{

previousPage = (WebForm1) Context.Handler;

}



And then through previousPage reference one can access properties that were exposed on that page. Like if “SpookyValue” was some public proprty in “WebForm1” class then you could access it easily like “previousPage.SpookyValue”.



But to be able to do this all we needed to use “Server.Transfer”. With Response.Redirect all state information is lost. However with ASP.NET 2.0 we do have postbackURL property that comes in handy when we are talking about cross page PostBacks. Just by specifying “PostBackUrl” we can easily transfer the state of one page to the other page.



this.btnPostBack.PostBackUrl = "~/Default2.aspx";



On the receieving end of this postback, we can easily retrieve the page refrence that initiated this postback. This could be done using “PreviousPage” property. Following is code snippet that does the same:



if (this.PreviousPage != null && this.PreviousPage.IsCrossPagePostBack)

{

this.txtDetails.Text = "This is a cross Page Post Back and the source page is " + this.PreviousPage.ID;

this.txtDetails.Text += "Variables available at previous page: Comments = " + ((_Default)this.PreviousPage).Comments;

this.txtDetails.Text += "Value = " + ((_Default)this.PreviousPage).Value;

}





--------------------------------------------------------------------------------
Code for ASP.NET 1.X (WebForm2.aspx.cs)


--------------------------------------------------------------------------------



29: private void Page_Load(object sender, System.EventArgs e)
30: {
31: //this.Request.p
32: if(Context.Handler != null && Context.Handler is WebForm1)
33: {
34: previousPage = (WebForm1) Context.Handler;
35: }
36:
37: // Put user code to initialize the page here
38: ShowStateInformation();
39:
40: }
41:
64: /// Shows state information
65: ///
66: private void ShowStateInformation()
67: {
68: lblStateInformation.Text = "View State Informaiton goes like : " ;
69: IEnumerator viewStateEnum = this.ViewState.Keys.GetEnumerator();
70:
71: while(viewStateEnum.MoveNext() )
72: {
73: lblStateInformation.Text += "Viewstate Key = "+viewStateEnum.Current.ToString()+" and Value = "+this.ViewState[viewStateEnum.Current.ToString()].ToString()+" ";
74: }
75:
76: if(previousPage != null)
77: lblStateInformation.Text = "Spooky Info goes like "+previousPage.SpookyValue;
78: else
79: lblStateInformation.Text = "No state information available ";
80: }
81:
82: }
83: }

--------------------------------------------------------------------------------
Code for ASP.NET 1.X (WebForm1.aspx.cs)


--------------------------------------------------------------------------------


25: private string someSpookyVariable;
26:
27: public string SpookyValue
28: {
29: get
30: {
31: return this.someSpookyVariable;
32: }
33: }
34:
35:
36: private void Page_Load(object sender, System.EventArgs e)
37: {
38: if( this.ViewState["spookyStateKey"] != null)
39: {
40: Response.Write(" I have a spooky state variable "+this.ViewState["spookyStateKey"].ToString());
41: }
42: // Put user code to initialize the page here
43: ShowStateInformation();
44: }
45:
60: private void InitializeComponent()
61: {
62: this.btnRedirect.Click += new System.EventHandler(this.btnRedirect_Click);
63: this.Load += new System.EventHandler(this.Page_Load);
64:
65: htmlHiddenInfo = new HtmlInputHidden();
66: htmlHiddenInfo.ID="HiddenId";
67: htmlHiddenInfo.Name="HiddenName";
68: htmlHiddenInfo.Value="HiddenValue";
69: this.Controls.Add(htmlHiddenInfo);
70:
71: this.someSpookyVariable = "I am a spooky value that might be read from some other page!";
72:
73: }

79: private void ShowStateInformation()
80: {
81: lblStateInformation.Text = "View State Informaiton goes like : " ;
82: IEnumerator viewStateEnum = this.ViewState.Keys.GetEnumerator();
83: while(viewStateEnum.MoveNext() )
84: {
85: lblStateInformation.Text += "Viewstate Key = "+viewStateEnum.Current.ToString()+" and Value = "+this.ViewState[viewStateEnum.Current.ToString()].ToString()+" ";
86: }
87:
88: lblStateInformation.Text += "Hidden Var Info goes like : " ;
89: lblStateInformation.Text += "Name = "+htmlHiddenInfo.Name+" Id = "+htmlHiddenInfo.ID+" Value = "+htmlHiddenInfo.Value;
90: }
91:
92: private void btnRedirect_Click(object sender, System.EventArgs e)
93: {
94: if(this.ViewState["spookyStateKey"] == null)
95: {
96: this.ViewState.Add("spookyStateKey","spookyStateValue");
97: }
98:
99: Server.Transfer("WebForm2.aspx");
100:
101: }
102: }
103: }

--------------------------------------------------------------------------------

Code for ASP.NET 2.0 (_Default.aspx.cs)

--------------------------------------------------------------------------------


11: public partial class _Default : System.Web.UI.Page
12: {
13: ///
14: /// Comments to be exposed on the post back
15: ///
16: public string Comments
17: {
18: get
19: {
20: return this.txtComment.Text;
21: }
22: }
23:
24: ///
25: /// Value to be exposed on post back
26: ///
27: public string Value
28: {
29: get
30: {
31: return this.cmbValues.Text;
32: }
33: }
34:

39: protected void btnPostBack_Click(object sender, EventArgs e)
40: {
41: this.btnPostBack.PostBackUrl = "~/Default2.aspx";
42: }
43: protected void btnServerTransfer_Click(object sender, EventArgs e)
44: {
45: Server.Transfer("Default2.aspx");
46: }
47: protected void Button1_Click(object sender, EventArgs e)
48: {
49: Response.Redirect("Default2.aspx");
50: }
51: }
--------------------------------------------------------------------------------Code for ASP.NET 2.0 (Default2.aspx.cs)--------------------------------------------------------------------------------

1: protected void Page_Load(object sender, EventArgs e)
2: {
3: if (this.PreviousPage != null && this.PreviousPage.IsCrossPagePostBack)
4: {
5: this.txtDetails.Text = "This is a cross Page Post Back and the source page is " + this.PreviousPage.ID;
6: this.txtDetails.Text += "Variables available at previous page: Comments = " + ((_Default)this.PreviousPage).Comments;
7: this.txtDetails.Text += "Value = " + ((_Default)this.PreviousPage).Value;
8: }
9: else
10: {
11: if ( (this.Context.Handler != null) && (this.Context.Handler is _Default) )
12: {
13: this.txtDetails.Text = "This was a Server.Transfer Request";
14: this.txtDetails.Text += "Variables available at previous page: Comments = " + ((_Default)this.Context.Handler).Comments;
15: this.txtDetails.Text += "Value = " + ((_Default)this.Context.Handler).Value;
16: }
17: else
18: {
19: this.txtDetails.Text = "This was a Response.Redirect Request. No state available for calling page!";
20: }
21: }
22: }

--
Hammad Rajjoub,
Microsoft MVP (Most Valuable Professional),
Windows Server Systems: XML Web Services
Member Speakers Bureau,
Chairman UG Relations Committe,
INETA MEA.(http://mea.ineta.org)
Blog: http://dotnetwizards.blogspot.com

www.dotNetPakistan.com

Wednesday, September 14, 2005

Atlas Unleashed!

A while ago, I wrote about the development on Atlas Project on my blog. Scott Guthrie has just unleashed ATLAS at the PDC.

Here is the link to the Official Atlas Website.

Happy Programming!

Saturday, September 10, 2005

Bill Gates on Channel 9

Watch a short interview of Microsoft Chief Software Architect "Bill Gates" at Channel 9.

Video Length: 00:16:34 | Save

Click here to read more.


Zeeshan Muhammad
User Group Leader - NED.net
INETA Pakistan Speaker

Tuesday, September 06, 2005

Web Services are not Distributed Objects

A good debate on "Web Services are not Distributed Objects" by Werner Vogels.

Hope you will like it,

http://weblogs.cs.cornell.edu/AllThingsDistributed/archives/000343.html

Regards,
Wajahat Abbas
http://www.wajahatabbas.com
http://www.dotnetpakistan.com

Monday, September 05, 2005

Getting to know ASP.NET 2.0

When Microsoft released the .NET Framework 1.0 Technology in July 2000, it was immediately clear that Web development was going to change. The company’s prior technology, Active Server Pages (ASP) launched hundreds of books, articles, Web sites and components, all aiming to make the development process easier than before. However, what ASP did not have, was an application framework - it was never an enterprise development tool. Everything in ASP was code oriented - but it simply wasn't possible to avoid doing work without writing codes.
ASP.NET was designed to counter this problem. Right from its initial release as a preview technology, Microsoft ASP.NET has been a huge success. For those people developing web sites using Microsoft technologies, ASP.NET provides a rich programming model, allowing sites to be easily constructed. There has been a lot of talk since its release, but ignoring all the hype and press, .NET really is a product for developers, providing a great foundation for building all types of web applications. One of the key design goals of ASP.NET was to make programming easier and quicker by reducing the amount of code that needed to be created. This phenomenon operates when one enters the era of declarative programming model, rich server controls, large class libraries, and support for development tools from the humble Notepad to the high-end Visual Studio .NET.

Yup thats an excerpt from my latest contribution for Spider Magazine. See their September 2005 issue, page 47 if you want to read more. Visual Studio Team System, SQL Server 2005 and Smart Clients are on the list for future publications for both Spider and Dawn Sci-Tech. Feel free to share your comments and suggestions.



Zeeshan Muhammad
User Group Leader - NED.net
Member Speaker Bureau - INETA Pakistan
Member Infrastructure - INETA MEA

New breed in the World of Web Applications

Check it out to see the new breed in the World of Web Applications http://www.start.com

Wajahat Abbas
http://wajahatabbas.blogspot.com
www.dotNetPakistan.com

Saturday, September 03, 2005

MSDN TV Episode talks about "Data Access in ASP.NET 2.0"

Design Patterns :: Dependency Injections (DI)

Today there is a greater focus than ever on reusing existing components and wiring together disparate components to form a cohesive architecture. But this wiring can quickly become a daunting task because as application size and complexity increase, so do dependencies. One way to mitigate the proliferation of dependencies is by using Dependency Injection (DI), which allows you to inject objects into a class, rather than relying on the class to create the object itself.

Read the rest of this article and download the source code from here.


Zeeshan Muhammad

Friday, September 02, 2005

Defining your own Validation File (Web Applications)

Hi All,

One of the very tricky part of the dotnet web application is the facility of the validation web controls.

But what if you require some change on those methods ?

Yes you can modify the javascript validation file for your application. By default every .net web application, access the validaiton file resided in the asp_net_client directory of your wwwroot. But if you want to have your own validation file specfic to your application, you can do that, once you define, all your validation methods call will forward to that file.

What you have to do is to define a property in the web config file.



And now place the WebUIValidation.js in the script_files folder,

Wajahat Abbas
http://www.wajahatabbas.com
http://www.dotnetpakistan.com

Thursday, September 01, 2005

Architectural Overview of Windows SharePoint Services

Summary: Examine the architecture implemented in Microsoft Windows SharePoint Services. Learn what happens on the server when users issue page requests, and how Windows SharePoint Services responds. Understand the role of managed code in relation to unmanaged code in Windows SharePoint Services, and the Windows SharePoint Services database schema.

Click here to read
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_SP2003_ta/html/ODC_WSSArchitecture.asp


Wajahat Abbas
http://www.wajahatabbas.com
http://www.dotNetPakistan.com

Playing with cookies

Hi Guys,

There are many ways for maintaining cookies, among which cookie is one the best one. Usually one thing which most of the developers missed, is that they dont specify the expiry limit of a cookie, and whenever they search for the cookie physical prescence they cant find it. It is mandatory to define the limit if you want to see it, in other case it disappear once application close, and it exists virtually.

For more details click here http://msdn.microsoft.com/asp.net/using/migrating/phpmig/whitepapers/cookies.aspx

Wajahat Abbas
http://www.wajahatabbas.com
www.dotNetPakistan.com