Zoom Asp.net

ASP.net

KISS, Worse is better !!

by chintan prajapati on Dec.04, 2008, under ASP.net, Google

The Kiss
Image by machado17 via Flickr

Kiss !! no its not that its kiss principle,

means Keep It Simple, Stupid (KISS)

which says that design simplicity should be a key goal and unnecessary complexity should be avoided. It serves as a useful principle in a wide array of disciplines, mainly in software development, because sometimes we end up building something stupid and complex software which is no way usable by actual user and there’s no way we back to redesign whole stuff.

some people also describe it as “Keep It Sweet & Simple”, “Keep It Short & Simple”, and “Keep It Super-Simple”.

New Jersey style

When Utensils Go Bad
Image by nickwheeleroz via Flickr

Worse is better, also called the New Jersey style was conceived by Richard P. Gabriel to describe the dynamics of software acceptance but it has broader application. The phrase is a play on words representing the concept that “quality” is relative. Because of this, something can be “inferior” but still “better”.

For example, to a particular market or user, software that is limited but exceptionally simple to use may be “better” than software that is more comprehensive but harder to use.

You Ain’t Gonna Need It (YAGNI)

In software engineering, YAGNI, short for ‘You Ain’t Gonna Need It’, suggests to programmers that they should not add functionality until it is necessary. Ron Jeffries writes, “Always implement things when you actually need them, never when you just foresee that you need them.
Don’t repeat yourself (DRY)
particularly in computing. The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency. When the DRY principle is applied successfully, a modification of any single element of a system does not change other logically-unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.

Leave a Comment :, , , , more...

Asp.net MVC vs WebForms -Advantage disadvantage

by chintan prajapati on Nov.27, 2008, under ASP.net

Asp.net MVC seems very easy but it’s not because we are used to Webforms.. MVC’s got lots of advantage over Normal Webform style.

like Webform

  • does Postback (which adds unnecessary more than 20 kb of  javascript )
  • has Viewstate (performance issue)
  • has to go through whole page life cycle
  • Uses Event based model

which are stuffs built by microsoft guys to simplify development for VB 6 User which are really not required to make a great site, although i appreciate those thing because it  helps in rapid development.

Where As Asp.net MVC is

  • RESTful architecture
  • Doesn’t Compromise with Performance and flexibility
  • Search Engine Friendly
  • Provides full control over application

drowback of RESTful architecture of ASP.net MVC

  • Any public method in a controller is exposed as a controller action. You need to be careful about this. This means that any public method contained in a controller can be invoked by anyone with access to the Internet by entering the right URL into a browser. e.g. wwwxyz.com/shop/delete/10  will delete shop with ID 10.

Here are few KB articles & resources  that you should not miss

http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework

http://en.wikipedia.org/wiki/Representational_State_Transfer

http://www.asp.net/learn/mvc-videos/

More detail on REST http://www.xfront.com/REST-Web-Services.html

How REST works? -> http://www.intertwingly.net/wiki/pie/RestAspNetExample

Download beta MVC framework http://www.microsoft.com/downloads/details.aspx?FamilyId=A24D1E00-CD35-4F66-BAA0-2362BDDE0766&displaylang=en

Feel free to comment if any doubt

Reblog this post [with Zemanta]
1 Comment :, , , , , , , more...

Share Point server (MOSS) is fun

by chintan prajapati on Oct.03, 2008, under ASP.net

after watching this video it seems share point is really fun.

The SharePoint Song

For beginners nice presentation on share point webpart..

http://media.mindsharp.com/CBT/Lesson%2066%20Webparts/Overview%20of%20Windows%20SharePoint%20Services%20Web%20Parts/player.html

installation of MOSS

Leave a Comment more...

Problem with Sql Parameter which uses IN Keyword with single quote in @parameter

by chintan prajapati on Sep.08, 2008, under ASP.net

it took plenty of time for me to search below article in google.. may be i didn’t get proper keywords to search solution.

http://bytes.com/forum/thread257290.html

here’s solution .. which u can find in above article

DECLARE @codes NVARCHAR(100)
SET @codes = ‘G01,G02′

SELECT * FROM tbRules
WHERE CHARINDEX(rule_code, @codes) > 0

returns the same result set as

SELECT * FROM tbRules
WHERE rule_code IN (’G01′, ‘G02′)

actually above trick is helpful when implementing
lucene search

tags: Sql Server, IN keyword Problem,single quote, “‘”,Lucene.net

Leave a Comment more...

enable disable validation group Client Side using Javascript in asp.net

by chintan prajapati on Mar.10, 2008, under ASP.net, Javascript, ValidationGroup

Recently i faced problem in validating Address Control which basically depends on selection of radio button.below is the figure of problem.

Validation Group Example

Here All controls below Gift to this Address Radiobutton should not fire validation if it is not checked. Asp.net Simply does all validation and shows all errormessage even if Gift to this Address is not selected, so all you have to do is create validation group for left address block called “ADDRESS” by assigning ValidationGroup Property value of “ADDRESS”.

Put this code for Button named “Done”

OnClientClick=”EnableDisableValidation();”

javascript function EnableDisableValidation() looks like below.

function EnableDisableValidation()
{
if($L(’rdbMyAddress’).checked)
{
return Page_ClientValidate(’Address’);
}
else if($L(’rdbAddressGift’).checked)
{
if( Page_ClientValidate())
{ return true;}
else
{ return false;}
}
}

Where $L is replacement of document.getElementById(”);

Page_ClientValidate(’Address’) function Validates All Control having property ValidationGroup =”Address”.

Where as Page_ClientValidate() Blindly validates all validation Controls within page.

I hope now you are clear with idea of customized validation control.

i can share more code with you if still not clear.

feel free to put your comments :)
happy codding :)

4 Comments more...

Fetch Contacts From yahoo using asp.net and c#

by chintan prajapati on Oct.31, 2007, under ASP.net, C#, yahoo

From last many days i was searching for a free script for yahoo contacts importer.. but its freely available only for PHP.
so finally i got a blog post(http://gnillydev.blogspot.com/2007/10/yahoo-contact-import-class-in-c.html) having code to fetch contacts from yahoo. i had implemented it in our project as well i had uploaded it on my website.

You can check this example here
Download Source Code (Asp.net 2.0 , C#)

All Vb.net User can convert their code here

ScreenShot:

If any one having such script for Gmail Please leave a comment.

Please go through all comments for before raising question.

34 Comments more...

Firebug For IE realesed bye DebugBar

by chintan prajapati on Oct.25, 2007, under ASP.net

good news for all web developers is that now thay can debug javascript with a tool called Companion.JS  Developed by http://www.debugbar.com

Download executable @ http://www.my-debugbar.com/wiki/CompanionJS/HomePage

Companion.JS (pronounced Companion dot JS or CJS) is a Javascript debugger for IE.
The current version is 0.2, adding the following features to IE :

  • Detailled javascript error reporting (call stack and real file name where the error occured).
  • “Firebug”-like Console API feature.
  • Javascript console feature useful to inspect javascript objects at runtime.
  • A toolbar icon to open the Companion.JS panel.

Here are some screenshots :


Detailled Error reporting

In the top-left corner the notifying panel which pops-up when an
error occurs in the current page if the Companion.JS panel is not open.
At the bottom of the page…


               
                                        Console API feature

Leave a Comment more...

Google Shared Stuff

by chintan prajapati on Oct.02, 2007, under ASP.net

Google’s social side is more visible every day. A new service called “Shared Stuff” lets you share interesting links with your friends and the entire world. You need to drag a bookmarklet to your browser’s link bar or to click on the “Share” button from a web page (the button can only be found at Google Video right now).


When
you click on the button, a new window pops out and you can choose
between posting the page to your profile, emailing it to your contacts
or bookmarking the page using services like del.icio.us or furl.


A
profile page is public and can include information about yourself, a
photo, links to your sites. You can select the photo from one of your
public Picasa Web Albums. Here’s the profile of Kevin Marks, a former Technorati engineer who now works at Google.


This page lets you see the latest web pages shared by your Gmail contacts:

There’s also a page
that lists all the popular items shared by Google users, but some of
them are questionable (I saw pages that only had a single view):


… and a way to see popular items from a domain or for a tag:


You
can also subscribe to feeds for all of these pages, but it would be
nice to have a special feed for your contacts and gadget that keeps you
up-to-date.

Overall, the service adds the social component to Google Bookmarks
and integrates a lot of ways to share content online. It will be
interesting to see if Google manages to build a community around the
new service and if you can rely on it to find and disseminate what’s
cool on the web. Google will probably allow you to add the “Share”
button to your site so you can replace all the bookmarking/sharing
buttons for del.icio.us, Digg, Facebook etc. and provide a better
experience to your users.

This is probably the first appearance of the Moka-Moka social project
and Google will include shared information from other services (Picasa
Web Albums, public events from your calendar, Google Reader’s shared
items or public Google Docs).

via GoogleBlog
www.storrz.com

Leave a Comment more...

Javascript Validation library For Asp Asp.net and Php

by chintan prajapati on Sep.13, 2007, under ASP.net

For Begginers of web technology this Library is very good. as its Open Source and Perfect validation. LiveValidation is a small open source javascript library built for giving users real-time validation information as they fill out forms. Not only that, but it serves as a sophisticated validation library for any validations you need to make elsewhere in your javascript, it is not just limited to form fields.

The naming conventions and parameters of the validations are similar to those found in the Ruby on Rails framework, and as such is the perfect client-side companion. Don’t worry if you dont use Ruby on Rails though, LiveValidation can be used anywhere you like, is simple to learn, and a joy to use.

Leave a Comment more...

Obfuscation

by admin on Aug.30, 2007, under ASP.net

simply Obfuscation is Confusion resulting from failure to understand MSIL.

One topic I’m often asked about is obfuscation of managed code. In
the context of software, obfuscation is the process of scrambling the
symbols, code, and data of a program to prevent reverse engineering.

Optimizing C++ compilers for native code tend to produce obfuscated
code by default. In the process of optimizing, the code is often
rearranged quite a bit and symbols are stripped from retail builds. In
contrast, managed code compilers (C#, VB.NET, etc) generate IL, not
native assembly code. This IL tends to be consistently structured and
fairly easy to reverse engineer. Most optimization happens when the IL
is JIT-compiled into native code, not during compilation.

This means it’s pretty easy to take a compiled assembly and de-compile it into source code, using a tool such as Reflector.
While this is a non-issue for web scenarios where all the code resides
on the server, it’s a big issue for some client scenarios, especially
ISV applications. These client applications may contain trade secrets
or sensitive information in their algorithms, data structures, or data.
This is where obfuscation tools come in.

Obfuscation tools mangle symbols and rearrange code blocks to foil
decompiling. They also may encrypt strings containing sensitive data.
It’s important to understand that obfuscators (as they exist today)
can’t completely protect your intellectual property. Because the code
is on the client machine, a really determined hacker with lots of time
can study the code and data structures enough to understand what’s
going on. Obfuscators do provide value in raising the bar, however,
defeating most decompiler tools and preventing the casual hacker from
stealing your intellectual property. They can make your code as
difficult to reverse engineer as optimize native code. 

If you’re interested in obfuscation for your code, I recommend
taking a look at one of the third-party obfuscators that work on
managed code. For example, Visual Studio ships with the community edition of Dotfuscator,
a popular obfuscation package. The community edition only mangles
symbol names, so it’s not doing everything the full-featured editions
do, but it will at least give you an idea of how an obfuscator works.
And there are other third-party obfuscators
that work on managed code as well. Keep in mind that obfuscating your
code may make debugging more difficult or impossible. Many of the
third-party obfuscators have features that help with debugging,
however, such as keeping a mapping file from obfuscated symbol names to
original symbol names.

I’m also asked what is Microsoft’s stance on obfuscation? Do we
obfuscate our own code? The answer for the .NET Framework is no. As a
development platform, it makes more sense not to obfuscate, so we
protect our intellectual property by other means. Some Microsoft
products that use managed code have opted to obfuscate, however, so we
do not have a one-size-fits-all approach within the company.

I’d be interested to hear your opinions of or experience with
obfuscation. Were you able to protect your code? What problems did you
run into?

via

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Failed creating file mapping PHP Fatal error: Failed creating file mapping in Unknown on line 0 PHP Fatal error: XCache: Cannot create shm in Unknown on line 0