Wednesday, 19 June 2013

How to create Default Text (SearchBox) in TextBoxes

In this recipe, let's see how to create a search box in ASP.NET with some default information text. The text is displayed only when the search box is out of focus.
Getting ready 1. Add a new web form Recipe1.aspx to the current project.
2. Add a TextBox field with a Search button to the form as below:
3. The CSS class defaultText attached to the TextBox is defined as below:
.defaultText { font-style:italic;
color:#CCCCCC; }
How to do it… 1. In the document.ready() function, retrieve the TextBox control using its ClientID
and save in a local variable:
var searchBox = $('#<%=TextBox1.ClientID%>') ;
2. On the focus event, check if it contains the default text:
searchBox.focus( function() {
if (searchBox.val() == this.title) {
The ToolTip property of the ASP.NET TextBox control is rendered
as title at runtime. Thus, the ToolTip text Enter your search keyword here is retrieved using this.title.
3. If yes, then remove the defaultText css style:searchBox.removeClass("defaultText");
4. Also clear the search field:
searchBox.val("");
} }); 5. On the blur event, check if the TextBox is empty:
searchBox.blur( function() {
if (searchBox.val() == "") {
6. If yes, then attach the "defaultText" css style:
searchBox.addClass("defaultText");
7. Add the default information text to the search field:
searchBox.val(this.title); } });
8. Call the blur event on page load so that the TextBox is initially out of focus:
searchBox.blur();
[code]


    
    
    
    



    
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css"></link>
    <script type="text/javascript">
    $(document).ready(function() {
    var searchBox = $('#<%=TextBox1.ClientID%>');
    searchBox.focus(
    function() {
        if (searchBox.val() == this.title) {
            searchBox.removeClass("defaultText");
            searchBox.val("");
        }
    });
    searchBox.blur(
    function () {
        if (searchBox.val() == "") {
            searchBox.addClass("defaultText");
            searchBox.val(this.title);
        }
    });
searchBox.blur();
});
</script>

</head>
<body>
    <form id="form1" runat="server">
   <div align="center">
    <fieldset style="height: 80px; width: 400px;">
    <asp:textbox cssclass="defaultText" id="TextBox1" runat="server" tooltip="Enter your search keyword here" width="200px"></asp:textbox>
    <asp:button id="btnSubmit" runat="server" text="SEARCH">
    

    </asp:button>
    </fieldset>
</div>
</form>
</body>
</html>
[/code]

Sunday, 9 June 2013

What is Team Foundation Server

                                                   Introduction to TFS
TFS stands for Team Foundation Server which is developed by Microsoft. Integration of TFS with Visual Studio enables a team to work together and organize their efforts to complete a project. Dot Net developers use TFS for source control, bug tracking, requirement gathering and to manage complete life cycle of software development. It has below listed features:-
  1. Communication Enhancement

    TFS enhance the communication among team members by ensuring that no information or work is lost when a team member hand over his task to team. Project of the team is stored on the TFS and every team member has its own credentials to connect to TFS for accessing the project. TFS provides a central location to team project and each team member coordinate his work at this location.
  2. Team Explorer

    All members of a team work together on the team project by using Team Explorer in Visual Studio. Team Explorer connects to the TFS and displays team projects from the server. By using Team Explorer, every team member can get updated work items, projects documents and task to do.
  3. Roles

    Roles can be defined on team project that is on TFS. Each role represents one or more disciplines that are required to successful completion of the team project.
  4. Alerts

    TFS also provides alerts that are sent to team members by e-mail when something has changed on the team project. We can customize alerts on TFS according to our need.
  5. Source Control

    TFS allow the team to manage all source files for a project. We can also add non-source files such as important project documents, project plans etc. to TFS.
  6. Builds

    TFS Build enables the team to create and manage product builds regularly. TFS Build also provides build reports on the status and quality of each build.
  7. Tracking Work Status

    Using TFS project head can track the assigned work status to developers to understand the health of the project.
  8. Work Item History

    All working items are logged on TFS with all changes. Anyone can review the complete history of activity on a work item at any time. The working item history can be exported into Microsoft Excel.
  9. Reports

    Reports related to track status and information (like as work item changes, check-ins and status of product builds etc.) about the project are stored in a database on the TFS.