Tag Archives: asp.net

What to start with, ASP.NET or PHP?


For further reading, more php and asp.net codes please go to Sanjib’s Scribble
Well, I’d like to write about this in INDIAN context. That is, I presume, you are about to start your journey as a web developer in India, and thinking about learning a web language. Now, keeping this condition in mind, what you’ll do? What will you learn first? And why this but not that?
I’ll keep writing it in several parts. Because I have not enough time and bandwidth in my data card to keep going on for a long journey, but I promise I’d keep it as short as possible.
Before starting I’d apologize for not including Python, Java or Rubi on Rails in my discussion mainly for two reasons.
1) I don’t know them.
2) For dynamic web site, the competition is fierce between these two technology and I have some live experiences about them.
If you are Indian, PHP is the best options for you to start. Not ASP.NET. Why?
Let me write down the reasons first. Next I’ll explain them in detail. I don’t claim, that this is final judgement and won’t suggest you to follow my reasons blindly. What I write, writing from a realistic point of view. You may agree or disagree. Whatever your opinion I’d like to get your comments.
Here are the reasons why PHP is better to start with.
1)Cost effective.
2)Open source.
4)You don’t have to buy any software.
5)A good demand in small or medium company.
6)Takes less time to learn and start with.
7)Compactness and simple integrity with MySql database.(If you can conceptualize array, 50% job has been done!)

Now I’d like to clarify from my experience. One by one.

1) Cost : As a web developer, you’ll find that cost will play a very important role in the future. Whenever, you’d like to contact a hosting company they will always ask more money for a windows hosting which is needed for ASP.NET. For PHP you need Linux hosting that is almost half the amount for the same space and bandwidth. In Windows, it takes more cost because you need to hire an extra SQL Server. In PHP, MySql is in-built. So you need not spend extra dime for it. Form my experience I can say, in Linux hosting there are other advantages or features like blog, wiki, E-Commerce, image gallery projects like wordpress, phpbblog etc. In windows hosting you can not take advantage of such open source frameworks. What ever you want to do in ASP.NET, you have to do single handedly.
Some will argue here, there are many starter kits and open source projects available in ASP.NET also that you can download free from asp.net official site. Then where is the difference?
The difference is in installation process. In ASP.NET you may find some open source projects like blog, wiki etc. But to install them in a separate folder is quite cumbersome. On the contrary, WordPress or PHPBB type projects(run in php and MySql) are ready to install easily and quite user friendly.
So LAMP is not cheap in that sense but cost-effective.
2) Open Source
PHP/MySql is Open Source. If you want to learn more about it, please google it or read Wikipedia. You’ll get more idea about it. Basically it means, it is free, easy to use and there are much more free support from the community in every step. You can also edit the source code that you get from elsewhere.
ASP.NET is more user friendly, no doubt. But, if you want to learn the basic, core ideas on which the passage of data depends, then PHP is the best bet. If you can conceptualize array, then 50% job has been done.
4) You don’t have to buy any software.
To learn PHP/MySql you need not buy any software. This is free and that is why it is so much popular.
5)A good demand in small or medium company.
As the job market is concerned, small or medium level companies opt for free open source softwares. So PHP developers are in demand always.
6)Takes less time to learn and start with.
If you are from a computer background learning PHP is much easier. Logic plays a vital role. If you can follow the logic, how the logic flows, how data transfered from one page to other through array(name=>value) combination, the job has been done.
7)Compactness and simple integrity with MySql database.(If you can conceptualize array, 50% job has been done!)
The best friend of PHP is MySql. They are like Marx and Engels. You may type SQL in your PHP page and get the desired effect in your web page. Also, the hosting companies come with this great combinations so you start with an advantage.



I started this blog mainly with a plan – I’d try to evaluate ASP.NET and PHP, tracing a honest comparison between these two great programming languages.
Frankly speaking when I tried to do my hands dirty with codes, I found that I have still miles to go in PHP specially. I’m still learning ASP.NET, but about PHP I’m still lurking in darkness. So I’d better have a grasp first.
One thing I can say for sure, PHP is easier to pick up and easier to implement.
If you consider The OOP part, Object Oriented part of ASP.NET will take some time to learn and understand and it gets complicated a little bit with newly built classes belong to App_Code folder and calling them into Page class and run methods.
In PHP, just use include method anywhere, either in the class where you’d like to call a function from another class or include in your PHP page.
So OOP seems bit easier to me in PHP than ASP.NET.
I’d like to write more about it later.

How you’ll get your Membership.ValidateUser() to Work


Recently I’ve come across a intriguing question in asp.net forum. One member from Canada asked that his membership.validateuser() method is not working. Actually, what happened, according to him :

Long ago I implemented the Login control on a login page and I thought all was working. Testing has revealed that if you first enter an incorrect password but then next enter the correct password, the Login control fails to log the user in until they enter the correct password a second time. This is unacceptable.

So I began investigating what is wrong and quickly discovered that Membership.ValidateUser(username, password) is failing to return true even though I’m entering the correct credentials. I’ve done much research and discovered that plenty of other developers have experienced the same problem. As of yet, I have not found a solution to my particular problem so I thought I should try seeing if I could get an answer here.

In web.config here is the pertinent info related to Memberships:

If anyone could tell me why they think that Membership.ValidateUser() is consistently failing to work, I’d much appreciate it!

Now I found that, PasswordAttemptWindow is missing in his web.config file. So my answer was :

It probably happened because you’ve not set the PasswordAttemptWindow to some exact time. That is why, I gave you a code to test, in my code it is set to 10.

If you kindly go through what MSDN says about it, you’ll understand why it is locked out no matter what value you’ve set for MaxInvalidPasswordAttempts.

MSDN says:

“The MaxInvalidPasswordAttempts property works in conjunction with the PasswordAttemptWindow property to guard against an unwanted source using repeated attempts to guess the password or password answer of a membership user. If the number of invalid passwords or password answers entered for a membership user is greater than or equal to the value of the MaxInvalidPasswordAttempts property within the number of minutes specified by the PasswordAttemptWindow property, then the user is locked out of the Web site by setting the IsLockedOut property to true until the user is unlocked by a call to the UnlockUser method. If a valid password or password answer is supplied before the value of the MaxInvalidPasswordAttempts property is reached, the counter that tracks the number of invalid attempts is set to zero. Invalid password and password answer attempts are tracked separately. For example, if the MaxInvalidPasswordAttempts property is set to 5, the user has up to five attempts to enter a correct password and up to five attempts to enter a correct password answer without being locked out. The MaxInvalidPasswordAttempts property value is set in the application configuration using the passwordAttemptThreshold attribute of the membership Element (ASP.NET Settings Schema) configuration element. ”

Best of luck.

I would like to share it for many reasons, mostly because, people often get stuck in creating Membership API in ASP.NET forgetting that there are many small, subtle but very important aspects that to be considered.

To get it into detail, you may visit the original post here :
asp.net forum
My Site
PHP/MySql Blogs
PHP/MySql Blogs



HTTP is a communication through text messages from client to server and back using port 80, and when it is secured ie; using port 443, it is secured HTTP (HTTPS).
I’m learning. But I do injustice to this blog site. I should write regularly. I am probably too lazy!
Started a new story : Shankhachurni!
Sent a mail to Scott Hanselman. Would he respond?



I’m really happy with everything that goes around 12reach. I did not expect I would have got a good Googleranking so soon.
Now I’ll be a follower of Vibekananda. “Apekhsha koro dhairyer sathe.(Wait with patience.)”.
In 12reach I used ASP.NET. Basic concepts have been implemented and working fine. Even the SQL SERVER 2005 database is functioning fine.
Hopefully, one day it’ll reach where I dream 12reach to reach.



EDITED….After a certain age(now I am 45+), girls(starting from 25 I did not look under it! Never!), suppose to look at the older guy with a compassionate (not passionate) view.
I can’t say, what they think (not attracted with the grim possibility of burning down of their partners quickly!), but I presume the match ends love less not love all.
I seriously tried to channelize my unbound libido to something creative and started learning ASP.NET. It took almost one and half year (there were few other reasons too) to gain a little bit confidence.
Now I finally launch my ASP.NET site A ready made website and hopefully ending my life a little bit creatively.