Click here to Skip to main content
15,900,502 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying for creating a usercontrol and call into aspx page, so i created a sample usercontrol page and i called the usercontrol into the asp page like this
C#
<%@ Register TagPrefix="uc" TagName="UserInformation" Src="~/userinformation.ascx">

My problem is inside the html body tag i'm unable to call the tagprefix can any 1 help me and my codings are below

C#
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="uc" TagName="UserInformation" Src="~/userinformation.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table>
    <tr>
    <td> <uc </td>
    </tr>
    </table>
    </div>
    </form>
</body>
</html>
Posted
Updated 25-Sep-13 20:58pm
v4
Comments
Harshil_Raval 26-Sep-13 2:58am    
So, what is your question?
Harshil_Raval 26-Sep-13 3:03am    
hi, build your application. then try to use it like, <uc:UserInformation ID="userinfo" runat="server" />
kesav prakash 26-Sep-13 3:20am    
i buid the soln its suceeded, still it not works

1 solution

After adding registering the user control, did you build your solution? If not try that and see if you are able to get the tag through intellisense .
 
Share this answer
 
Comments
Please add this as a Comment.
kesav prakash 26-Sep-13 3:20am    
i buid the soln its suceeded, still it not works
Er Daljeet Singh 26-Sep-13 6:57am    
Just do 1 thing remove the register directive from you page after that go to the design view and and drag the usercontrol again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900