Archive

Archive for the ‘VS.net 2008’ Category

UFrame: goodness of UpdatePanel and IFRAME combined

29 May 2008 Steve Leave a comment

UFrame combines the goodness of UpdatePanel and IFRAME in a cross browser and cross platform solution. It allows a DIV to behave like an IFRAME loading content from any page either static or dynamic. It can load pages having both inline and external Javascript and CSS, just like an IFRAME. But unlike IFRAME, it loads the content within the main document and you can put any number of UFrame on your page without slowing down the browser. It supports ASP.NET postback nicely and you can have DataGrid or any other complex ASP.NET control within a UFrame. UFrame works perfectly with ASP.NET MVC making it an replacement for UpdatePanel. Best of all, UFrame is implemented 100% in Javascript making it a cross platform solution. As a result, you can use UFrame on ASP.NET, PHP, JSP or any other platform.

<div class=”UFrame” id=”UFrame1″ src=”SomePage.aspx?ID=UFrame1″ >
<p>This should get replaced with content from Somepage.aspx</p>
</div>

PowerCommands for Visual Studio 2008

14 March 2008 Steve Leave a comment

Collapse Projects
This command collapses a project or projects in the Solution Explorer starting from the root selected node. Collapsing a project can increase the readability of the solution. This command can be executed from three different places: solution, solution folders and project nodes respectively.

Copy Class
This command copies a selected class entire content to the clipboard, renaming the class. This command is normally followed by a Paste Class command, which renames the class to avoid a compilation error. It can be executed from a single project item or a project item with dependent sub items.

Paste Class
This command pastes a class entire content from the clipboard, renaming the class to avoid a compilation error. This command is normally preceded by a Copy Class command. It can be executed from a project or folder node.

Copy References
This command copies a reference or set of references to the clipboard. It can be executed from the references node, a single reference node or set of reference nodes.

Paste References
This command pastes a reference or set of references from the clipboard. It can be executed from different places depending on the type of project. For CSharp projects it can be executed from the references node. For Visual Basic and Website projects it can be executed from the project node.

Copy As Project Reference
This command copies a project as a project reference to the clipboard. It can be executed from a project node.

Edit Project File
This command opens the MSBuild project file for a selected project inside Visual Studio. It combines the existing Unload Project and Edit Project commands.

Open Containing Folder
This command opens a Windows Explorer window pointing to the physical path of a selected item. It can be executed from a project item node

Open Command Prompt
This command opens a Visual Studio command prompt pointing to the physical path of a selected item. It can be executed from four different places: solution, project, folder and project item nodes respectively.

Unload Projects
This command unloads all projects in a solution. This can be useful in MSBuild scenarios when multiple projects are being edited. This command can be executed from the solution node.

Reload Projects
This command reloads all unloaded projects in a solution. It can be executed from the solution node.

Remove and Sort Usings
This command removes and sort using statements for all classes given a project. It is useful, for example, in removing or organizing the using statements generated by a wizard. This command can be executed from a solution node or a single project node.
Note: The Remove and Sort Usings feature is only available for C# projects since the C# editor implements this feature as a command in the C# editor (which this command calls for each .cs file in the project).

Extract Constant
This command creates a constant definition statement for a selected text. Extracting a constant effectively names a literal value, which can improve readability. This command can be executed from the code editor by right-clicking selected text.

Clear Recent File List
This command clears the Visual Studio recent file list. The Clear Recent File List command brings up a Clear File dialog which allows any or all recent files to be selected.

Clear Recent Project List
This command clears the Visual Studio recent project list. The Clear Recent Project List command brings up a Clear File dialog which allows any or all recent projects to be selected.

Transform Templates
This command executes a custom tool with associated text templates items. It can be executed from a DSL project node or a DSL folder node.

Close All
This command closes all documents. It can be executed from a document tab.

Difference between ASP.NET Server Controls and HTML Server Controls

25 January 2008 Steve Leave a comment

Advantages:

1. ASP .NET Server Controls can detect the target browser’s capabilities and render themselves accordingly. No issues for compatibility issues of Browsers i.e page that might be used by both HTML 3.2 and HTML 4.0 browsers code is written in the Server Controls.

2. Newer set of controls that can be used in the same manner as any HTML control like Calender controls. Without any need of Activex Control without bringing up issues of Browser compatibility).

3. Processing would be done at the server side. In built functionality to check for few values(with Validation controls) so no need to choose between scripting language which would be incompatible with few browsers.

4. ASP .NET Server Controls have an object model different from the traditional HTML and even provide a set of properties and methods that can change the outlook and behavior of the controls.

5. ASP .NET Server Controls have higher level of abstraction. An output of an ASP .NET server control can be the result of many HTML tags that combine together to produce that control and its events. Example Gridview or Form control.

Disadvantages:

1. The control of the code is inbuilt with the web server controls so you have no much of direct control on these controls

HTML Server Controls

Advantages:

1. The HTML Server Controls follow the HTML-centric object model. Model similar to HTML

2. Here the controls can be made to interact with Client side scripting. Processing would be done at client as well as server depending on your code.

5. A HTML Server Control has similar abstraction with its corresponding HTML tag and offers no abstraction.

Disadvantages:

1. You would need to code for the browser compatibility.

2. The HTML Server Controls have no mechanism of identifying the capabilities of the client browser accessing the current page.

Microsoft Live Labs :: VOLTA

18 December 2007 Steve 1 comment

Microsoft Live Labs Volta helps developers who build distributed applications on the .NET platform, using the Microsoft development stack (programming languages, libraries, and Visual Studio). This version of Volta supports applications that run on the Microsoft CLR, a JavaScript-enabled browser, or a combination of the two.

First, this document introduces the Volta technology. Then, it covers two important Volta targets that developers are likely to build and deploy: applications and controls. Recipe-like descriptions for several common web-based scenarios follow. The document concludes with an overview of the libraries installed with Volta, and a summary of known issues and limitations.

The Volta Programming Model

In essence Volta is a recompiler. Volta works on MSIL rather than on a textual source language. Volta rewrites MSIL into any number of target languages, including, today JavaScript and MSIL itself. Rewriting, as a general technology, lets us delay permanent decisions about architecture, execution platform and browser until after our code is basically working. Furthermore, it frees us from having to express all these irreversible decisions in your source code. The result is a programming model that enables us to easily reshape a working application, and finally realizes the promise of one application running anywhere.

Volta effects recompilation through 3 general capabilities: refactoring, retargeting, and remodulating. Refactoring converts single-tier code into distributed, concurrent code as directed by user-supplied annotations. Retargeting converts MSIL code into code for other virtual machines. Remodulating tailors a single piece of code for multiple browsers. The next 3 sections explain in more detail.

Architecture Refactoring

The Volta programming model takes refactoring one step further. Volta applies transformations on our compiled code based on metadata, in particular, custom attributes prefixed on classes or methods that could run on a server tier. During development, all code runs in the client for ease of testing and debugging. Redistributing the code amongst client and server is merely a matter of moving custom attributes around and rebuilding. The Volta rewriter automatically creates and deploys the marshalling and security code necessary to execute the code on multiple tiers. The following diagram illustrates evolution of a Volta application from single-tier architecture to a distributed, multi-tiered architecture.

image001

After refactoring, notice that the same application that used to run in one instance of the CLR is now running on two tiers. Volta dramatically extends the reach of the .NET platform to cover the cloud. We emphasize that the only differences at the source-code level are the presence and positions of custom attributes. Volta doesn’t eliminate the intellectual challenges of distributed computing. We must still formulate strategies for partitioning functionality and dealing with network latency and availability. Volta does, however, radically simplify the error-prone plumbing and re-plumbing of communication code.

Volta leverages the entire .NET platform, including most libraries and programming languages. We can write in our favorite .NET languages, use familiar .NET libraries and tools, and produce sophisticated distributed applications using only the “materials already in the room.” Without Volta we are exposed to too many inconsistent, special-purpose languages with kludges to help them interact in the cloud. For instance, typical methodologies for cloud programming involve combinations of ASP, PHP, Flash, XML, HTML, CSS, JavaScript, Perl or Ruby, C# or Java, SQL, and even more! Volta reduces the brittleness of distributed applications by lowering the sensitivity to idiosyncrasies of multiple languages and dialects.

Another important advantage of architecture refactoring is opening up brown-field scenarios. With minimal changes we can run existing .NET code in the cloud, greatly increasing the user base of code that may have been designed only for a single tier. Volta gives us a new dimension of software reuse. Traditionally, we would endeavor to reuse bits and pieces of source code in new scenarios. Volta lets us reuse binaries in new scenarios.

In summary, Volta confers flexibility in the architecture dimension through:

  • Language-independence. Write Volta code in any language that compiles into MSIL. For example, C#, VB, IronPython, etc.
  • Leverage the entire .NET toolchain. Use libraries; the IDE, Intellisense, auto-complete, snippets; FxCop; profiler; class browser; ILDASM; and so on.
  • Low entry barrier. Reduce your learning burden; use “only the languages in the room.”
  • Brown-field applicability. Volta-enable existing applications for the cloud.
  • Beyond 2 tiers. Refactor to as many tiers as you need using exactly the same mechanisms recursively applied.

Platform Retargeting: Extend the Reach

Without Volta, we must choose not only the architecture, but also the execution environment before we write code. For example, we often start with a WinForms application, confining us to client-side architecture and CLR execution.

We’ve already seen that Volta tier splitting lets us refactor the application so that part of it runs on the server. Volta retargeting lets us run MSIL code also in a JavaScript engine. Primary scenarios involve JavaScript in a browser running the client side of a distributed application. However Volta is not tethered to the browser and retargeted code runs in any JavaScript engine, such as the Jscript engine bundled with Internet Explorer.

Volta retargeting employs the technique of deep embedding, which preserves precise semantics of CLR objects, classes, methods, events, and so on, despite some rather deep impedance mismatches between the two platforms. For instance, MSIL is statically typed, whereas JavaScript is dynamically typed. Volta does all the hard work for us, though, and we are not restricted to a subset of .NET language features. Anything MSIL can do, including events, exceptions, casts, and generics, runs precisely correctly on alternative platforms. Volta’s semantic fidelity is orthogonal to tier-splitting, so, with some limitations, it’s possible to fire events and exceptions across tiers, as if they were on the same runtime instance.

Let your imagination be your guide. Retargeting is independent of refactoring and we can mix and match them as appropriate to our scenarios.

Let’s develop a simple scenario. Consider a typical web application, and focus attention on the component running in the browser. Without Volta, we write HTML, CSS, and JavaScript, targeting the browser’s execution environment, in addition to server code. With Volta, we have one programming model for both tiers, namely .NET. Volta retargets the browser component, writing the JavaScript for us from MSIL, hiding the impedance mismatch.

Retargeting is all the more important in the face of Ajax, which encourages ever more functionality in the browser for increased responsiveness and better user experiences.

In summary, Volta confers flexibility in the execution-platform dimension through:

  • Deep embedding of CLR semantics. Preserve exact CLR semantics across platforms.
  • Cross-browser support. Use one programming model across browsers.
  • Complete orthogonality with refactoring. Mix and match refactoring and retargeting.
  • Ajax-ready. Write Ajax patterns and idioms in familiar .NET languages.

Browser Remodulating: Cross-Browser Support

Despite the standardization of DHTML, which includes JavaScript and DOM access, many subtle differences exist amongst popular browsers. The rise of Ajax has amplified the differences, and furthermore, has created a sense of urgency in the marketplace, hence a continuous flow of new features and capabilities that developers must chase. Consequently, without Volta, developers must write more and more browser-specific code, leaving them less time to focus on their applications.

Volta hides as many browser-specific differences as possible, but still allows developers to leverage the unique capabilities of particular browsers. Instead of targeting solely the intersection of browser capabilities, Volta targets the entire union, but makes the intersection browser-agnostic. This is browser remodulating. From the developer’s point of view Volta attenuates browser differences. But what about testing and debugging? Volta and the Visual-Studio integration supports debugging and testing of applications with full transparency. Visual Studio’s Solution Platform dropdown lets us choose the specific browser we want for a testing/debugging session. This allows us to see how each browser renders the HTML.

In this release Volta supports the Internet Explorer and Firefox browsers. We accommodate specific browsers through a combination of changes to the recompiler and libraries, plus Visual Studio integration for debugging.

In summary, Volta confers flexibility in the execution-platform dimension through:

  • Cross-browser support. Write the same code for Internet Explorer and Firefox.
  • Debugging transparency. Debug code with a specific browser.
  • Leverage browser-specific features. Where needed, access features unique to each browser.
  • Visual-Studio integration. Enjoy seamless integration with the IDE.

Three Primary Pillars of VS.NET 2008

22 November 2007 Steve Leave a comment

Microsoft Visual Studio 2008 delivers on Microsoft’s vision of smart client applications by enabling developers to rapidly create connected applications that deliver the highest quality, rich user experiences.

With Visual Studio 2008, organizations will find it easier than ever before to capture and analyze information to help them make effective business decisions. Visual Studio 2008 enables organizations of every size to rapidly create more secure, manageable, and reliable applications that take advantage of Windows Vista and the 2007 Office system. Visual Studio 2008 delivers key advances for developers in three primary pillars:

  1. Rapid application development
  2. Effective team collaboration
  3. Breakthrough user experiences

These above three pillars has following seven technology areas.

Developing Smart Client Applications. Visual Studio 2008 delivers new and easy ways for developers to build smart clients. It provides a comprehensive set of tools and classes that simplify integrating smart clients with new or existing Web applications, and it enables local data caching for disconnected scenarios.

Creating Microsoft Office Applications. Visual Studio Tools for Office (VSTO) is fully integrated into Visual Studio 2008 Professional Edition. Developers can now customize various Office applications, such as Outlook® and PowerPoint®, to improve user productivity and simplify deployment.

Building Windows Vista Applications. Developers can easily leverage new platform technologies, and deliver more compelling applications to their customers, by effortlessly incorporating new Windows Presentation Foundation features into both existing Windows Forms applications and new applications.

Handling Data More Productively. The introduction of Language Integrated Query (LINQ) and other data-access improvements enable developers to apply a consistent programmatic approach to data handling, perform data access with new data-design surfaces, and use built-in classes for the occasionally connected design pattern.

Enabling New Web Experiences. Developers can easily create efficient, interactive Web applications with Visual Studio 2008. Seamless integration of the familiar ASP.NET AJAX programming model enables more efficient client-side execution, giving end users a more responsive Web interface. JavaScript IntelliSense and debugging further improve the development experience.

Gaining an Improved Overall Developer Experience. Visual Studio 2008 delivers a better developer experience overall through the combination of significant product quality improvements, and changes to the way the most popular design surfaces return errors to the user. In addition, Visual Studio 2008 simplifies the user’s ability to adopt the toolset and framework separately by enabling developers to target different .NET Framework platforms.

Improving Application Lifecycle Management (ALM). ALM features in Visual Studio provide great support not only for managing the entire software-development life cycle, but also for critical interaction with an enterprise application’s final end-users and IT stakeholders.

Categories: VS.net 2008