A good product would be used because it is good
I have seen a lot of advertisement about products that don't function correctly and I quit them so early. I am a gamer and I have to wash my eyes after looking at the Facebook ads. There is no way I am giving your Facebook game a chance. I played mafia wars and I already know what those free to play games are. If you want to get a good following then spend the money on improving the product or the model you are using. I have used many products that were reccomended to me by my friend. I have used dropbox for one reason. It is awesome. It solves a problem and I will share my dropbox with my friends. Not because it is good, but because I care about my friends and I want them to use a good. WE WANT TO USE YOUR PRODUCTS BECAUSE THEY ARE GOOD.Friday, October 5, 2012
Monday, September 24, 2012
Reading Information from a webconfig file in asp.net
Every once in a while, we would like to keep some of the application settings in a web config file to handle tasks like Database location and file location. Here is a quick way too read from a Web.config file
<!-- Somewhere in the web.config fole -->
<appSettings>
<add key="NameOfTheKey" value="Value"/>
<add key="FooKey" value="\\folder\Shared Documents"/>
</appSettings>
Here is how to get the file in C#
string location = WebConfigurationManager.AppSettings["NameOfTheKey"]; //location will be "Value"
Hope that helps
A Web Afternoon - Notes
I went to a (surprisingly) fun event last weekend. The best way to describe it is it is a series of TED videos all talking about the web (with great cake and coffee in the back of the room). Hopefully, you can follow these amazing speakers and get caught up on what you missed. I highly recommend going to the future A Web Afternoon events.
below are some of the quotes that I was able to doodle down (I really have no idea how to summarize this). I am sorry if I am misrepresenting any of the sessions or misquoting anyone.
===
Speaker: Jensen Inman
Contact: @edae
Topic:Be Awesome
"if you find yourself smiling and excited about what you are talking about then that is the thing you should do"
"Compare shoes.. if you are all wearing the same shoes then you are hanging out with the same people"
===
Speaker: Igor
Contact:
Topic: Yap Story - story of a start up
David vs gollaiath.
"to keep up, you will find yourself spending 8 hours to keep up, and 8 hours to surpress"
Koala bottle (using a cute descriptive name can help)
yoko onno apple in the art exhibit
===
below are some of the quotes that I was able to doodle down (I really have no idea how to summarize this). I am sorry if I am misrepresenting any of the sessions or misquoting anyone.
===
Speaker: Jensen Inman
Contact: @edae
Topic:Be Awesome
"if you find yourself smiling and excited about what you are talking about then that is the thing you should do"
"Compare shoes.. if you are all wearing the same shoes then you are hanging out with the same people"
===
Speaker: Igor
Contact:
Topic: Yap Story - story of a start up
David vs gollaiath.
"to keep up, you will find yourself spending 8 hours to keep up, and 8 hours to surpress"
Koala bottle (using a cute descriptive name can help)
yoko onno apple in the art exhibit
===
Speaker: Todd Moy
Contact: @toddmoy
Topic: ..magic
"I can't do magic, I can help you see it"
user experience is the intercention between the user's mental model and interaction and the Designer's system.
-A Beautiful Lie:
"fiiction can be more compelling than truth"
examples:
Turbo tax and the "analysing your taxis status loading bar"
Gmail "recall" feature delaying the email for a couple of seconds.
- Slight of hand
"work while they are distracted"
red paper heart (I don't remember why I wrote that)
===
Speaker: Doc Waller
Contact: :@docWaller
Topic: The power of words
I am having a hard time writing about this session. It was mind blowing and made me think about a lot of stuff. I found myself day dreaming and relating to every word.
"Transparency is sexy"
"Less ____ More Layman"
"Pinocchio had a rock bottom"
"Power words vs word with power"
"The Champ is here"
http://www.shopliftwindchimes.com/compliment.html
===
Speaker: Josh yolkert
Contact: @Skookum
Topic: Destruction
build -> fix -> integrate
"We are ____ shop" will die
===
I think I will stop here for now. I have 4 more pages of notes and it is getting really late
More info could be found here.
http://webafternoon.com
Contact: @toddmoy
Topic: ..magic
"I can't do magic, I can help you see it"
user experience is the intercention between the user's mental model and interaction and the Designer's system.
-A Beautiful Lie:
"fiiction can be more compelling than truth"
examples:
Turbo tax and the "analysing your taxis status loading bar"
Gmail "recall" feature delaying the email for a couple of seconds.
- Slight of hand
"work while they are distracted"
red paper heart (I don't remember why I wrote that)
===
Speaker: Doc Waller
Contact: :@docWaller
Topic: The power of words
I am having a hard time writing about this session. It was mind blowing and made me think about a lot of stuff. I found myself day dreaming and relating to every word.
"Transparency is sexy"
"Less ____ More Layman"
"Pinocchio had a rock bottom"
"Power words vs word with power"
"The Champ is here"
http://www.shopliftwindchimes.com/compliment.html
===
Speaker: Josh yolkert
Contact: @Skookum
Topic: Destruction
build -> fix -> integrate
"We are ____ shop" will die
===
I think I will stop here for now. I have 4 more pages of notes and it is getting really late
More info could be found here.
http://webafternoon.com
Labels:
Charlotte
Razor Helpers
Razor helpers work just like functions in C# and JS. Create a function (and pass parameters to it if needed) and call it to draw the HTML.
Example:
@helper ShowName(string Name)
{
<p> hello @Name <p>
}
and then to use it
ShowName("Ammar")
ShowName("Mike")
The HTML will transplate to
<p> hello Ammar <p>
<p> hello Mike<p>
The output will show:
Hello Ammar
Hello Mike
Example:
@helper ShowName(string Name)
{
<p> hello @Name <p>
}
and then to use it
ShowName("Ammar")
ShowName("Mike")
The HTML will transplate to
<p> hello Ammar <p>
<p> hello Mike<p>
The output will show:
Hello Ammar
Hello Mike
Saturday, September 1, 2012
CSS quick cheat sheet/tutorial
I think it is about time I start building a cheat sheet for myself. Here is a CSS one to cover up all the basics.
How to use a CSS from another file:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
Elements and definition
SELECTOR { PROPERTY: VALUE; PROPERTY:VALUE;}
h1 { Color: BLUE; fontsize:12px;}
Comments:
/*This is how you comment*/
how to apply the style:
in the html line, use style="Color:Blue"
how to write a CSS
something
{
font-Size: 24px;
}
how write a CSS to apply it to what
. means class selector for multiple elements e.g. .RegisterElements. Or you can get p.RegisterElements
# means selects an id e.g. id="item"
How to use a CSS from another file:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
Elements and definition
SELECTOR { PROPERTY: VALUE; PROPERTY:VALUE;}
h1 { Color: BLUE; fontsize:12px;}
Comments:
/*This is how you comment*/
how to apply the style:
in the html line, use style="Color:Blue"
how to write a CSS
something
{
font-Size: 24px;
}
how write a CSS to apply it to what
. means class selector for multiple elements e.g. .RegisterElements. Or you can get p.RegisterElements
# means selects an id e.g. id="item"
Wednesday, June 6, 2012
Validation for MVC ASP.net Razor view
I got stuck with creating the validation for the MVC project and I couldn't find many resources.
There are three steps needed to implement validation in the MVC project:
1. Attribute on the variables
2. HTTP helpers Validation summery and messages on the view
3. Javascript and Jquery libraries
Here is how you implement the validation
1.Attribute on the variables
They are placed on top of the variables stating the limitations on the variables (e.g. has to be a number, too long or short, can't be null..etc).
Here is an example that I used for a variable that can not be over 1024 and is also required.
[Required(ErrorMessage="Value is Required")]
[Display(Name="DialogueSubject")]
[StringLength(maximumLength: 1024, ErrorMessage = "too long")]
public string DialogueSubject { get; set; }
make sure you include using System.ComponentModel.DataAnnotations;
2.HTTP helpers Validation summery and messages on the view
These lines would fire up once a validation error shows up.
At the top of the form I placed the following
@Html.ValidationSummary(true, "Error. See the notification below")
and after each one of the textboxes I placed this line. It would get the error from the attribute and tell the user which rule was violated.
@Html.ValidationMessageFor(m => m.DialogueSubject)
3.Javascript and Jquery libraries
And this was the part that I was stuck on. I didn't include the Jquery libraries. These are the 2 libraries that need to be included:
jquery.validate.unobtrusive.min.js
jquery.validate.min.js
This is what the final result would look like:
And that is it! happy validation
There are three steps needed to implement validation in the MVC project:
1. Attribute on the variables
2. HTTP helpers Validation summery and messages on the view
3. Javascript and Jquery libraries
Here is how you implement the validation
1.Attribute on the variables
They are placed on top of the variables stating the limitations on the variables (e.g. has to be a number, too long or short, can't be null..etc).
Here is an example that I used for a variable that can not be over 1024 and is also required.
[Required(ErrorMessage="Value is Required")]
[Display(Name="DialogueSubject")]
[StringLength(maximumLength: 1024, ErrorMessage = "too long")]
public string DialogueSubject { get; set; }
make sure you include using System.ComponentModel.DataAnnotations;
2.HTTP helpers Validation summery and messages on the view
These lines would fire up once a validation error shows up.
At the top of the form I placed the following
@Html.ValidationSummary(true, "Error. See the notification below")
and after each one of the textboxes I placed this line. It would get the error from the attribute and tell the user which rule was violated.
@Html.ValidationMessageFor(m => m.DialogueSubject)
3.Javascript and Jquery libraries
And this was the part that I was stuck on. I didn't include the Jquery libraries. These are the 2 libraries that need to be included:
jquery.validate.unobtrusive.min.js
jquery.validate.min.js
This is what the final result would look like:
And that is it! happy validation
I need to blog more
I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more I need to blog more
It has been a while now. I need to clean up all of the drafts I made.
It has been a while now. I need to clean up all of the drafts I made.
Subscribe to:
Posts
(
Atom
)
