Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Converting aspx pages into ascx pages

$
0
0
Hi,
 
I have some aspx pages, as we are adding some new applications which are going to use some of the same pages we want to make those common pages as user controls.
 
I started making the aspx pages into User controls I changed the name of the files to ascx, ascx.cs, removed page attribute and put the control attribute, removed html, body and form tags from aspx file, in code behind I made change to inherit from UserControl class. Everything looks good upto this.
 
But those previous aspx pages were accessing some user controls, now those controls are displaying error message. Like at uc1:htmlhead and uc1:formheader it is displaying error message as "Unrecognized tag prefix or device filter uc1".
 

Below are the register and control directives for the user control. For the current User Control I have taken Control directive and for other ones I have taken Register directive. Am I missing any where. Please help me or suggest me or give me a link, any type of help is very helpful. Thanks in advance.
 
<%@ Register TagPrefix="uc1" TagName="HtmlHead" Src="../Includes/HtmlHead.ascx" %>
<%@  Page Language="c#" CodeBehind="ChangePass.ascx.cs" AutoEventWireup="false" Inherits="DIS.CnpWeb.Core.ChangePass" %>
<%@ Register TagPrefix="uc1" TagName="FormFooter" Src="../Includes/FormFooter.ascx" %>
<%@ Register TagPrefix="uc1" TagName="FormHeader" Src="../Includes/FormHeader.ascx" %>
 
<uc1:htmlhead id="HtmlHead1" runat="server"></uc1:htmlhead>
<uc1:formheader id="FormHeader1" runat="server"></uc1:formheader>
Thanks & Regards,
 
Abdul Aleem Mohammad
St Louis MO - USA

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>