Skip to main content

Posts

Showing posts from June, 2016

Featured Post

How to use Tabs in ASP.NET CORE

I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component  public class AllViewComponent : ViewComponent     {         private readonly UserManager<ApplicationUser> _userManager;         public AllViewComponent(UserManager<ApplicationUser> userManager)         {             _userManager = userManager;         }         public async Task<IViewComponentResult> InvokeAsync()         {             List<StudentViewModel> allUsers = new List<StudentViewModel>();             var items = await _userManager.Users.ToListAsync();             foreach (var item in items)             {                 allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email });             }            

jQuery Autocomplete List appear onFocus TextBox

In this example i will show you, How to show array list when we focus on TextBox. I mean to say that array list contain users name and its show when we focus on TextBox. Here we have a simple example which is contain list of users name, also i have a autocomplete function in Script library . I have a video , you can check for implementation as well as output. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head>     <title></title>     <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0-rc.2/themes/base/jquery-ui.css">     <script src="//code.jquery.com/jquery-1.11.3.js"></script>     <script src="//code.jquery.com/ui/1.12.0-rc.2/jquery-ui.min.js"></script>     <script>         $(function () {             var users = ['jacob lefore', 'Bill', 'smith wick', 'ammey', 'rodkils', 'BillSmith'];  

How to use FileUpload Control in ASP.NET

Introduction The FileUpload control displays a text box control and a browse button that enable users to browse a file from the local or remote machine to upload it on the Web server. You can upload a file on the Web Server by specifying the full path of the file to be uploaded (for example D:\Myfiles\Test.txt) in the textbox of this control . Alternatively , you can select the file by clicking the browse button , and then locating it in the Choose File dialog box. Top Related article Fileupload control enable disable programmatically in ASP.NET Programmatically change border color of fileupload control in ASP.NET Programmatically change background color of fileupload control in ASP.NET How to validate fileupload control in asp.net also choose selected format How to insert image into database using file upload control Public Properties of the FileUpload Class FileBytes : Obtains an array of the bytes in a file that is specified by using a FileUpload control FileCont

ASP.NET Searching Data using SqlDataSource Control

In this article, i will show you, How to search data from database table using SqlDataSource control. Visual Studio SqlDataSource control have inbuilt many functionality to make dynamic application. By using SqlDataSource control you can do different types of functionality like Sorting, Searching, Insert, Update, Delete data. In this article i will show you an example of searching/filtering data from database table. So first of Design a Database table using Sql Server Explorer. Now, you can take  three tuples in it. I have a Database table schema, you can check. Search Data From Database table using SqlDataSource Control: 1. First to add one TextBox, One Button and a GridView control in a page. 2. By using Show Smart tag you can configure your GridView Control with the database table using SqlDataSource control. 3. When you configure your SqlDataSource control please check the Where clause button. In it you can select Field name, which is used to searching. Operator is &qu

Save and Retrieve Image into database table in ASP.NET MVC

According to my previous article , Which is written in web form. If you are a web form user then try this article. In this article i will show you, How to save image file into database table using ASP.NET MVC, also retrieve image from table to ASP.NET MVC Application. You know that image file saved in the form binary array. So, First to create a table, in which you can take varbinary(max) type field. I will give you an example of simple table. CREATE TABLE [dbo].[Brand] (     [BrandId]    INT             IDENTITY (1, 1) NOT NULL,     [BrandImage] VARBINARY (MAX) NULL,     PRIMARY KEY CLUSTERED ([BrandId] ASC) ); Now, Add a EDMX file to prepare a DataContext as well as model. Now, open a HomeController.cs file to write the code for save file. In this file first to pass model in the view. Add a file control in the view file. @using (Html.BeginForm("AddImage", "Home", FormMethod.Post, new {enctype="multipart/form-data"})) {     @Htm