designed web page as the content page of the Master Page. Different way to say, we can apply Master Page o an existing Web page by following some steps.To convert from a Web Form to Web Content Form, all of the changes will occur in the Web Form’s aspx page.
just follow the following steps:
1.Create a Master Page
2.Apply Master Page via design mode in existing wen page
3.Copy over the Content Containers
4.In your Web Form, move Web Controls and information into the proper Content Containers.
Suppose, we have a web page named frmAddTask.aspx, we want to add the Master Page to this page. A s the part of above steps, we create the Master Page.
Then we need to go to the Design mode of our Web page frmAddTask.aspx, making the right-click we have to choose the properties for this page. From the properties, we select the Master Page option and show the Master Page we have created for this web page. Then in the code of the web page a small but vast change will be effected at the top line of its code view.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmAddTask.aspx.cs" Inherits="SMS_IB_Support_tools.UI.frmAddTask" MasterPageFile="~/UI/SMS-IB.Master" %>
Now, the second and final step is to put items into the correct content boxes. The easiest and more error free to do this is to create a new blank Web Content Form, copy the content boxes from the Web Content Page, and paste them into our original Web Form. So right click the Master page in the Solution Explorer and select Add Content Page. Our example will output:
<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" Title="Untitled Page" %>
Copy lines 2-5 above and paste them into frmAddTask.aspx right below the “<%@ Page” directive. The ContentPlaceHolderID called ContentPlaceHolder1 will hold all the information between
in our "frmAddTask.aspx. The rest of the information below can be deleted.
We will must have to follow that, in the existing Web Page FORM tag is appeared. And in the Master Page also the
No comments:
Post a Comment