Powered by Blogger.

Working with enterprise library for data access in asp.net Part-3

To work with enterprise library you have to download required from this URL. Here we will use Enterprise Library 5.0 version. We need to give reference in Bin folder to the following dlls: Microsoft.Practices.EnterpriseLibrary.Common.dll Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll

Asp.Net MVC4 sample application

we will make a sample application using Asp.Net MVC4. Open Visual Studio 2010, then go to File -> New Project. This will open the New Project dialog box. From there make sure .Net Framework 4 is selected. Then select the Visual C# -> Web templates list. From the web template lists, Select ASP.NET MVC 4 Web Application and give a name.

Object Oriented Programming (OOP) concepts in .Net

Mainly there are 3 things in OOPs concept. 1- Inheritance 2- Abstraction 3- Polimorphism Inheritance is one of the key feature of oops concept and C# supports inheritance. Inheritance is a process of deriving the new class from already existing class. It allows you to reuse existing code.

Tutorial on MVVM with WPF

MVVM is nothing but Model view and viewModel.This is the best architecture for WPF. VIEW: A View is defined in XAML and should not have any logic in the code-behind. It binds to the view-model by only using data binding. The View contains the visual controls that will be shown to the user.This is the UI.

WCF tutorial and example in C#.Net

We will discuss how to create a WCF service and how we can consume the WCF service. Open Visual Studio 2010, then go to File -> New -> Project. Then from the New Project dialog box, From the Installed Templates Select WCF from the left hand site, And then Choose WCF Service Library and Give a proper name and Click on OK.

Monday, November 6, 2017

How to call button click event on press enter key in asp.net?

In this asp.net blog we will discuss how we can set default submit button on enter key in asp.net web application. If I will give an real world example, here I have a textbox and a search button. I want to make the search button as default button, so that when user put something in the search textbox and press enter then the button click code should execute.

In some other cases you might noticed that, in most of the modern web sites, there will be a search textbox but there will be no button. User just needs to press enter. Here we will see how we can achieve both the things in asp.net web sites.

Example With Button:
In this case let us take a asp.net button, textbox and one label and it looks like below:

<asp:Label ID="lblResult" runat="server" Text=""></asp:Label><br />
                <asp:TextBox ID="txtSearch" runat="server" Height="30px" Width="280px"></asp:TextBox><br />

                <asp:Button ID="btnSearch" runat="server" Text="Search" Style="display: none" OnClick="btnSearch_Click" />

Now to set the default button here as btnSearch. take an asp.net panel control and set the DefaultButton as btnSearch and the full code looks like below:

<asp:Panel runat="server" DefaultButton="btnSearch">
                <asp:Label ID="lblResult" runat="server" Text=""></asp:Label><br />
                <asp:TextBox ID="txtSearch" runat="server" Height="30px" Width="280px"></asp:TextBox><br />
                <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
            </asp:Panel>

Now when I run the asp.net web site and write something in the search textbox and press enter, it will execute the button click code and will display like below.
asp.net submit button enter key

Example Without Button:
In the other case when we do not need to show the button, we can just use Style="display: none" to hide the button. So the full code will looks like below:

 <asp:Panel runat="server" DefaultButton="btnSearch">
                <asp:Label ID="lblResult" runat="server" Text=""></asp:Label><br />
                <asp:TextBox ID="txtSearch" runat="server" Height="30px" Width="280px"></asp:TextBox><br />
                <asp:Button ID="btnSearch" runat="server" Text="Search" Style="display: none" OnClick="btnSearch_Click" />
            </asp:Panel>

call button click event on press enter key in asp net

Also you can read some asp.net articles:

- Download Programming ASP.NET MVC 5 book pdf free

- How to to show or hide textbox based on checkbox using jQuery in asp.net?

Hope this asp.net article may be will helpful.

Wednesday, November 1, 2017

Download Programming ASP.NET MVC 5 book pdf free

If you want to learn Asp.Net MVC 5 then you can download the Programming ASP.NET MVC 5 book pdf free. This book contains Practical Implementation for beginners.

Also you can download:
- Download asp.net MVC book pdf free

- Download ASP.NET is a web application framework book pdf free
Download Programming ASP.NET MVC 5 book pdf free

1- Getting Started with ASP.NET MVC 5

    1.1 Adding a Controller
    1.2 Adding a View
    1.3 Adding a Model

2- Working with Database

    2.1 Creating Connection String
    2.2 CRUD Operations
    2.3 Working with LocalDB

3- Editing Application

    3.1 Introduction of Code First Migration and Adding new field
    3.2 Searching Panel
    3.3 View Editing
    3.4 Working with Validation

4- Working with External Authentication

    4.1 Configure the Login Options
    4.2 Google and Facebook Authentication
    4.3 Twitter Authentication

5- Entity Framework Database First Approach

    5.1 Working with Existing Database
    5.2 Associating Database with Application
    5.3 Application Modification and Validation

6- IIS Hosting and Publishing of Application

7- Introduction of ASP.NET SignalR

You can download Programming ASP.NET MVC 5 from below link.


Download

Download asp.net MVC book pdf free

If you want to learn asp.net mvc step by step then there is a asp.net mvc free pdf book available from TutorialsPoint.com. This book provides a hands-on approach to the subject with step-by-step program examples that will assist you to learn asp.net mvc.

Also you can download: ASP.NET is a web application framework book pdf free

Here is the content of the book and the download link is available below:

Download asp.net MVC book pdf free
- Asp.Net MVC overview
- Asp.Net MVC - MVC Pattern
- Asp.net MVC - Environment Setup
- Asp.Net MVC - Getting Started
- Asp.Net MVC - Life Cycel
- Asp.Net MVC - Routing
- Asp.Net MVC - Controllers
- Asp.Net MVC - Actions
- Asp.Net MVC - Filters
- Asp.Net MVC - Selectors
- Asp.Net MVC - Views
- Asp.Net MVC - Data Model
- Asp.Net MVC - Helpers
- Asp.Net MVC - Model Binding
- Asp.Net MVC - Databases
- Asp.Net MVC - Validation
- Asp.Net MVC - Security
- Asp.Net MVC - Caching
- Asp.Net MVC - Razor
- Asp.Net MVC - DataAnnotations
- Asp.Net MVC - Nuget Package Management
- Asp.Net MVC - Web API
- Asp.Net MVC - Scaffolding
- Asp.Net MVC - Bootstrap
- Asp.Net MVC - Unit Testing
- Asp.Net MVC - Deployment
- Asp.Net MVC - Self-Hosting

Download from below lnk

Here.

Download ASP.NET is a web application framework book pdf free

If you are a beginners to asp.net and want to learn asp.net step by step then you can read from a asp.net pdf book provided by TutorialsPoint.com.

They have explained clearly step by step and covered almost all the topics of asp.net with C#.Net.

Below are the topics covered in the asp.net book:
- Introduction
- Environment Setup
- Life Cycle
- First Example
- Event Handling
- Server Side
- Server Controls
- HTML Server
- Client Side
- Basic Controls
- Directives
- Managing State
- Validators
- Database Access
- Ado.Net
- File Uploading
- Ad Rotators
- Calendars
- Multi Views
- Panel Controls
- Ajax Controls
- Data Sources
- Data Binding
- Custom Controls
- Personalization
- Error Handling
- Debugging
- Linq
- Security
- Data Caching
- Web Services
- Multithreading
- Configuration
- Deployment

Download from Here.

Saturday, October 28, 2017

How to to show or hide textbox based on checkbox using jQuery in asp.net?

In this post we will discuss how we can show or hide texbox based on checkbox using jQuery in asp.net. Here we have used a textbox, one checkbox. On checkbox checked or unchecked we are going to hide a textbox.

Also you can read:
- Date validation using JavaScript

- Split javascript string

- How to validate user input for mobile number using Regular Expression in Javascript?

Below is the full code:



<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#isCheckBox").on("click", function () {
                if (document.getElementById('isCheckBox').checked) {
                    $("#txtMyTextBox").show();
                } else {
                    $("#txtMyTextBox").hide();
                }
            });
        });
    </script>
    <br />
    <div class="row">
        <div class="col-md-4">
            <input type="checkbox" id="isCheckBox"/> I Agree<br />
            <input type="text" id="txtMyTextBox"/><br />           
        </div>

    </div>

On Check box checked or unchecked the textbox will be show or hidden.

show hide textbox using jquery checkbox

Hope this will be helpful.

How to check if checkbox is checked using jQuery in Asp.Net?

In this post we will discuss how we can check if checkbox is checked or not using jQuery in asp.net.

For this particular example, I have added an input check box and a button, and on the button click we are going to display if the checkbox is checked or not.

Also you can read:
- How to remove particular element from an array using JavaScript in asp.net?

- Data Binding and Graphics in WPF

- WCF tutorial and example in C#.Net



Below is the full code.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnClick").on("click", function () {
                if (document.getElementById('isCheckBox').checked) {
                    alert('Checked')
                } else {
                    alert('Unchecked')
                }
            });
        });
    </script>
    <br />
    <div class="row">
        <div class="col-md-4">
            <input type="checkbox" id="isCheckBox"/> I Agree<br />
            <input type="button" id="btnClick" value="Click Here" /><br />
        </div>
    </div>

Once you click on the button, you can see it will display checked if the checkbox is checked.

Check if checkbox is checked using jQuery

How to remove particular element from an array using JavaScript in asp.net?

Here we will discuss how we can remove particular element from an array using JavaScript in asp.net. We can use the splice function to remove the element.

Also you can check out:
- How to get substring from string using jQuery in asp.net?

- How to open hyperlink in new tab using jQuery or JavaScript?

- How to validate user input for mobile number using Regular Expression in Javascript?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnGetString").on("click", function () {
                var array = [1, 2, 3];
                var index = array.indexOf(2);
                if (index > -1) {
                    array.splice(index, 1);
                }
                alert(array.length);
            });
        });
    </script>
    <br />
    <div class="row">
        <div class="col-md-4">
            <input type="button" id="btnGetString" value="Remove Element From Array" /><br />
        </div>
    </div>

Once you will click on the button, it will show the length like below:

remove particular element from array using JavaScript

Hope this will be helpful.

How to get substring from string using jQuery in asp.net?

Here we will discuss how we can retrieve sub string from string using jQuery in asp.net. We will do this inside an asp.net.

Here we can extract a substring out of string using substring() JavaScript method. Here we will do on a button click.

substring() method will take the start position and number of characters. If the second parameter is not specified then it will return till end.

Also you can read:
- How to get current page URL using jQuery in asp.net?

- Cross-page posting in Asp.Net

- Bind dropdownlist from enum in Asp.Net

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnGetString").on("click", function () {
                var mainString = "This is our main string.";
                var subString = mainString.substring(5, 16);
                alert(subString);
            });
        });
    </script>
    <br />
    <div class="row">
        <div class="col-md-4">
            <input type="button" id="btnGetString" value="Get sub string" /><br />
        </div>

    </div>

Once you click on the button, you can see the result like below:



get substring from string using jQuery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnGetString").on("click", function () {
                var mainString = "This is our main string.";
                var subString = mainString.substring(5);
                alert(subString);
            });
        });
    </script>
    <br />
    <div class="row">
        <div class="col-md-4">
            <input type="button" id="btnGetString" value="Get sub string" /><br />
        </div>

    </div>

Onc you click on the button, you can see the result like below:

asp.net get substring from string using jQuery

Hope this will be helpful.