Recent Posts

How to add Template in ASP.NET

For creating attractive website sometimes we want to add template in web site which will be developed by ASP.NET.So today i will show you how to add template in web form. Its the most easy method you ever seen.

Now Follow me,
1.First open Microsoft Visual studio(Any Version).Then click on File > New > Website > ASP.NET Empty Website.Finally click on OK.A new page will be open on your Microsoft Visual studio.




2.Then right click on your web project and you will show many options.Now you should select Add New Item > MasterPage (If you want you can rename it) > Add(You also see automatically select a check box named Place Code in Separate File).


Empty Website



3.Now download free template which you like most and Extract it to the folder.Open template folder and you will see index file.Open index file copy whole code then come back to Microsoft Visual studio and open MasterPage and Select Source.Now you will see code which is like,



  <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>





    
    
    


    
4.Now Remove code from MasterPage(Remove all code to <!DOCTYPE> to </html> tag).Don't remove,


Marked code need to be removed


   <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
This code. 5.Now paste your code which you copied from your template folder index file.
   <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

Paste all code below this code.
 6.Now go back template folder and copy all files without index file and paste it in your web project.Then Go to Design mode(MasterPage.aspx) you will see you sucessfully add template to your ASP.NET web project.(You also select Split mode where you will see both code and design).


Paste all files without index file







Post a Comment

0 Comments