February 2009 - Posts

0
Comments

ASP.NET MVC tips: Routing Engine to aid SEO / 301 Redirect / Tracking by shahed

Routing Library resides in the System.Web.Routing Namespace of the .NET Framework 3.5, which provides us the flexibility to use URLs that has no mapping to a physical file. This means ASP.NET MVC framework provides flexible URL mapping engine and enables...
0
Comments

ASP.NET tips: Display resultset from Multiple DataTable by shahed

I normally do not use DataSet and prefer Objects instead generated by the ORM frameworks, but recently I had to produce a ASP.NET page that displayed a list of records from multiple DataTables. Lets look at a similar example. Lets assume we consume this...
0
Comments

Solving DNN deployment issues, Redirecting to localhost and Running DNN in a different port by shahed

I was trying to host a small DNN application in one of our Server and I was facing couple of  issues. Problem 1: The first problem I faced is it was always redirecting to localhost, whenever I tried http://domain.com/dnn it was redirecting to http...
1
Comments

Dotnet Nuke Tips: Two common error while writing the SqlDataProvider by shahed

Two common errors done while writing the SqlDataProvider SQL for Dotnet Nuke Modules are 1. Not saving the file that contains SqlDataProvider SQL codes in the correct format. A quick trick is to open the files in NotePad and save them as "Unicode"...
0
Comments

LINQ Tips: Querying ArrayList via LINQ by shahed

Problem If you try to query an ArrayList via LINQ you might be surprised to see that its not supported and throwing an exception. In other words the following query will not work at all. ArrayList students = GetStudents(); var query =   from student...
1
Comments

LINQ Tips: Querying disposable objects in an using block by shahed

Be careful while querying the disposable object inside an using block, you may find that the yielded objects are all disposed before you have used them. To get over this issue use the ToList() method. You can exit the using block, and yield the results...
1
Comments

LINQ - "Where" Extension Method by shahed

Here is simple LINQ example where I have used Extension methods "Where", to select the participants whose score is greater than 80. var participants = Competition.GetParticipants() .Where(participant=> participant.Score > 80) .OrderByDescending...
0
Comments

Different ways of Validating ASP.NET Forms by shahed

Validating user input is a very common task that we perform during web page development, and in the ASP.NET world we have a handful amount of choices to perform validation. ASP.NET Validation Controls ASP.NET ships with a handful amount ASP.NET Validation...
1
Comments

X509Certificate cannot be located from CurrentUser Store in IIS by shahed

Background and Problem Recently, I developed a website which implements PKI infastructure. On Click of a Button I sign and encrypt a document and send to desired location. During the development I have put the signer certificate in my " Certificates...
0
Comments

Smart404: Handle 404 smartly in ASP.NET by shahed

Introduction The 404 or Not Found error message is an HTTP standard response code, there are many reasons for a 404 to show up like, Mistyped URL Pages have been moved. Pages have been deleted. The default error page for 404 may look something similar...
0
Comments

Databinding using ObservableCollection<T> by shahed

Someone asked me today : I have a text field and a drop down menu, based on the values of these 2 when i click on a button an api call is made to get the results. Now i want to display these results in a ListView using GridView. How can i use ObservableCollection...
0
Comments

Programatically Loading Providers by Avoiding web / app config by shahed

Background Recently I was in a situation where I had to expose two of my .NET Libraries as COM, to invoke via VBScript (Late Binding) from one of the Legacy Application. One of the .NET Library uses .NetTiers and the other one uses Subsonic as the DAL...
0
Comments

Loading Xps from MemoryStream by shahed

A common way of loading XpsDocument is to load it from file: XpsDocument document = new XpsDocument(filename, FileAccess.Read, CompressionOption.NotCompressed); FixedDocumentSequence fixedDocumentSequence = document.GetFixedDocumentSequence(); //To view...
0
Comments

Redirect to Login page on session expiration (ASP.NET) by shahed

Problem Redirect the user to login page after a period of inactivity or when the session expires. Investigation A quick search on Google will find many articles which discuss how we can detect session expiration and how to redirect to the login page....
0
Comments

Loading Providers in Medium Trust Mode using WebConfigurationManager by shahed

Problem: Recently I uploaded a ASP.NET2.0 website with a hosting provider (shared environment), and started getting this error when ever I wanted to load the providers declared on the config file: [SecurityException: Request for the permission of type...
More Posts Next page »
Powered by Community Server (Non-Commercial Edition), by Telligent Systems