How to Use Collapsible panel in your webSite

Hi

I have added some Ajax technology to my site. The left bar is having quite a few panels so I decided to make those panel Collapsible. Having worked with ATLAS before I knew how easy it would be to do this work.

All I had to do was add the CollapsiblePanelExtender to these panels. This extender targets any ASP.NET Panel control. The panel is also post-back aware so in case of post back the panel remembers it state

Continued...

Nw Themes using ASP.NET Themes
Hi

I have added a new theme to the site(Thanks to Farghana again). The new theme is called graphics. Th interesting thing for me was that all I had to do to add the theme was add 2 line of codes in which I set the correct Theme selected in the page load(May be I should have used radiobuttonlist) and 2 lines of code to select the new theme thanks to ASP.NET 2.0.

Vikram

How to get the statistics about the Database usage using sqlConnection object

Hi

One of the most important things needed to track and improve Application performance is Statistics. Statistics related to database work is of great importance to the developers. Since they need to track how many times the application is calling the database and how much time each query is taking and which query can be improved to increase the performance of the Application. We can use the sqlConnection object to retrieve the statistics related to database work.

Continued...

In built API for Health Monitoring for ASP.NET 2.0 web application

Hi

One of the new cool features of ASP.Net 2.0 is the Health Monitoring system. This is a very basic requirement for any Application. This provider has a comprehensive set of configuration attributes that you can use to customize the way it works.

ASP.NET version 2.0 health monitoring supports many standard events that you can use to monitor the health of your application. Examples of security related events that are automatically generated include logon failures and successes when using the ASP.NET membership system, attempts to tamper with or reuse forms authentication tickets, and infrastructure events such as disk access failures. You can also tap the event related to application start and Application end.

Continued...

How to get the IP address of the machine of the user

When we are logging the website we also want to log the user IP address.

The below given code gives you the IP address of the User Accessing the site.

HttpContext.Current.Request.UserHostAddress;
or
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

To get the IP address of the machine and not the proxy use the following code

HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

Continued...

Theme changing on the fly using ASP.Net 2.0

Hi

Now the users can change the look and feel of the site as per their choice in my site. You can change the radio button on the left and accordingly the full theme (images, skin, and css) will change. This can be done very easily in asp.net 2.0.

After my friend (Thanks to Farghana) created a new theme for the site it required less than 10 line of code to change the theme on the fly.

Continued...

Sending mail form you Gmail Acount through your Application
Hi
A few days back I wanted to send my mails using the Gmail Account. The problem was that I wanted to automate the system and send mail from my Gmail Account through my Application. For this purpose I wrote a class that would send mail from Gmail Account. Here is the class that I wrote for sending the mail from Gmail.

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Mail;

Continued...

How to add Atlas controls to you toolbox and getting started with them Video
Of  late a lot of people have asked how to add Atlas control to the toolbox. These are 2 good video's that I found that shows exactly how to add Atlas controls to your toolbox and getting started with it.
Hope this Helps
Thanks
Vikram

Uploading large files in ASP.NET 2.0 gives a DNS Error

File upload has some big problem in asp.net 2.0 If you try to upload some file of more than 4 mb you will get and error. This is the default file size limit of dot net. This is defined in Machine.config. You can overwrite this in web.config. Like this

<System.Web>
<httpRuntime maxRequestLength="10000" />
</System.Web>

Continued...

Deleting Directory In asp.net 2.0 will make you loose all your session data

Have you tried to delete a directory programmatically in ASP.Net 2.0? Don’t try it; it can cause great problems to your site especially if you are using in-proc session. You will lose the entire session variable after deleting the directory and there is no way of getting those session variable back. This system is a change from asp.net 1.X.

I came to know about this the hard way. I was working on a project were project submission was a process of 6 pages (All in one page using the MultiView control). In the last stem I was supposed to delete the entire directory which was created during the process. Strangely I was loosing all the session values when the directories were deleted.

Continued...

How To make Visual studio work faster
Hi

In case you have observed any slowness in your source view around typing or arrowing through code, here are a few tips that may help.
  1. Turn off background HTML validation. Go to Tools / Options and select Text Editor / HTML / Validation in the tree view on the left side. Uncheck the Show Errors check box.
  2. Turn off AutoRecover. Go to Tools / Options and select Environment / AutoRecover in the tree view.  Uncheck the Save AutoRecover check box.
  3. Close your property grid (View / Properties Window)
Thanks
Vikram

Spell checker add-on in the Visual Studio
Hi

I found this great blog ablout a new add-on in ASP.NET.
Mikhail Arkhipov has developed a spell checker add-in to Visual Studio 2005 that allows you to spell check the contents of your ASP.NET or HTML page in HTML view.
For this to work all you need to have Office 2003 installed on your machine

See http://blogs.msdn.com/mikhailarkhipov/archive/2006/04/17/577471.aspx for details including install location.Try it out today and let me know what you think.

Thanks
Vikram

Increasing the functionality of the validators to give it more flexibility
Hi

Recently I had to customize the appearance of the attached control of a validator during an error situation on the server or the client side, or even call a custom client function without postback. I first lookod around to find if we get some custom control for this. I came across various controls. And then I found this Article which was excatly what I was looking for.

Thanks to Alexander Kleshchevnikov.

The Article talks about enhancing the .net Validation Control.

This is a very good piece of work by Alexander.

Thanks
Vikram

Problem using the Atlas Drag extender in IE
Hi

I am using Atlas control toolkit and found this big problem with Drag panel.

I was trying to use the Drag Panel in one of my page which also contains some drop down lists. When I Drag the drag panel on the dropdownlist (I am using IE) I see the dropdownlist above the drag panel.

This behaviour is only taking place in IE and not in firefox. I do not know the real reason of this problem but this is making life difficult for me.

Does any one know how to solve this problem?

Thanks
Vikram
 
Copyright © 2006 - 2010 Vikram Lakhotia