Rahul Soni's blog

Never assume the obvious is true!

Browse by Tags

Tagged Content List
  • Blog Post: ASP.NET:How to write error messages into a text file using a simple httpModule

    In one of my previous posts , I mentioned about how to troubleshoot some issues with the use of a module. In this post, I will show you how a similar module could be of use when you want to log all the errors in a text file for troubleshooting purposes. Please ensure that C:\Temp folder has Write access...
  • Blog Post: Run a batch file as a specific User (or Administrator) from ASP.NET...

    ...well first of all, I am NOT recommending it, but sometimes it could be necessary! Now, let's proceed to the code... 1. Create a page called RunBatchFile.vb and paste the following... Imports System.Diagnostics Imports System.IO Partial Class RunBatchFile Inherits System.Web.UI.Page Dim _password...
  • Blog Post: AJAXControl Toolkit issue in VS 2008

    When I tried opening the AjaxControlToolkit.sln by double clicking on it, it was throwing the following error at me... --------------------------- Microsoft Visual Studio --------------------------- The application for project 'H:\Downloads\AjaxControlToolkit\SampleWebSite' is not installed. Make sure...
  • Blog Post: Error while Publishing from Visual Studio 2005

    Problem Description Issues when you try to Publish your website from Visual Studio 2005. It might happen if you create a File System project called <someName> and while publishing you use the same name in IIS. To reproduce this issue, create a simple File System based solution... Go...
  • Blog Post: Sample page in ASP.NET to show you different collections like Forms, Querystring, Cookies etc

    Sometimes, while troubleshooting I am interested to find out all the details about certain collections in ASP.NET, like Forms, QueryStrings, Headers, ServerVariables, Cookies, Sessions and Params... I created a very simple aspx page which would show you all the details... Create any text file with .aspx...
  • Blog Post: Changing ASP.NET version in ASP.NET tab of IIS has no effect

    I ran into another similar issue while playing around and thought I must share... By default, when you open IIS Manager, right click on any Virtual Directory and click on Properties it would show the following dialog box. Note that, I have activated the ASP.NET tab and the ASP.NET Version is showing...
  • Blog Post: customErrors defaultRedirect is not redirecting in ASP.NET

    In one of my projects I was trying to use customErrors in ASP.NET and it was not working as I would expect. In the web.config I had the following... <customErrors defaultRedirect="~/Misc/ErrorPage.aspx" mode="On"> <error statusCode="404" redirect="~/Misc/ErrorPage.aspx" /> </customErrors>...
  • Blog Post: Troubleshooting Session Related Issues in ASP.NET

    In this article I have discussed some of the common reasons for session loss issues in ASP.NET. I have also discussed about how you should think of fixing these issues yourself in a logical way. http://aspalliance.com/1182_Troubleshooting_Session_Related_Issues_in_ASPNET Hope this helps! Rahul...
  • Blog Post: A sample aspx page to show the security details

    This is a pretty small sample to help you figure out the ASP.NET identity matrix and how it comes in effect. I am posting this since quite often we need to troubleshoot security related issues on a production website and making any Application level changes become really difficult. What you can do...
  • Blog Post: Customize errors which are not captured by customErrors in ASP.NET 2.0

    Yesterday, I came up with an interesting issue where a customer wanted to customize a 500 error message ("Internal Server Error"). Interestingly, customErrors DID NOT seem to work for StatusCode 500! We just wanted to verify if it works for 404, and it did... < customErrors defaultRedirect = "...
  • Blog Post: Yippee!! VS 2005 SP 1 is available now... Finally!!! :)

    I am so happy to see the Visual Studio 2005 Service Pack 1 (SP1) being released (finally)! Know more about it here ! I am too excited to write more :-) Click, Install, Enjoy!!! -Rahul
  • Blog Post: Unable to build any application in a VS 2005 Application

    Here is an interesting issue which I found today. One of my customers was working with VS 2005 and found that he was unable to build any application at all! Even a newly created Application with a single page failed! The error message didn't lead me anywhere since it didn't have any description. In the...
  • Blog Post: CS0030: Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

    Another issue which I found really interesting... We had an ASP.NET 2.0 application and in one of the pages (called Login.aspx) we used the Login control. It worked beautifully from the IDE (F5 or CTRL+F5), but when we deployed it on the webserver (precompiled), it showed the following error. Compiler...
  • Blog Post: ASPCOMPAT related issue in ASP.NET 2.0

    Recently, I saw a very interesting issue. Thought, I must share... There were two pages in an application. In the 2nd one (page2.aspx), aspcompat was equal to true . In the first one, we did something with a lot of objects, "stored it in the session", went to page2.aspx and splat!! The following error...
  • Blog Post: Health Monitoring for Application's Lifetime related events in ASP.NET 2.0

    The runtime components and controls of ASP.NET 2.0 are instrumented for health monitoring they and raise events for many common situations For ex. failed logins, unhandled exceptions, expired forms authentication tickets, etc . For complete details please visit http://msdn.microsoft.com/library/default...
  • Blog Post: Unable to change the DisplayMode of a WebPartManager

    I had an issue where I was changing a WebPartManger's displaymode using the following code... WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode or WebPartManager1.DisplayMode = WebPartManager.EditDisplayMode I didn't use SQL Express for my database. Instead I was using my Web.config...
  • Blog Post: How to use SQL Server in ASP.NET 2.0, if you don't have SQL Express for VS 2005

    I don't have the SQL Express on my box and I still want to use database for my ASP.NET 2.0 application. Here is what I do to configure each of my application to use the MS SQL 2000. 1) Go to the the Visual Studio 2005 command prompt OR a regular command prompt and navigate to C:\< WINDOWS >...
  • Blog Post: 4 ways to send a PDF file to the IE Client in ASP.NET 2.0

    In this pick, I am sharing a project using which you can send PDF files to the IE Client in four different ways. You may download the project by clicking here . Create a new C# Website. While creating the following pages ensure that you DON'T have "Place code in Seperate file" checkbox as checked...
  • Blog Post: Dynamically adding webparts to the dynamically added Catalog zone

    Today we are going to discuss how to add webparts to a Catalog Zone dynamically in your webpage. Sometimes, you may have quite a lot of different webparts which you don't want to add by default to any page. Instead, you want to design an interface where you have added everything into your catalog...
  • Blog Post: ASP.NET 2.0 New Multimedia and MSDN Webcasts

    Visit the following link if you are new to ASP.NET 2.0 or want to familiarize yourself with some of the brand new stuff in 2.0. http://msdn.microsoft.com/asp.net/learning/learn/newtodevelopment/default.aspx Don't forget to visit the following walkthrough and quickstarts. The ones which begin with...
  • Blog Post: How to use Web Site Administration Tool without installing VS 2005

    Hello everyone!! This one is a tweak to ensure that you are able to Administer your ASP.NET 2.0 web-site *without* installing Visual Studio 2005 on your IIS Server. For that, you would need Framework 2.0 installed on your Server. If you don't have it, please install it from http://msdn.microsoft.com...
  • Blog Post: DataFormatString of GridView control is not working and the columns don't get formatted

    Recently, I found an issue with the Gridview control. I was adding some formatted columns and no matter how much I tried it wouldn't show up as expected. Similar code seems to work fine in Datagrid of VS 2003. One of the columns which I had was supposed to use the following formatting "{0:#,###}" and...
  • Blog Post: Dynamic GridView Series - 2.Formatting Columns dynamically

    Requirement 2 ============= Give the Datagrid a decent User Interface with Appropriate Headers and Formatted Columns created dynamically. Let's create a new ASP.NET Web site. Add the following lines just after your <configuration> tag in the web.config. I will be working with the "pubs" database...
  • Blog Post: Dynamic GridView Series - 1.Simple Gridview Binding at runtime

    Requirement 1 =========== We need to bind the data dynamically to the GridView of ASP.NET 2.0 Let's create a new ASP.NET Web site. Add the following lines just after your <configuration> tag in the web.config. I will be working with the "pubs" database all the time. Better to have it in the...
  • Blog Post: GridView:Access GridView's Row Items information from the Button Click Event in ASP.NET 2.0

    Requirement 1 ============= You have a GridView in ASP.NET 2.0 and you want to read the row whenever the Button of that row is clicked. Additionaly, you want to pass the key information to a different page, where you are supposed to show the details. Download the attached project and find all the...
Page 1 of 2 (26 items) 12