Let’s say we have a case where we need to create mouseover / mouseout functionality for a list which will be dynamically filled with data on client-side. We can use jQuery hover function, which handles the mouseover and mouseout events with two functions. See the following example: <!DOCTYPE html> <html lang="en"> <head runat="server"> <title>jQuery Mouseover / Mo...
Few days ago Microsoft has released the Sample Browser v2 of Microsoft All-In-One Code Framework. This is excellent news since it contains tons of samples, including samples for asp.net framework. You can read more about this on the following blog post . Download link (About 48mb ZIP): http://1code.codeplex.com/releases/view/60475#DownloadId=205912 . After you download, unzip it and doub...
As we already know, Razor is maybe the best view engine for ASP.NET MVC so far. It keeps your code fluid and very expressive. Besides the other functionalities Razor has, it also supports writing local functions. If you want to write a function, you can’t just open new @{ } razor block and write it there… it won’t work. Instead, you should specify @functions { } so that inside the bracke...
There are several view engines you can use with ASP.NET MVC: ASPX Razor Spark NHaml etc… Also, you can create your own View Engine . From the listed view engines, I have tried the first three up to now. All these have their pros and cons, but from all of them Razor is definitely the one which makes your code clearer comparing to the other two and it looks more flexible, very expressive a...
If you want to find the date time difference between two dates, the best way would be to use TimeSpan class. Take a look at the following simple example: //difference with DateTime.Now (now its 2011-02-02 00:40); string firstDate = "2011-01-05 09:18:55"; TimeSpan ts = new TimeSpan(); ts = DateTime.Now.Subtract(Convert.ToDateTime(firstDate)); Response.Write("The difference is: " + ts.Days...
Are you working with jQuery on a daily basis? If yes, then it is nice idea to have cheat sheet that will help you speed up the development process as well as the quality of code. Here is the jQuery Cheat Sheet I often use You can see the original version here . Download jQuery 1.4.4 API Cheat Sheet as PDF Download jQuery 1.4.4 API Cheat Sheet as PNG image
When working with themes, in most of the cases we set the default theme in Web.config <pages theme="Default"> ... </pages> However, this means that all pages in our site will use this theme. Today, I was working on solving an issue with some jQuery UI tabs content navigation which loads other ASPX pages. In the other ASPX pages I have some operations which decide what content...
Hi all... Today I was testing the ThemeRoller in the jQuery UI and have noticed that while I was testing the TR, they have updated the jQuery UI version to 1.8.9. With this version, there are some bug fixes in few jQuery UI controls. You also have the new version of jQuery UI scripts available in the Microsoft CDN (Content Delivery Network) Uncompressed: http://ajax.aspnetcdn.com/ajax/jq...
I recently found the Entity Framework FAQ website so I thought it would be great to share it with you. The website contains everything you need to learn about EF. Here is the list of categories you can find in their site: Introduction Architecture and Patterns ObjectContext Connections and Transactions Conceptual Model (EDM) Mapping and Modeling Querying Entity Classes Relationships Enti...
I would like to say HAPPY NEW YEAR 2011 TO ALL CODEASP.NET COMMUNITY MEMBERS AND VISITORS! I'm glad that I'm part of this great community and I hope we will work hard in the year ahead to achieve new goals and make the community grow as much as possible! I will look forward to continue posting blogs for the latest MS technologies especially regarding ASP.NET Web Development platform. If ...
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...
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 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 ...
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
In the previous two ( first , second ) blogs I've shown how to use the Data Linking jQuery plugin which was created by Microsoft. In one of the blogs I've shown how you can map the data to some custom named fields in your jQuery object variable. Except linking, you can also unlink the already linked data. How to do that? See the following example: var person = {}; //empty person $("#myFo...
In the previous blog you've seen how to use data linking in the simplest way. Now lets assume I want to map the names of the form to some other names in my javascript object. So, we have the following form in our HTML/ASPX <form id="myForm"> First Name <input id="firstName" type="text" /><br /> Last Name <input id="lastName" type="text" /><br /> </form>...
jQuery Data Linking plugin is one of the three plugins that is created by Microsoft as a direct contribution to the jQuery project. With Data Linking, we can easily link the existing forms in our ASP.NET Website to the javascript object variable. Lets suppose we have one form with the following input fields <form id="myForm"> First Name <input id="firstName" type="text" /> &l...
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 ...
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