S
swesorick
So, I have a custom web control that inherits from the standard asp.net
Textbox control.
When I add this control to my web page in Visual Studio 2005, I get the
following errors in my Error List:
Error 1 Request for the permission of type
'System.Web.AspNetHostingPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed. \\myserver\WebRoot\mypage.aspx 81
Error 29 Element 'MyTextBox' is not a known element. This can occur if
there is a compilation error in the Web
site. \\myserver\WebRoot\mypage.aspx 81 20 \\myserver\WebRoot\
The web control is in a separate vb.Net project from the website. Both
are in the same solution. The webcontrol is referenced as a project
reference from the website.
Whenever I try to reference this control from the Server side code, I
get the error: "txtMyTextBox is not declared." in the IDE
However, the site runs ok, when I actually visit the website. Also,
when I switch to Design Mode, it appears to render the control ok.
What could be causing this? How do I get the IDE to know about my
control and stop yelling at me about it?
The ASP.Net html looks like this:
<%@ Page Language="VB" MasterPageFile="~/myMaster.master"
AutoEventWireup="false" CodeFile="mypage.aspx.vb" Inherits="mypage" %>
<%@ MasterType VirtualPath="~/myMaster.master" %>
<%@ Register Assembly="MyControls" Namespace="MyControls"
TagPrefix="MyC"%>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain"
runat="Server">
<MyC:MyTextBox ID="txtMyTextBox" runat="server" TextMode="Password"
MaxLength="50"></MyC:MyTextBox>
</asp:Content>
Textbox control.
When I add this control to my web page in Visual Studio 2005, I get the
following errors in my Error List:
Error 1 Request for the permission of type
'System.Web.AspNetHostingPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed. \\myserver\WebRoot\mypage.aspx 81
Error 29 Element 'MyTextBox' is not a known element. This can occur if
there is a compilation error in the Web
site. \\myserver\WebRoot\mypage.aspx 81 20 \\myserver\WebRoot\
The web control is in a separate vb.Net project from the website. Both
are in the same solution. The webcontrol is referenced as a project
reference from the website.
Whenever I try to reference this control from the Server side code, I
get the error: "txtMyTextBox is not declared." in the IDE
However, the site runs ok, when I actually visit the website. Also,
when I switch to Design Mode, it appears to render the control ok.
What could be causing this? How do I get the IDE to know about my
control and stop yelling at me about it?
The ASP.Net html looks like this:
<%@ Page Language="VB" MasterPageFile="~/myMaster.master"
AutoEventWireup="false" CodeFile="mypage.aspx.vb" Inherits="mypage" %>
<%@ MasterType VirtualPath="~/myMaster.master" %>
<%@ Register Assembly="MyControls" Namespace="MyControls"
TagPrefix="MyC"%>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain"
runat="Server">
<MyC:MyTextBox ID="txtMyTextBox" runat="server" TextMode="Password"
MaxLength="50"></MyC:MyTextBox>
</asp:Content>