Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

The name "UserName" is not permitted in this context. Valid expressions are constants, constant expressions…

with one comment

I got above error while doing following thing in a hurry. I could not find at first look that it is not valid.


Now, the problem is simple but could not find it at first look. I used double quotes “ instead of single quote ‘.

Replaced it and gone 🙂 Thought, i should share 😉


Written by Manish

June 10, 2010 at 5:29 pm

Posted in .NET, .NET 3.0

One Response

Subscribe to comments with RSS.

  1. Got same error, but with me using double quotes. Tried using single quote when I read this and it works! 😀

    jao me

    November 19, 2011 at 9:31 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: