Many times, you need to use a relative path (Server.MapPath), but in classes, you can’t use it directly. You need to use the namespace in which it resides.
Every once in a while, it becomes necessary to delete a file in your code. Here is how you do that:
We’ve all seen how websites can look really terrible through the eyes of IE8. But there is hope for the short term, if your ASP.Net website suffers from this malady. You can make an entry in your web.config, so that even if a customer is using IE8 to view your site, it will be forced […]
In the footer of all your pages, do you have a copyright statement, with the year? Are you tired of having to update it every year?
In your code, in order to refer to the root, all you need to do is put “~/” in the front of your path. I’ve seen many people actually use http:// in order to get to the exact page, but it’s not only not necessary, but overkill. Let’s say your file is called myFile.aspx and […]
There are 2 new properties which have been added to the Page class in ASP.Net 4.0 : Keywords Description
If the code in your Source View seems unorganized and unreadable, there is a simple way, in Visual Studio, to format the text into a more readable format. What it actually does, is to create a hierarchical, tabbed view of your HTML. All you need to do is to highlight the text you need reformatted […]
REST (the initials) stand for : Representational State Transfer. REST is a service API which allows you to access services and data from various clients. To do this, you would specify a URL to some item, like a web page with xml in it, and get that item back, via an HTP ‘GET’ request, and […]
The string function ‘EndsWith’ is case-sensitive, even in VB.Net, so if you’re looking for a certain string (maybe the file extension, in a filename), you need to make sure you’re looking for the correct thing, since ‘xls’, with case-sensitivity, is different than ‘XLS’. So, if you’re function is looking for ‘xls’, you must make sure […]
If you already have any kind of button, whether it be a plain button, LinkButton, or Imagebutton, in a TemplateField, within a GridView, you can add ‘Select’ features to it, just as if you had added a ‘Select’ column. All you need to do is add ‘Select’ to the CommandName property. Then, anything you could […]
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF