Today I was in a need where I had to get the filename without extension from a path. I decided to write a blog on what I did to extract that. I used Path.GetFileNameWithoutExtension Method (System.IO). This method returns the name of the file of specified path without the extension. Below is the complete sample code on how to use it: using System; using System.IO; namespace MyConsole { c...
In this blog I am going to show how to get date difference in days in JavaScript. I have seen this question asked many times on the forums so below is the quick sample code for the same. Below I have extracted the number of milliseconds between two dates and divided that with the number of milliseconds of per day. <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"&...
In this I am going to show how to show iframe in full screen or full page. A persone asked me on the forums on how to show the iframe covering the whole screen i.e 100 % height. I decided to write a quick blog on the solution which I gave to him. Below is the code for it: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...
Today a person asked on the forums on how to disable ASP.NET LinkButton using jQuery. Thinking this, it seems that it would be just as simple as like disabling other controls. But it is not the same, we need to do a little bit more. Below is the sample code for it: <head id="Head1" runat="server"> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jque...
I saw a person asking on forums on how to disable all the input fields on a form with jQuery. I decided to write a blog on this. User will click a button and all the input feilds of the form will get disabled. Below is the code for it: <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd...
In this blog I will show how to open jQuery UI Dialog from codebehind. I saw this question asked on the forums. I decided to write a quick blog on it. Basically what we are going to do is render the neccessary JS code for UI dialog from codebehind and when the page will render, it will show the dialog. Below is the code for it: <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-/...
Today a person asked on the forums on how to expand or collapse all the nodes of ASP.NET TreeView control with jQuery. I decided to write a quick blog on this. In this blog I will take an ASP.NET TreeView Control and a link to exand/collapse all the nodes of the tree. User will click on the link and accordingly nodes will be expanded/collapsed. Below is the complete sample code for the s...
If your codeblock contains unsafe keyword, means you are having unsafe code probably because dealing with pointers or unmanaged assemblies and you are getting the following compilation error "Unsafe code may only appear if compiling with /unsafe", this blog will help you. For the unsafe code the project needs to compiled with /unsafe mode. To turn on the unsafe mode on. Go to the project...
I was using the FB API on my website and I noticed that FB login was not working on it. After looking the in the Firebug's Console tab I found that FB.getLoginStatus() called before calling FB.init() message was coming. Then I decided to look for that message in the http://connect.facebook.net/en_US/all.js JS file used by the FB API. Below is the screenshot for it: i.e when API KEY is no...
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address:
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18