Loading ...

Who is online?  0 guests and 0 members
home  »  blogs  »  Hajan Selmani

Communifire Blogs

Hajan Selmani : Most Recent postings

Hajan Selmani

Using jQuery Live instead of jQuery Hover function

2/11/2011 by Hajan Selmani · 0 · 4707

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...

Hajan Selmani

Microsoft All-In-One Code Framework "Sample Browser" v2

2/10/2011 by Hajan Selmani · 0 · 1467

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...

Hajan Selmani

Functions inside page using Razor View Engine – ASP.NET MVC

2/5/2011 by Hajan Selmani · 3 · 4451

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...

Hajan Selmani

Razor makes your ASP.NET MVC View look cleaner

2/4/2011 by Hajan Selmani · 2 · 2040

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...

Hajan Selmani

Find the date and time difference with TimeSpan

2/1/2011 by Hajan Selmani · 0 · 1549

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...

Hajan Selmani

jQuery 1.4.4. API Cheat Sheet

2/1/2011 by Hajan Selmani · 0 · 1396

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

Hajan Selmani

Disable themes to certain ASP.NET pages

1/28/2011 by Hajan Selmani · 0 · 1301

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...

Hajan Selmani

jQuery UI 1.8.9 available now

1/21/2011 by Hajan Selmani · 1 · 1083

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...

Hajan Selmani

Entity Framework FAQ Site

1/10/2011 by Hajan Selmani · 0 · 1201

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...

Hajan Selmani

Happy new 2011 year to all in CodeASP.NET Community

1/1/2011 by Hajan Selmani · 0 · 704

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 ...

Hajan Selmani

NDepend tool – Why every developer working with Visual Studio.NET must try it!

12/17/2010 by Hajan Selmani · 0 · 1048

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 ...

Hajan Selmani

jQuery Templates in ASP.NET - Blogs Series

12/16/2010 by Hajan Selmani · 4 · 1578

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 ...

Hajan Selmani

Get Application's Web.config connection string when working with LINQ2SQL created on a Class Library

12/15/2010 by Hajan Selmani · 1 · 1589

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...

Hajan Selmani

Retrieve data from database using ASP.NET MVC and jQuery $.getJSON Method

12/14/2010 by Hajan Selmani · 2 · 7535

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...

Hajan Selmani

JsonResult Class in ASP.NET MVC

12/14/2010 by Hajan Selmani · 0 · 2187

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...

Hajan Selmani

Addition of jQuery UI in ASP.NET MVC 3

12/12/2010 by Hajan Selmani · 0 · 7897

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...

Hajan Selmani

ASP.NET MVC 3 - RC 2

12/11/2010 by Hajan Selmani · 0 · 1103

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 .

Hajan Selmani

Coding standards and why its important to use them

12/9/2010 by Hajan Selmani · 1 · 1280

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 ...

Hajan Selmani

Announcing Silverlight 5

12/2/2010 by Hajan Selmani · 0 · 725

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

Hajan Selmani

jQuery Data Linking - Unlink the linked data object with forms in ASP.NET

11/29/2010 by Hajan Selmani · 0 · 2526

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...

Hajan Selmani

How to make mapping from form to JS object when using Data Linking plugin

11/29/2010 by Hajan Selmani · 0 · 772

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>...

Hajan Selmani

Link form to JS object using jQuery Data Linking Plugin in ASP.NET

11/29/2010 by Hajan Selmani · 0 · 1232

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...

Hajan Selmani

Case-insensitive XPath query search on XML Document in ASP.NET

11/24/2010 by Hajan Selmani · 0 · 1509

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...

Hajan Selmani

Free e-book: Moving to Microsoft Visual Studio 2010

11/18/2010 by Hajan Selmani · 0 · 1349

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...

Hajan Selmani

Working with System.Enum class

11/18/2010 by Hajan Selmani · 0 · 1392

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 ...

Product Spotlight

ASP.NET Hosting Spotlight

Join CodeAsp.Net for FREE Today!

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:

 

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?