473,806 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TagPrefix is not recognized

Hello

I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :

Now when I use this webpart DLL as a reference in website project and
include this line

<%@ Register TagPrefix="cust om" Namespace="aspw ebpart" %>

The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTempla te>

<custom:Feature Part ID="my" Runat="Server" />
</WebPartsTemplat e>

Any Ideas??

=============== =============== =============== ==============

using System;
using System.Collecti ons.Generic;
using System.Text;
using System.Data;
using System.Data.Sql Client;
using System.Web.UI;
using System.Web.UI.W ebControls.WebP arts;

namespace aspwebpart
{

public class FeaturePart:Web Part
{
const string str =
"server=10.111. 121.24;Trusted_ Connection=true ;Database=North Wind";
const string query = "Select * from products";

public FeaturePart()
{
this.Title = "Feature Part";
}

protected override void RenderContents( HtmlTextWriter writer)
{

DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter( query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Row s.Count)];

writer.Write((s tring)row["ProductNam e"]);
writer.Write(st ring.Format("-{0:c}", row["UnitPrice"]));

base.RenderCont ents(writer);
}

}
}

Regards

Madhur

Jul 21 '06 #1
3 2946
Madhur,

Check out my post "Error creating control..Server tag error" from earlier in
the day. I had this error with a custom control. Don't know if the same
applies to webparts but you may need to add the "assembly=" attribute. See
my sample code and resolution in the posts. Dave

"ah**********@g mail.com" wrote:
Hello

I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :

Now when I use this webpart DLL as a reference in website project and
include this line

<%@ Register TagPrefix="cust om" Namespace="aspw ebpart" %>

The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTempla te>

<custom:Feature Part ID="my" Runat="Server" />
</WebPartsTemplat e>

Any Ideas??

=============== =============== =============== ==============

using System;
using System.Collecti ons.Generic;
using System.Text;
using System.Data;
using System.Data.Sql Client;
using System.Web.UI;
using System.Web.UI.W ebControls.WebP arts;

namespace aspwebpart
{

public class FeaturePart:Web Part
{
const string str =
"server=10.111. 121.24;Trusted_ Connection=true ;Database=North Wind";
const string query = "Select * from products";

public FeaturePart()
{
this.Title = "Feature Part";
}

protected override void RenderContents( HtmlTextWriter writer)
{

DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter( query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Row s.Count)];

writer.Write((s tring)row["ProductNam e"]);
writer.Write(st ring.Format("-{0:c}", row["UnitPrice"]));

base.RenderCont ents(writer);
}

}
}

Regards

Madhur

Jul 21 '06 #2
Hi Dave

Gr8 !!! That did the trick. Thanks very much
Clear me one thing, what does Assembly attribute refers to?
Does it refer dll file name or Assembly is an attribute stored inside
..NET metadata.

I am asking it because when I appended .dll in front of it, it again
gave the same error.

Madhur
Dave wrote:
Madhur,

Check out my post "Error creating control..Server tag error" from earlier in
the day. I had this error with a custom control. Don't know if the same
applies to webparts but you may need to add the "assembly=" attribute. See
my sample code and resolution in the posts. Dave

"ah**********@g mail.com" wrote:
Hello

I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :

Now when I use this webpart DLL as a reference in website project and
include this line

<%@ Register TagPrefix="cust om" Namespace="aspw ebpart" %>

The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTempla te>

<custom:Feature Part ID="my" Runat="Server" />
</WebPartsTemplat e>

Any Ideas??

=============== =============== =============== ==============

using System;
using System.Collecti ons.Generic;
using System.Text;
using System.Data;
using System.Data.Sql Client;
using System.Web.UI;
using System.Web.UI.W ebControls.WebP arts;

namespace aspwebpart
{

public class FeaturePart:Web Part
{
const string str =
"server=10.111. 121.24;Trusted_ Connection=true ;Database=North Wind";
const string query = "Select * from products";

public FeaturePart()
{
this.Title = "Feature Part";
}

protected override void RenderContents( HtmlTextWriter writer)
{

DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter( query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Row s.Count)];

writer.Write((s tring)row["ProductNam e"]);
writer.Write(st ring.Format("-{0:c}", row["UnitPrice"]));

base.RenderCont ents(writer);
}

}
}

Regards

Madhur
Jul 21 '06 #3
Madhur,

The assembly name refers to the project that contains my custom controls.
In my case my project name was CustomControls, so when I compile it becomes
CustomControls. dll. The assembly attribute must then match the name of the
dll..."Assembly ="CustomControl s" without the .dll extension though..go figure.

"ah**********@g mail.com" wrote:
Hi Dave

Gr8 !!! That did the trick. Thanks very much
Clear me one thing, what does Assembly attribute refers to?
Does it refer dll file name or Assembly is an attribute stored inside
..NET metadata.

I am asking it because when I appended .dll in front of it, it again
gave the same error.

Madhur
Dave wrote:
Madhur,

Check out my post "Error creating control..Server tag error" from earlier in
the day. I had this error with a custom control. Don't know if the same
applies to webparts but you may need to add the "assembly=" attribute. See
my sample code and resolution in the posts. Dave

"ah**********@g mail.com" wrote:
Hello
>
I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :
>
Now when I use this webpart DLL as a reference in website project and
include this line
>
<%@ Register TagPrefix="cust om" Namespace="aspw ebpart" %>
>
The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTempla te>
>
<custom:Feature Part ID="my" Runat="Server" />
</WebPartsTemplat e>
>
Any Ideas??
>
=============== =============== =============== ==============
>
using System;
using System.Collecti ons.Generic;
using System.Text;
using System.Data;
using System.Data.Sql Client;
using System.Web.UI;
using System.Web.UI.W ebControls.WebP arts;
>
namespace aspwebpart
{
>
public class FeaturePart:Web Part
{
const string str =
"server=10.111. 121.24;Trusted_ Connection=true ;Database=North Wind";
const string query = "Select * from products";
>
public FeaturePart()
{
this.Title = "Feature Part";
}
>
protected override void RenderContents( HtmlTextWriter writer)
{
>
DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter( query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Row s.Count)];
>
writer.Write((s tring)row["ProductNam e"]);
writer.Write(st ring.Format("-{0:c}", row["UnitPrice"]));
>
base.RenderCont ents(writer);
}
>
}
}
>
Regards
>
Madhur
>
>

Jul 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2399
by: Kristoffer Arfvidson | last post by:
Ok, so a new question... Im building my page as dynamic as I can... meaning that I have basicly one aspx page that controls everything... so, I solved this by sending different variables to the page depending on where i want to go, eg. www.myserver.com/gotopage.aspx?page=mainpage ok, so, on this gotopage.aspx I have used a lot of usercontrols to show the defferent contents of my pages (to keep the design at one place and the code in...
1
1915
by: Michael Skelton | last post by:
Hi I've created a new custom Web control. I have tried to customize the assembly attribute TagPrefix . However, each time I drag my custom control onto a form, it's TagPrefix is still "cc1". What am I missing here My control is nested within two namespaces: for example, OuterNamespace and InnerNamespace. Taking that into account, the AssemblyInfo.cs of my custom control's solution contains the following additional lines .. using...
0
950
by: G Dean Blake | last post by:
( I know this should be posted in the BuildingControls forum but I don't get much help over there) I'm going through this book on asp.net server control development. I wrote a control using the namespace: ESS.ServerControls The book says that if I put the following in my control's AssemblyInfo.vb file that my controls will be prefixed by an "ess" tagPrefix:
2
3703
by: Keith Harris | last post by:
When you drag a web user control onto your design surface, VS.NET automatically assigns the tagprefix = uc1. Does anyone know how to change the default tagprefix for all web controls you drag onto a web form? Thank you.
1
2649
by: Michael Tissington | last post by:
I'm trying to convert a project from VS2003 to VS2005 After conversion all of my TagPrefix are not recognized in the body. <%@ Register TagPrefix="Oaklodge" TagName="Curve" Src="ctrls/Curve.ascx" %> This does not report any errors, but when I try to use it like <Oaklodge:Curve runat="server" /> I get the following error
5
2308
by: Arthur Dent | last post by:
Can anyone tell me what the equivalent in 2005 is for 2003's line <Assembly: System.Web.UI.TagPrefix("Temporal.WEB.Controls", "twebc")> in the AssemblyInfo file? I have an assembly of my own custom webcontrols which i am trying to port to 2005, but cannot seem to find this piece of info. Thanks in advance, - Arthur Dent.
1
1332
by: wapsiii | last post by:
I'd like to set the tagprefix of my server controls automatically when they are dragged to the webform. My code reads <Assembly: TagPrefix("CtrlLib", "abc")> Namespace CtrlLib <DefaultProperty("Text"), ToolboxData("<{0}:TextBoxPlus runat=server></{0}:TextBoxPlus>")> _
4
1840
by: | last post by:
Is there a way to define a controls tagprefix in the control itself? When I drop a control on a web page it's tagprefix defaults to uc1, as expected. Where can I set it so that it's default tag prefix is something else, so i don't have to change 'em every time I drop a control on the form? Thanks. Jerry
0
988
by: Sergei Shelukhin | last post by:
We have a custom (ascx) control that is used in several pages. In ASP.NET 1.1, we had register tagprefix specified in every page that uses this control; in 2.0, I decided to add this control to one more page so I added tagprefix registration to web.config. However, when I tried to open the page (after building the app ofc) it gave me errors in control's page_load - all of its inner controls (textboxes etc) were nulls. As soon as I copy...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.