By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 1,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

<object> as server side HtmlGenericControl

P: n/a
Hi,

I want to have an <objecttag in my .aspx file, so that it is shown as part
of my webpage. I want to add data to the "data" attribute using server side
code, so I thought I would add the runat="server" attribute. In order for
ASP.net to treat this as a generic html control, I have declared it in my
..aspx.vb codebehind file as

Protected WithEvents myObjectTag As
System.Web.UI.HtmlControls.HtmlGenericControl

Unfortunatley I get the following error when I run the code

Parser Error

Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: An object tag must contain a Class, ClassID or ProgID
attribute.

Does anyone have any idea how to prevent this happening?

Thanks,
Martin
Aug 30 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
the <objecttag just like the <scripttag is a special server control if
runat server is specified. if you include runat=server on an object tag, its
expected to be com objected created on the serverside that the code behind
can access, not a client control.

-- bruce (sqlwork.com)

"Martin Eyles" <ma**********@NOSPAMbytronic.comwrote in message
news:12*************@corp.supernews.com...
Hi,

I want to have an <objecttag in my .aspx file, so that it is shown as
part of my webpage. I want to add data to the "data" attribute using
server side code, so I thought I would add the runat="server" attribute.
In order for ASP.net to treat this as a generic html control, I have
declared it in my .aspx.vb codebehind file as

Protected WithEvents myObjectTag As
System.Web.UI.HtmlControls.HtmlGenericControl

Unfortunatley I get the following error when I run the code

Parser Error

Description: An error occurred during the parsing of a resource required
to service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: An object tag must contain a Class, ClassID or
ProgID attribute.

Does anyone have any idea how to prevent this happening?

Thanks,
Martin

Aug 30 '06 #2

P: n/a
Got a solution that works

data="<%Page.Response.Write(theThingIWantToPutInDa ta)%>"

so my object doesn't have to be server side.

Thanks,

M
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote
in message news:%2****************@TK2MSFTNGP02.phx.gbl...
the <objecttag just like the <scripttag is a special server control if
runat server is specified. if you include runat=server on an object tag,
its expected to be com objected created on the serverside that the code
behind can access, not a client control.

-- bruce (sqlwork.com)

"Martin Eyles" <ma**********@NOSPAMbytronic.comwrote in message
news:12*************@corp.supernews.com...
>Hi,

I want to have an <objecttag in my .aspx file, so that it is shown as
part of my webpage. I want to add data to the "data" attribute using
server side code, so I thought I would add the runat="server" attribute.
In order for ASP.net to treat this as a generic html control, I have
declared it in my .aspx.vb codebehind file as

Protected WithEvents myObjectTag As
System.Web.UI.HtmlControls.HtmlGenericControl

Unfortunatley I get the following error when I run the code

Parser Error

Description: An error occurred during the parsing of a resource required
to service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: An object tag must contain a Class, ClassID or
ProgID attribute.

Does anyone have any idea how to prevent this happening?

Thanks,
Martin


Sep 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.