In this blog I will show you how to set date range for start date and end date with jQuery Datepicker. There is a very common requirement where we need to allow user to select start date and end date but with condition that end date should not be greater than 7 (or n) days than start date. This blog will serve the same purpose. Below is the complete sample: <html xmlns="http://www.w3....
Few days back a person asked on the forums on how to make a common JavaScript function for to add as many number as supplied in the arguments. I decided to write a blog on the solution which I gave to him. In JavaScript what ever arguments you supplied to the function is contained in the "arguments". I just run a loop over all the arguments and calculate the sum. Below is the sample code...
Today a person asked me on how to get the domain name from URL in ASP.NET, I decided to write a blog on the solution which I gave to him. Let's say you have a URL say "http://www.mydomain.com/test/default.aspx" and you want to extract "www.mydomain.com" from it. You can make use of UriInstance.Host property in order to get it. It brings the host component of the current Uri instance. Bel...
Config files are used to configure the initial settings of the application. You can have all the settings like appsettings and connection strings settings in a single web config file. But there is problem with this approach and I would suggest to go with separate files: Why different files and why not to keep them all in single web.config ? You can go simply with this approach but the pr...
Sometimes we need to read XML files that are manually written by users and find some elements in the XML tree. Using .NET library, we can easily navigate throughout the whole XML file since the library has excellent support for working with XML files. One of the challenges you may come across is when you want to search for specific node in the XML file, but you are not sure about the let...
I've just read the Gunnar Peipman 's blog on asp.net weblogs where he has mentioned this e-book . I haven't read the ebook yet, but I will surely take a look inside it in the upcoming weekend. Some links from the ebook webpage provided above You can download a PDF of the book here . You can download an XPS of the book here . And you can download the book’s sample code here . The table of...
Enums are types that provide way to restrict a given variable to one of the fixed set of values defined inside the enum. In most of the cases, enums are very good way to make your code look better and cleaner. Sometimes, we need to fill a dropDownList, CheckBoxList, RadioButtonList or some other control with the defined enum values. Using the System.Enum class, there are methods that we ...
Have you ever come in situation to have lots of 'Using' directives in your code file where you are not sure which can be safely removed or not? VisualStudio.NET enables you to safely organize your 'Usings' in your code file. Here is the simple trick. I have the following directives in my page code-behind file (you may have twice or more especially if you work on some big project dealing ...
Yesterday my teammate had a requirement to show alert to user if he has not selected the option from the dropdown. He had multiple dropdown list controls and wants that user should select each of these dropdown list and alert is to be shown to the user which will tell the user that he should select the option and then the focus should be put on the necessary dropdown list. So I thought t...
In this blog I will show you how to loop through dropdownlist items in ASP.NET. To show it I have posted a sample code below in which I have used a dropdownlist. On page load we will loop though all the items of dropdownlist except the first item (say the default one usually the "Please select" option). Here is the source code: In ASPX: <html xmlns="http://www.w3.org/1999/xhtml"> &...
In this blog I will show you how to delay the execution of jquery functions. There are situations where we need to execute a jquery function after some delay say after n number of seconds. To show it I have posted a sample code below in which I have used a div and a button. On clicking the button first the content of div will be faded in and after 3 seconds (which is the time which I hav...
In this blog I will show you how to manually close a facebox modal. To show it I have posted a sample code below in which I have used a anchor tag to open the modal, a hidden div which will displayed in the form of modal, and input button in this modal to close the modal. Here is the source code: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>&...
In this blog I will show you how to save the content of tinymce textbox in a text file. To show it I have posted a sample code below in which I have used a multiline textbox (which will be the tinymce editor), a button and a label. On clicking the button the content of the tinymce textbox will get saved in the textfile. Here is the source code: <%@ Page Language="C#" ValidateRequest="...
In this blog I will show you how to get the selected index of dropdownlist with jQuery. To show it I have posted a sample code below in which I have used one dropdownlist, a button and a label. On clicking the button the selected item's index of dropdownlist will be displayed in the label. Here is the source code: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"&...
In this blog I will show you how to remove a css class from a control with jQuery. In this example I have used a textbox (which is associated with ".mytextbox" class ) and a button. On clicking the input button the ".mytextbox" class of the textbox will be removed. Below is the source code for it. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> ...
In this blog i will show how to disable and enable checkboxes on the click of other checkbox with javascript . I am explaining it by taking a example where there are three checkboxes . On the click of first checkbox the next two checkboxes will get enabled or disabled depending upon the checked state of first checkbox. Here is the sample code: <html xmlns="http://www.w3.org/1999/xhtml...
Today when I opened my Visual Studio, in Recent Projects list at start up I found that a project which I was working 5 days before was not there, the reason was because I had opened many projects since then in my VS. My VS was showing 5 projects in recent project list so my requirement was to increase the number of recently open projects in visual studio, So I thought I should blog for i...
This is an addition to my series of blog posts on jQuery Mobile: jQuery Mobile Introduction & Tips To Get Started jQuery Mobile Getting Started jQuery Mobile Login Dialog Box So, if you've been following my posts so far, you should have a good overview of jQuery Mobile, it's documentation, how to set up your Visual Studio environment, the structure of a jQuery Mobile page, and how to...
Like I said in my last blog post, jQuery Introduction & Tips , I've been following the development of jQuery mobile for some time now. And now that it's finally been released, I've decided to make some blog posts to help you get started. In today's post, I'm going to show you how to quickly set up your Visual Studio Environment to start using jQuery Mobile. First, you'll want to crea...
Thanks to all attendees, contributors/sponsors, speakers and the organization board, the event ‘ Macedonian Code Camp 2010 ’ held on Saturday, 6th of November in Skopje (Republic of Macedonia) has finished successfully. PHOTO STREAM Here are some facts/numbers related to the conference: 500 attendees 200 streaming sessions 70 prizes 10h recorder presentation materials 1500 photographies ...
I've been closely following the development on the jQuery mobile since it's announcement -- and now that jQuery Mobile 1.0 Alpha 2 has been released, I though it would be a good time to see how things are going to work with ASP.NET. After taking a look through the documentation, I decided to dig in and start creating a mobile site for CodeAsp.Net. After a few hours of tinkering, I've fou...
In this blog I will show how to create a VHD file from an existing hard disk. Virtual hard disk allows multiple OS to exists on a single host machine. It allows the developers to test their programs or softwares on different OS without the hassle of installing the second hard disk or creating an addition partition to do the same. From Wikipedia ( http://en.wikipedia.org/wiki/VHD_(file_fo...
If you are developing an application, you should prepare for exceptions in your application. Exceptions are part of the applications. An exception means an error and it is run time error. In this blog I will explain how to avoid these unwanted exceptions in your applications. Exceptions – As I already told you that exception is not a compile time error. Exception is a run time error. We ...
There are different types of classes in C sharp like Sealed, Abstract, Partial, etc. In this blog I will explain abstract class in C sharp. Abstract class is very useful in C sharp. Below you will learn about Abstract class, Abstract methods and Abstract properties. There is main difference in Abstract class that Abstract class can’t be instantiated. An Abstract class is only a base clas...
In this blog I will show how to convert datetime to date in SQL. I have seen many people asking on forums regarding the same therfore I decided to write a blog on this. The logic of doing is simple, just strip the datetime upto 10 characters and convert it to date string of your desired date format. In this blog I have used 120 as the style of the date. You can get information on these f...
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