Contact Form

Name

Email *

Message *

Saturday, 23 July 2016

Part 2 :- Basics of Asp.Net MVC by Saineshwar Bageri



Different Types of Project Templates in Asp.Net MVC

http://tutlane.com/tutorial/aspnet-mvc/different-types-of-project-templates-in-asp-net-mvc

Folder Structure in Asp.Net MVC Project (Application)

http://tutlane.com/tutorial/aspnet-mvc/folder-structure-in-asp-net-mvc-project-application

How to Create (Add) Controller in Asp.Net MVC Application / Project

http://tutlane.com/tutorial/aspnet-mvc/how-to-create-add-controller-in-asp-net-mvc-application-project

Create (Add) Model in Asp.Net MVC Application / Project

http://tutlane.com/tutorial/aspnet-mvc/create-add-model-in-asp-net-mvc-application-project

Create Simple Asp.Net MVC Application (Sample) or Project

http://tutlane.com/tutorial/aspnet-mvc/create-simple-asp-net-mvc-application-sample-or-project

Tightly Coupled View (Model bounded view) in Asp.Net MVC

http://tutlane.com/tutorial/aspnet-mvc/tightly-coupled-view-model-bounded-view-in-asp-net-mvc

How Action methods and URLs works in Asp.Net MVC

http://tutlane.com/tutorial/aspnet-mvc/how-action-methods-and-urls-works-in-asp-net-mvc

Part 1 Free MVC Tutorial By Saineshwar Bageri



Asp.Net MVC Introduction

Introduction to ASP.NET MVC or MVC Beginners Introduction

http://tutlane.com/tutorial/aspnet-mvc/introduction-to-asp-net-mvc-or-mvc-beginners-introduction

Why & When to Use Asp.Net MVC vs Asp.Net Webforms

http://tutlane.com/tutorial/aspnet-mvc/why-when-to-use-asp-net-mvc-vs-asp-net-webforms

Asp.Net MVC Architecture Example or Diagram for Beginners

http://tutlane.com/tutorial/aspnet-mvc/asp-net-mvc-architecture-example-or-diagram-for-beginners

Asp.Net MVC Installation or Tools for Visual Studio 2010/2012

http://tutlane.com/tutorial/aspnet-mvc/asp-net-mvc-installation-or-tools-for-visual-studio-2010-2012

Simple Asp.Net MVC Hello World Example (Program)

http://tutlane.com/tutorial/aspnet-mvc/simple-hello-world-example-or-program-in-asp-net-mvc

Monday, 11 July 2016

Spire.Office for .NET

Introduction

Free Spire.Doc for .NET is a Community Edition of the Spire.Doc for .NET, which is a totally free word component for commercial and personal use.

As a free C#/VB.NET component, it also offers a lot of powerful functions. Developers can use it to generate, read, write, save, print and convert documents on any .NET applications. The featured function, conversion allows converting Word documents (Word 97-2003, Word 2007, Word 2010, word 2013) to commonly used file format, such as XML, RTF, TXT, PDF, XPS, EPUB, HTML and Image etc.

Visit Site for Details :- Click Here to Visit Official Site 
  

Click here to Download Tools :- Download Here


In this article we are going to learn how to generate DOC file Use Powerful tool Spire.Office for .NET
Tool Required
  • We are using Visual Studio 2012.
  • Free Spire.Office Component [Free for commercial and personal use] Support .Net from [ 2.0 to 4.5 ]
Getting Started
Let’s start with creating a new project in Visual Studio 2012.
For creating new project from Visual Studio IDE first select File Menu then inside that select New and then finally select Project.

Fig 1. Add Project.

After selecting Project from Menu a new dialog will pop up with Name New Project.


Fig 2. Naming Project.


Inside this dialog we are going choose template for doing that we going to select Templates Menu from left side of dialog just below Installed Templates after selecting Templates it will expand in that we are going to select Visual C# inside that finally we going to select Web Templates.

After choosing Web in Middle panel you will find all different Web templates available in ASP.NET. In that we are going to choose [ASP.NET Webforms Application] and .Net Framework 4.5. 
 
At last we are going to name project as SpireComponentDemo and click on OK button.
After project creation below is view of Project which is created.



Fig 3. Project View after adding.

After creating project now let’s add Spire Component [Spire.Office for .NET]
Adding Spire Component from Package Manager Console

For adding component from Package Manager Console just type [Install-Package Spire.Office]


Fig 4.Adding Spire.office component from Package Manager Console.

Adding Spire Component from Manage NuGet package

For adding component from Manage NuGet package from Visual studio IDE select Tools then NuGet Package Manager Manage NuGet packages for solution.

Fig 5.Adding Spire.office component from Package Manager Console.

After selecting Manage NuGet packages for solution a new dialog will pop up as show below.


Fig 6.Adding Spire.office component from Manage NuGet packages.

After that in search box of Manage NuGet packages dialog enter [Spire.Office] after entering in middle panel you will see [Spire.Office for .Net] with Install button just click on Install button .



After clicking on Install button
Fig 7. While downloading Spire.office component from Manage NuGet packages.

After successfully installation
Fig 8. After downloading Spire.office component from Manage NuGet packages.
After installing the reference of [Spire.Office] you can see reference added to your project.


Fig 9. Referencing added after downloading Spire.office component from Manage NuGet packages.
After installing and viewing reference now let’s add a simple webpage to Project.

Adding Webpage.
For adding webpage just right click on project then select Add inside that select Add New Item after selecting a new dialog will pop up with Name [Add New Item] in that select Webform and name your Webform [demo.aspx]

Fig 10. Adding New Web form.
After adding page now let’s Create, Write and Save Word in C# Using Spire.Doc Components.

Create, Write and Save Word in C# Using Spire.Doc Components
For doing this demo I am simple going to add a button on demo.aspx page


Fig 11. Adding button on demo.aspx Web form.
After adding button now let’s write code for Create a Word Document file from using Spire.Doc Components.
Adding Namespace for Using Spire.Doc Components




Fig 12. Code for accessing spire components.
Creating Document File
In below snapshot we are creating a Word document file using Spire.Doc Components for doing this
First we need to create object of Document class
Document doc = new Document();
 
After that we are going to add new section

[Section section = doc.AddSection();
 
Because contents are written in a paragraph which is contained in section of document then we are going
Add new paragraph
[Paragraph Para = section.AddParagraph();
 
After creating new paragraph we just need to add content in paragraph for this we need to use [AppendText

After adding Text which you want now we need to save this document file to folder for doing this I have added Folder name DocumentFile in Project and using doc.SaveToFile to save to this document file to folder.


Complete Code Snippet. 


  
Project view after creating Word Document File in Folder and Document


Fig 13. Project view after creating Word Document File in Folder.
Output


 Fig 14. Output after creating Word Document file using Spire Component.
 
Adding Header and Footer to Word Document while creating

In this part we are going to add header and footer to document which we are creating.

Code snippet.


Snapshot of Code for Adding Header and Footer

Fig 15. Code for adding Header and Footer to Word Document file.

Output

Fig 16.Output after adding Header and Footer.
Adding Image in Word Document 

For adding Image in document file we are going to create a new Paragraph after that to add image in document file we need image that must be stored in our Project folders meanwhile I have few images stored in Images folder which I am going to use for adding in document file. Then assigning image to DocPicture Class and finally setting width and height of Image file.
Below is code snippet for adding Image


Below is complete code snippet for adding Image


Output


Fig 16.Output after adding Image to Word Document file.

Adding Text Watermark in Word Document

For adding Text Watermark we need to create object of TextWatermark class then we can set properties such as (Text, Font size, Font Name, Layout, Color).
In below code snippet I have created an object of document class then added Section to document and assigned section to paragraph after that adding TextWatermark class we are going to set properties of TextWatermark class.
First we are going to set Text properties the text which is set as watermark.
TextWatermark TXTWatermark = new TextWatermark();
TXTWatermark.Text = "Spire Watermark";

Setting Font Name and Font size
TXTWatermark.FontSize = 45;
TXTWatermark.FontName = "Broadway BT";

Setting Layout
TXTWatermark.Layout = WatermarkLayout.Diagonal;
Setting Color
TXTWatermark.Color = Color.Purple;

Assigning Watermark class to document.
document.Watermark = TXTWatermark;

Complete Code Snippet of Adding Text Watermark in Word Document
 
Output

Fig 17.Output after adding Text Watermark to Word Document file.


Visit Site for Details :- Click Here to Visit Official Site
Click here to Download Tools :- Download Here




Wednesday, 8 June 2016

Useful Regular Expression in C#.

Useful Regular Expression in C#.

White space is not allowed
(\S)+

Alphabets and Space
[a-zA-Z ]+$

Alphabets
^[A-z]+$

Numbers
^[0-9]+$

Alphanumeric
^[a-zA-Z0-9]*$

Email
[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?

Mobile no.
^([7-9]{1})([0-9]{9})$

Date Format ( mm/dd/yyyy | mm-dd-yyyy | mm.dd.yyyy )

/^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\\d\\d+$/

Website URL
^http(s)?://([\\w-]+.)+[\\w-]+(/[\\w- ./?%&=])?$

Credit Card Numbers
Visa
^4[0-9]{12}(?:[0-9]{3})?$ 

MasterCard
^5[1-5][0-9]{14}$ 

American Express
^3[47][0-9]{13}$ 

Decimal number
((\\d+)((\\.\\d{1,2})?))$  

IFSC CODE
^[^\s]{4}\d{7}$

PAN CARD
^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$

Saturday, 13 June 2015

Learn IT And Share it Free ( MVC )

Learn IT And Share it Free ( MVC )

MVC Tutorial Series by :- Saineshwar bageri

1) Learn MVC Basics

http://www.c-sharpcorner.com/UploadFile/4d9083/learn-mvc-basics/

2) Creating Application in MVC 4 Using Razor

http://www.c-sharpcorner.com/UploadFile/4d9083/creating-application-in-mvc-4-using-razor/

3) Creating Insert Update and Delete Application In MVC 4 Using Razor

http://www.c-sharpcorner.com/UploadFile/4d9083/creating-insert-update-and-delete-application-in-mvc-4-using/

4) Creating Simple WebGrid In MVC 4 Using Simple Model And Dataset

http://www.c-sharpcorner.com/UploadFile/4d9083/creating-simple-webgrid-in-mvc-4-using-simple-model-and-data/

5) Creating Simple Cascading DropDownList In MVC 4 Using Razor

http://www.c-sharpcorner.com/UploadFile/4d9083/creating-simple-cascading-dropdownlist-in-mvc-4-using-razor/

6)Binding Dropdownlist With Database In MVC

http://www.c-sharpcorner.com/UploadFile/4d9083/binding-dropdownlist-in-mvc-in-various-ways-in-mvc-with-data/

7)How to Connect ADO.NET Entity Framework With MVC in Simple Steps

http://www.c-sharpcorner.com/UploadFile/4d9083/how-to-connect-ado-net-entity-framework-with-mvc-in-simple-s/

8) Binding Radiobutton and Radiobuttonlist in Various Way in MVC With Database

http://www.c-sharpcorner.com/UploadFile/4d9083/binding-radiobutton-and-radiobuttonlist-in-various-way-in-mv201/

9) Load on Demand Data in Webgrid on Scroll Using ASP.Net MVC and jQuery AJAX

http://www.c-sharpcorner.com/UploadFile/4d9083/load-on-demand-data-in-webgrid-on-scroll-using-Asp-Net-mvc-a/

10) Performing CRUD Operation With Dapper ( Open Source ORM From Stack Overflow) in MVC

http://www.c-sharpcorner.com/UploadFile/4d9083/performing-crud-operation-with-dapper-in-mvc/

11) Globalization and Localization in ASP.Net MVC 4

http://www.c-sharpcorner.com/UploadFile/4d9083/globalization-and-localization-in-Asp-Net-mvc-4/

12) Creating Simple Checkboxlist in MVC 4 Using Razor

http://www.c-sharpcorner.com/UploadFile/4d9083/creating-simple-checkboxlist-in-mvc-4-using-razor/

13) Filter Grid With Cascading Dropdownlist In MVC Using Razor

http://www.c-sharpcorner.com/UploadFile/4d9083/filter-grid-with-cascading-dropdownlist-in-mvc-using-razor/

14) Capturing Image From Web Cam in ASP.Net MVC

http://www.c-sharpcorner.com/UploadFile/4d9083/capturing-image-from-web-cam-in-Asp-Net-mvc139/

15) Using Membership in ASP.Net MVC 4

http://www.c-sharpcorner.com/UploadFile/4d9083/using-membership-in-Asp-Net-mvc-4/

16) Creating Simple Grid in MVC Using Grid.MVC

http://www.c-sharpcorner.com/UploadFile/4d9083/creating-simple-grid-in-mvc-using-grid-mvc/




Tuesday, 19 May 2015

Using Membership in ASP.Net MVC 4

In this article we will see how to use a Microsoft built-in Membership in ASP.Net MVC 4.

To see Complete Article Visit: -  http://www.c-sharpcorner.com/UploadFile/4d9083/using-membership-in-Asp-Net-mvc-4/

It is best to use ready-made membership rather than creating an entirely new one for every application we create.

Let's start creating a MVC application first.

Creating MVC application

In Visual Studio select "File" -> "New" -> "Project...". A new wizard will be shown. Inside that select Visual C# Template and inside that Web and from the list of templates select ASP.NET MVC 4 Web Application then provide name for the project “MembershipDEMO”.



Then in the Project Templates select the Basic template.

Monday, 4 May 2015

Capturing Image From Web Cam in ASP.Net MVC

This article shows how to capture an image using a webcam in MVC4 and in this application we will use a jQuery webcam.js plug-in for capturing images. I have seen that most online applications currently require webcam image capturing functionality in some way or another. Most social networking sites use this kind of functionality in their application for capturing user profile pictures.

To see Complete Article Visit: -  http://www.c-sharpcorner.com/UploadFile/4d9083/capturing-image-from-web-cam-in-Asp-Net-mvc139/

Agenda
  1. Create basic MVC application.
  2. Download and Adding webcam.js related reference files to project.
  3. Adding Controller ( PhotoController ).
  4. Adding Index view.
  5. Adding Action Method Capture( ).
  6. Adding Script for capturing Image.
  7. Adding Action Method and Script for binding image.
  8. Adding [HttpPost] Index Action Method.
  9. Displaying the index View in New Window.
  10. Changephoto.cshtml Code Snippet.
  11. PhotoController Code Snippet.
  12. Index.cshtml Code Snippet.
  13. Finally Output. 






Saturday, 31 January 2015

IEnumerable

what is IEnumerable ?

Exposes an enumerator, which supports a simple iteration over a non-generic collection.



 For calling this class method in void Main.


Output:-