In this blog I will show how to get querystring params values with jQuery. You must be familiar with getting params values in ASP.NET server side code but how to get it via jQuery? For this I have used REGEX to fetch the querystring param value based on param key. I have extended the jQuery function and made a getParamValue function for this purpose. Below is the code for plugin. $.exten...
I have seen this question many times on how to set focus on first textbox of the page. I decided to write a blog on this. Below I have given the complete sample code where the cursor will be placed on first textbox when the page loads. <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script type="text/javascript" src...
In this blog I will show how to clear dropdown list with jQuery . Today I saw a person was asking on forums on how to remove all the items of dropdown list with jQuery. I decided to write a blog on this. Below is the sample code for it: <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script type="text/javascript" sr...
In this blog how to disable right click with jQuery. I saw today, a person was asking on forums on how to stop right click on web page, I decided to write a quick blog on it. Whenever right click is occurred the contextmenu event fires and we can prevent the default action of that event in order to disable the right click. Below is the complete sample code: <html xmlns="http://www.w3....
In this blog I will show how to show word count of the textbox with jQuery. A person asked me on the forums on how to show the word count , I decided to write a quick blog on this. The logic for getting the count is simple. We will split the text of textbox on the basis of empty spaces in it and on the basis of that we will get the count. Below is the sample code for it: <html xmlns="...
In this blog I will show how to set default tab for jQuery UI tabs. You must be aware of that by default the first tab is opened for jQuery UI tabs. If we want that instead of first tab some other tab should open, we have to set the selected property of tabs plugin with the index of that tab which we want to open by default. Below is the complete sample code for it: <html xmlns="http:...
In the past two months, I’ve had chance to test the capabilities and features of the amazing NDepend tool designed to help you make your .NET code better, more beautiful and achieve high code quality. In other words, this tool will definitely help you harmonize your code. I mean, you’ve probably heard about Chaos Theory. Experienced developers and architects are already advocates of the ...
In the previous days, I wrote several blog posts related to the great jQuery Templates plugin showing various examples that might help you get started working with the plugin in ASP.NET and VS.NET environment. Here is the list of all five blogs: Introduction to jQuery Templates jQuery Templates - tmpl(), template() and tmplItem() jQuery Templates - {Supported Tags} jQuery Templates with ...
In the asp.net forums one user asked how to get Web.config's connection string value when using LINQ2SQL which is created inside another Class library project. We know that if you use the System.Configuration classes, you will access the web.config from the application. Therefor, the first thing needed here is to reference the System.Configuration.dll inside the class library project (wh...
Recently a coworker had a problem. "He wanted to have a button on the Master Page with which to select the button invokes a function that is within the ContentPlaceHolder " Steps : Create a Master Page Master Code using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.Web...
Today I was in a need to escape single quotes in a string in JavaScript. When we write strings in JavaScript, we have two options either we can write them in single quotes or in double quotes. We should not mix them by starting with one of them and ending with the other option. We can write strings in this way var foo = 'this is test'; var foo = "this is test"; Now the issue comes when w...
If you have Skype of version 4.2 or greater, you will be facing the issue of how to hide or remove the Skype icon from the task bar when you have closed the main window. In previous versions of Skype, for example Skype 4.1, 4.0 and 3.0, when the main window was closed, Skype was minimized to system tray (notification area which is adjacent to clock on Windows Taskbar). But in newer versi...
The JSON (JavaScript Object Notation) data-interchange format is becoming very popular because it's lightweight and it can be easily serialized into HTML, especially using jQuery Templates. In real-world scenarios, the data usualy comes from databases. Using ASP.NET with jQuery, you can make ajax requests easy. When using ASP.NET Webforms, to make one method available to work with ajax r...
JsonResult Class is a type of class that is used to send JSON-formatted content to the response. This class belongs to the System.Web.Mvc namespace so that it's part of the ASP.NET MVC Framework. The JsonResult class inherits from ActionResult. JsonResult class has the following members: - JsonResult constructors which initializes new object of the class - ExecuteResult method - method t...
In this blog I will show you how to open or display jQuery datepicker on image's click instead of focus on the textbox. To accomplish it I have used the showOn property of the jQuery datepicker and set it to 'button' to make that happen. The src of the image is set via buttonImage property. Below is the sample code: <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" ru...
In ASP.NET MVC 3 - Release Candidate 2, the jQuery UI library is added together with the ASP.NET MVC 3 application project you are going to create. Besides this, the newest version of jQuery library is also shipped (currently v1.4.4). This is great since we see that Microsoft also supports the jQuery UI project too. One thing that misses for now is to include the jQuery UI CSS Styles and...
I've just read a blog post by Scott Guthrie announcing the ASP.NET MVC 3 - Release Candidate 2, where he has listed many interesting features that this RC 2 includes. As he says, this is the near-final release of ASP.NET MVC 3. You can read the complete blog post here .
Everyone develops his own style of writing code, approaching problems that come up in our daily coding life, but is everyone following a concrete coding standards set by the organization, the company where he works? In the company where I've started working about one month ago, there are very good defined coding standards that help teams share their code and understand other developer's ...
Normal 0 false false false MicrosoftInternetExplorer4 In this blog, I will share few useful developer tools for client side scripting . I believe any little help is very helpful in programming . Here is the list of developer tools: JSFIDDLE : Great tool to test JS/JQuery/YUI etc , this is online tool which mean you don’t need to open VS or need VS in your system to test / make code snipp...
Normal 0 false false false MicrosoftInternetExplorer4 In my recent project, client demanded that confirm button text should be ‘Yes’ and ‘No’ instead of ‘O’ and cancel. I have gone through many forums posts amd tried out many things to to change text of JS Confrim box button but didn’t succeed.Even tried vbscript ( Stackoverflow : Javscript Confirm ) , but it didn’t work in FF and Chrome...
In this blog I will show how to install ASP.NET membership database on SQL Server. We are going to use the ASP.NET SQL Server Registration tool (Aspnet_regsql.exe) to create ASP.NET membership database. The Aspnet_regsql.exe file is located in the [drive:]\%windir%\Microsoft.NET\Framework\version folder on your Web server. For my case it was at following path C:\WINDOWS\Microsoft.NET\Fra...
In this blog I will show how to convert the JSON date (returned from .NET server side) to JavaScript date. This is one of the most common requirement while dealing with dates returned from ASP.Net AJAX. The dates returned from server side are in this format /Date(milliseconds)/ . Below is the screenshot showing how dates are returned via ASP.NET ajax from server side: Our goal is to conv...
It is interesting that today Scott Guthrie wrote a blog post announcing the Silverlight 5. All Silverlight developers should be exited since the new version of Silverlight adds significiant new features and capabilities. More about this you can read at Scott Guthrie's blog post, link: http://weblogs.asp.net/scottgu/archive/2010/12/02/announcing-silverlight-5.aspx
Introduction The aim of the article is to demonstrate how using asynchronous calls made using the jQuery library can maintain an active Session on the server indefinitely without it expires at a time. Maintain Active Session Asp.net Session expire a user when a prolonged period would indicate that no longer is using the page, but sometimes it is necessary to allow the user to take severa...
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