I am using the follwing code for Input validation in View

HTML Code:
@using (Html.BeginForm("UserSearch", "UserMaintenance", FormMethod.Post, null)){
            Find by User name: 
            <input type="text" id="UserName" name="UserName" value="@Request["UserName"]" />
            @Html.ValidationMessage("UserName","Please enter user name")
            Find by Email: 
            <input type="text" id="Email" name="Email" value="" />              
            <input type="submit" value="Search" />
            @Html.ActionLink("Back to Home", "Index","Home")
But its not working...i wanted to set validation for UserName..
First time trying Input validation...
For setting Validation should we add any new reference to the project?
Help will be highly appreciated...