(VS2005) Cannot use web user control in the aspx page!

I

InHyuk, Song

I want to include ascx file, it displays some contents.
therefore I drag the ascx file from the solution explorer into the design
window of the aspx file.

However, in case that ascx file(not ascx.cs) contains select tag (<select>),
UserControl box displays error messages,
"An unhandled exception has occured. Specified cast is not valid."

so I deleted the <select> tag. results? It works~ T_T;

There is any difference in the VS2005? Please help me.


the contents of aspx file:

<%@ Page Language="C#" CompileWith="SomeFile.aspx.cs"
ClassName="SomeFile_aspx" %>
<%@ Register TagPrefix="uc1" TagName="uc_SomeFile_step1"
Src="uc_SomeFile_step1.ascx" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
...
</head>
<body text="#000000" bgColor="#ffffff" leftMargin="0" topMargin="0">

<form method=post encType="multipart/form-data" id="form1" runat="server">

<uc1:uc_WriteArticle_step1 ID="Uc_WriteArticle_step1" Runat="server" />

</form>
</body>
</html>


ascx file:
<%@ Control Language="C#" CompileWith="uc_SomeFile_step1.ascx.cs"
ClassName="uc_SomeFile_step1_ascx" %>

<select id="m_section" runat="server">
<option value="" selected>-------</option>
</select>


Thanks.

InHyuk, Song.
(e-mail address removed)
 
C

CJ Taylor

Select isn't a server control....


InHyuk said:
I want to include ascx file, it displays some contents.
therefore I drag the ascx file from the solution explorer into the design
window of the aspx file.

However, in case that ascx file(not ascx.cs) contains select tag
 
C

CJ Taylor

meaning remove the runat

InHyuk said:
I want to include ascx file, it displays some contents.
therefore I drag the ascx file from the solution explorer into the design
window of the aspx file.

However, in case that ascx file(not ascx.cs) contains select tag
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top