Thursday, June 21, 2007

Recently I upgraded my DotNetNuke installation from 3.x to 4.5.3. Upgrade went smooth but I had tough time making dasblog work under DNN. (running on virtual directory under DNN).

I googled for solution nearly full day but didn't get the exact solution. All the solutions were for dnn 3.x though which I was using for around an year (on .Net 1.1). <Clear/> tag does not work to clear root HTTP modules and handlers settings which gets inherited to any .net applications under root.

Hope this solution helps guys in similar trouble. this can be applied for any DNN 4.5.3 installation to have any virtual directory within the same...

1) add following entries in the beginning of <httpHandlers> section of web config file in dasblog.

   <remove verb="*" path="*.captcha.aspx"/> 
   <remove verb="*" path="LinkClick.aspx"/>
   <remove verb="*" path="RSS.aspx"/> 
   <remove verb="*" path="*.asmx"/>
   <remove verb="*" path="*_AppService.axd" />
   <remove verb="GET,HEAD" path="ScriptResource.axd"/>

2) add entries in <httpModules> section.

  <remove name="Compression"  />
   <remove name="RequestFilter"  />
   <remove name="UrlRewrite"  />
   <remove name="Exception"  />
   <remove name="UsersOnline"  />
   <remove name="DNNMembership"  />
   <remove name="Personalization"  />
   <remove name="ScriptModule"  /> 

3) add following entries in <pages> tag.. (make sure, all attributes of <pages> tag (if exists) are same as before.  Idea here is to clear the namespaces).

<pages validateRequest="true">
<namespaces>
    <clear/>
   </namespaces>
</pages>

All this and you'd have your web application working under DNN!!!

Cheers!!!

posted on Thursday, June 21, 2007 11:09:16 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
 Thursday, April 27, 2006

Presented here is a nice article on Asp.Net optimization.. Via John Belthoff

************

If you read all of the websites dedicated to Asp.Net you will inevitably read about the wonders of the DataGrid, DataList, and Repeater controls. While each of these has its place, if you are only displaying data there is a much faster and more efficient means to do so. A normal asp page execution procedure goes something like this. The code queries the database based on the Article I.D. and then brings back that information to the page where you display it in the fashion that you would like. This is a fairly straight forward approach with asp and is done all the time.

So how do we speed up our asp.net pages?

Number 1: Use Asp.Net Caching!

This is a no-brainer, and I won't go into the brilliance or details of asp.net caching here because at the time of this writing Google has 2,780,000 articles on the topic. Basically instead of querying the database each time the page is loaded you only query the database once and load that result into the system cache. Subsequent calls to load the page retrieve the data from the cache as opposed to the database which gives you an instant and considerable performance boost. You can then set the cache for how long the cache should store the information as well as many other features. If you are not using the cache, you should be whenever possible!

Number 2: If possible, do NOT use the standard Asp.Net controls.

That's right. The standard asp.net controls are designed for rapid development and not page performance. They allow you to design pages that grab and display data very quickly but their actual performance suffers because of the extra overhead which is there for ease and speed of development time and not page execution speed.

Instead, create either a User Control or even better yet a Web Custom Control which is by far the fastest performance wise and really quite easy to create and use.

Number 3: Use an SqlDataReader or even better yet use a set based command for Sql Server data retrieval and simply execute that one command against the database.

An asp.net SqlDataReader is a fast forward only datareader that closes the connection after it reads the last set of results. Now for my article pages we are only returning 1 particular result. In this case we would opt for the set based command. If you had more than 1 result returned, in your table of contents for instance, you would use the SqlDataReader because you are returning multiple sets of results.

Set based commands are stored procedures that bring back data through parameters as opposed to a result set which then in turn needs to be looped through to obtain your data. So instead of writing your stored procedure like the following which brings back 1 result set:

Select Title, Body, Author
From Articles
Where ArtID = 215


We can write it using a set based command like this.

Create Procedure mysp_GetArticle

@Title varchar(200) Output,
@Body varchar(8000) Output,
@Author varchar(500) Output

As

Select @Title = Title, @Body = Body, @Author = Author
From Articles
Where ArtID = 215

GO


The above query will return only the three parameters called for and not a result or record set so you don't have to then walk through the returned record set that has only 1 result in it anyway. This second little process of work decreases your performance so you should avoid it whenever possible. Combine this technique with the asp.net cache.

Number 4: Use Classes and ArrayLists as opposed to returning an SqlDataReader.

Create a class and then if there are more than one set of results store those results into individual instantiations of that class. Finally store each of those classes into an ArrayList. You can then store only that ArrayList into the asp.net cache. So instead of getting the results back from a SqlDataReader when loading your page you get them from the ArrayList which is stored in the cache. Nice huh?

Finally... you want to incorporate all of these techniques into your final results which would be performed in the following manner and sequence.

On the first time the page loads, query the database and return all of your data storing it into individual classes. Then store each of those classes into an ArrayList. If you only have one single result you may store only the class into the cache. Then take your ArrayList and store it into the cache.

Next create a Web Custom Control and pass the cached ArrayList to the custom control and loop out your data using the HtmlTextWriter which is very fast. Remember each subsequent call to load the page will be called from the cache which stores your ArraList of classes or your single class.

Certainly it takes a significant amount of additional coding to do it in this fashion, especially when you take proper error handling into consideration, but if you follow this approach your pages will be screeching fast, you will immediately notice the difference, and your asp.net pages will execute in the proper sequence - Data handling in the Page_Load function and the html display in the Page_Render function.

Further, you will be glad you did and so will your visitors.

************

posted on Thursday, April 27, 2006 1:23:39 PM (Central Standard Time, UTC-06:00)  #    Comments [1] Trackback
 Wednesday, March 15, 2006

VISIBILITY.net is one of the first Enterprise business applications to be written from the outset entirely using Microsoft.NET framework and Web services architecture. This methodology provides engineer-to-order (ETO) manufacturers with a distinct set of advantages when deploying the enterprise resource planning (ERP) application. VISIBILITY.net has a highly functional user interface, providing the user with a multi-document interface (multiple windows) in a single browser session.

Visibility extended the standard Microsoft ASP.NET development environment by providing a highly intuitive, interactive user experience that would not usually be possible within an Internet application. This accomplishment is achieved with a zero client interface. VISIBILITY.net does not download any software onto client PCs to operate. Any client PC with Internet Explorer 5.5 or later is capable of operating with VISIBILITY.net.

VISIBILITY.net is deployed as a true internet application - the system administrator need not know anything about the client hardware because no installation is necessary. In doing so it provides ubiquitous access for users inside the four walls of your organisation, for users at remote plants and sales offices, and for users 'on the road'.

* Internet Standards based - some ERP vendors have put a 'tick in the box' against industry standards such as HTTP, XML, .NET and Web services through the use of 'bolt-on' technology modules.

The very core of the VISIBILITY.NET application makes use of this technology today, without the need for additional middleware or integration applications. Read Full article here...

posted on Wednesday, March 15, 2006 11:01:19 AM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
 Sunday, December 11, 2005

Today I ran into an issue with one of my DNN sites... I changed site settings and set the login page to one of the tabs which resulted in no access to login page for me and my users...I tried some of the solutions on the web but none of the earlier worked because I had removed friendly URLs host setting.

To get the access back try adding ctl=login to the end of a query string it forces a load of the login dialog eg http://www. mysite.com/default.aspx?ctl=login . If this doesn't work, try this to get around the problem http://www.mysite.com/Home/ tabid/<36>/ctl/Login/Default.aspx (change <36> with home tab id)

If this also doesn't work, John Mitchell has also posted a solution in his blog, where he has created an alternate login page that you can upload, you can view the details here:

http://blogs.snapsis.com/PermaLink,guid,05e0a045-4944-4f85-aa12-ac9cb774e2fb.aspx

Finally last one worked for me...Thanks John

Cheers

posted on Sunday, December 11, 2005 9:58:00 AM (Central Standard Time, UTC-06:00)  #    Comments [1] Trackback
 Saturday, November 20, 2004

Via Leo

I encountered a very informative post about ASP.Net page life cycle on an equally informative blog from Leo.

Any ASP.NET developer should know the inner workings of the ASP.NET engine. The Page control is its backbone. Knowing the control lifecycle in the page considerably helps in the day-to-day and advanced development projects. read more..

Of course there are lotsa websites having articles on the similar topic but this one takes the bet because of it's beautiful graphical representation (a picture speaks thousands words :-))

posted on Saturday, November 20, 2004 11:31:00 AM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback
 Monday, September 20, 2004

Open Source .Net IDE #develop (SharpDevelop) has got even better.  Written entirely in standards-based C#, 

the #develop version, released September 10, sets a "solid foundation for the growth" of Open Source tools for .NET development projects,

Developers at #develop, have added project-level import for VS.NET and other features to their 1.0 version of their #develop (SharpDevelop) Open Source IDE for C#, VB.NET, Managed C++ and ILAsm projects built to run on Microsoft's .NET platform.

The focus of the Open Source #develop IDE project is "on making #develop portable to other CLRs and platforms" to allow #develop to run with native look and feel on Microsoft .NET / Windows, as well as Mono on Windows and Mono on Linux. Aside from standard code creation and debugging facilities, #develop also brings a full environment to the project, including Windows Forms, testing, auto-insertion capabilities for code and tweaks and even an XML preview feature.... read more...

An IDE can be downloaded here

posted on Monday, September 20, 2004 5:08:00 PM (Central Standard Time, UTC-06:00)  #    Comments [0] Trackback