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

  • Thread starter Thread starter InHyuk, Song
  • Start date Start date
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)
 
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
 
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
 
Back
Top