Archive for the ‘ASP.NET’ Category

Posted by admin at 5 January 2009

Category: ASP.NET, Javascript

Tags: ,

The webmethod tag is an attribute added to a Public methods to indicate the method should be exposed as part of an XML Web service.  Below is an example of applying the WebMethod attribute.


<WebMethod()> _
Public Shared Function FunctionName(ByVal Parameter As String) As ObjectName
Dim ObjectName As Object = Object
Return ObjectName
End Function

The Web method can now be called via javascript on the client. Below is an example of calling the webmethod from the client.

PageMethods.FunctionName(Parameter1, onComplete, OnTimeOut, onError);

Here is a great link with additional information for web methods:

http://www.novologies.com/post/2009/05/06/Cleaner-Faster-Ajax-in-ASPNET.aspx

Posted by admin at 25 September 2008

Category: ASP.NET, Software Engineering

Tags: ,

Microsoft Velocity provides distributed in-memory web application caching. This provides highly scalable, high-performance application caching. “Velocity Caching” can be used to cache any Common Language Runtime (CLR is the Virtual Machine of Microsoft’s .NET initiative) through simple API’s. From a general standpoint, Velocity was created with the goal of providing performance, scalability and availability.

The main application for providing scalable, available, high-performance applications using Velocity is by fusing the memory between multiple computers to give a single/unified cache view for the application to employ. The application can they store any CLR object that is serializable.

http://blogs.msdn.com/velocity/

Posted by admin at 1 August 2008

Category: ASP.NET, Patterns & Practices

Tags: , ,

If (Not String.IsNullOrEmpty(Request.QueryString("qString"))) Then qString = Request.QueryString("qString")
End if

Posted by admin at 31 July 2008

Category: ASP.NET, Patterns & Practices, Software Engineering

http://msdn.microsoft.com/en-us/practices/default.aspx

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

http://www.codeplex.com/AppArchGuide

According to Microsoft P&P (Patterns and Practices) were created to meet the demands of architects and application developers. By following proven patterns and practices it is suggested that more sound applications will be the result. Included in P&P

  • How to design
  • Develop
  • Deploy
  • Operate architecturally sound applications on a Microsoft platform.

P&P for Web Applications
http://msdn.microsoft.com/en-us/practices/bb969054.aspx#web_apps

PHP Patterns and Practices
http://www.phppatterns.com/docs/start

Posted by admin at 17 April 2008

Category: Debugging

Tags:

Tracing

The tracing feature in ASP.NET is useful in tracking the execution of an application. This is helpful to display the trace in a way that doesn’t affect the programs output.

To enable tracing on a page-by-page level, set the Page directive in any ASP.NET page to True:

<%@ Page Language=”C#” Trace=”true” TraceMode = “SortByCategory” Inherits = “System.Web.UI.Page” CodeFile=”Default.aspx.cs” %>

To enable tracing for an entire application add tracing settings to the web.config:

<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug=”false” />
<authentication mode=”Windows” />
<trace enabled =”true” pageOutput =”True” requestLimit =”20″ traceMode =”SortByTime ” />
</system.web>
</configuration>

The page-level setting will take precedence over the web.config setting.

How to view Trace Data.

In the Page_Load event call System.Diagnostics.Trace.Write(). Make sure the pageOutput=True in the webConfig.

What’s being displayed

1. Request Details
ASP.NET Session ID, Character encoding of the request.

2. Trace information
All Trace.write methods called in the HTTP request. This is helpful to find methods that are taking a long time to execute.

3. Control Tree
HTML of ASP.NET Control Tree.

4. Session State
List all keys and values for users session .

5. Application State
List all keys and values for application.

6. Request Cookies Collection
List all cookies passed in during page request.

7. Response Cookies Collection
List all cookies passed back during page response.

8. Headers Collection
Shows all headers passed in during request from browser.

9. Response Headers Collection
Shows all headers passed back during response.

10. Form Collection
Displays dump of Form Collection and all keys and values.

11. Querystring Collection
Displays dump of Querystring collection and all keys and values.

12. Server Variables
Displays dump of Server Variables with keys and values.

The Trace.axd
Page output only displays information of the current page. If you want to create a collection use Trace.axd.

http://localhost/application-name/trace.axd

Trace.axd will display all tracing data up to the present limit.

Trace Forwarding

ASP.NET allows to forward trace message to System.Diagnostics.Trace:write to DiagnosticsTrace

<trace enabled =”true” requestLimit =”20″ writeToDiagnosticsTrace =”true ” pageOutput =”true”/>