ASPNET2 HELP! CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.FileUpload'.

Server Error in '/start-movieposters' Application.

Compilation Error

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

Compiler Error Message: CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.FileUpload'. An explicit conversion exists (are you missing a cast?)

Source Error:


Line 25: 		for (int i = 1; i <= 7; i++)
Line 26: {
Line 27: fileUp = FileUpload1.NamingContainer.FindControl("FileUpload" + i.ToString());
Line 28: textUp = FileUpload1.NamingContainer.FindControl("TextBox" + i.ToString());
Line 29: if (fileUp.HasFile)

Source File: e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step6.aspx    Line: 27



C:\WINDOWS\system32> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_Code.z4ehwkwv.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_Web_acedaez_.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_global.asax.k32sqnkw.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\assembly\dl3\cdb52609\4893496c_3b02c601\OnlineImageOptimizer.DLL" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_Web_rr0pcz3r.dll" /debug- /optimize+ /win32res:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\rr0pcz3r.res" /w:4 /nowarn:1659;1699  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_Web_rr0pcz3r.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_Web_rr0pcz3r.1.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_Web_rr0pcz3r.2.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\start-movieposters\46af573a\12ce2167\App_Web_rr0pcz3r.3.cs"


Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step6.aspx(27,13): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.FileUpload'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step6.aspx(28,13): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step6.aspx(54,37): error CS0117: 'System.Web.UI.WebControls.ParameterCollection' does not contain a definition for 'Item'
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step6.aspx(59,38): error CS0117: 'System.Web.UI.WebControls.ParameterCollection' does not contain a definition for 'Item'
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step8.aspx(22,65): error CS0029: Cannot implicitly convert type 'int' to 'string'
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step8.aspx(24,65): error CS0029: Cannot implicitly convert type 'int' to 'string'
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step8.aspx(26,65): error CS0029: Cannot implicitly convert type 'int' to 'string'
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step8.aspx(28,65): error CS0029: Cannot implicitly convert type 'int' to 'string'
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step8.aspx(36,136): error CS0118: 'System.Configuration.ConfigurationManager.ConnectionStrings' is a 'property' but is used like a 'method'
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step8.aspx(41,24): error CS0103: The name 'Data' does not exist in the current context
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(76,11): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(78,11): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(80,11): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(82,11): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(84,11): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(86,11): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(89,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(91,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(93,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(95,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(97,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(99,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(102,17): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(104,17): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(106,17): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(108,17): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(110,17): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(112,17): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(115,12): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(117,12): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(119,12): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(121,12): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(123,12): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(125,12): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(128,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(130,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(132,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(134,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(136,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(138,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(141,10): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(143,10): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(145,10): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(147,10): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(149,10): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(151,10): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(154,20): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(156,20): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(158,20): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(160,20): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(162,20): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(164,20): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(167,22): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(169,22): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(171,22): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(173,22): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(175,22): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(177,22): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(180,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(182,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(184,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(186,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(188,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
e:\web\users\testcom\html\start-movieposters\start-for-sale\sellers\ManageInventory\Add-new\AddItem-Step7.aspx(190,14): error CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TextBox'. An explicit conversion exists (are you missing a cast?)
function OnToggleTOCLevel1(level2ID) { var elemLevel2 = document.getElementById(level2ID); if (elemLevel2.style.display == 'none') { elemLevel2.style.display = ''; } else { elemLevel2.style.display = 'none'; } }


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
0
jonrwarren
12/20/2005 8:20:38 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

1 Replies
2266 Views

Similar Articles

[PageSpeed] 11

FindControl returns a Control and not a FileUpload. You have to cast it:

fileUp = (FileUpload)FileUpload1.NamingContainer.FindControl("FileUpload" + i.ToString());

0
David
12/20/2005 8:37:57 PM
Reply:

Similar Artilces:

Error: Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField'
Hello, I am getting the following error during compiliation. Any suggestions to fix it. Thanks. Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField' protected void gvEvents_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = gvEvents.Rows[index]; string sID; ButtonField btn; if (selectedRow.RowType == DataControlRowType.DataRow) { sID = ((ButtonField)selectedRow.FindControl("ID")).DataTextFi...

Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControls.TextBox'
I am attempting to "Update" a field in a Datagrid, but no matter what I do (Using either Label or Text Boxes)  I keep getting the same error: Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControls.TextBox' The Error is highlighted below in the Sub... <==THE FIELD THAT CALLS THE ERROR  Any help would be greatly appreciated !!! Thanks !!   The code is as follows... <table border=0 height=210 bordercolor=olive ><tr valign=top><td> <asp:datagrid id="FacilityDataGrid"...

Unable to cast object of type 'System.Web.UI.WebControls.FormView' to type 'System.Web.UI.WebControls.DropDownList'.
Hi,  I have a formview with a dropdownlist created dynamically. i want to determine whether the dropdownlist was clicked. the code is written in the FormView1_DataBound method. I get the following error in the line below that is in italics and underlined: Unable to cast object of type 'System.Web.UI.WebControls.FormView' to type 'System.Web.UI.WebControls.DropDownList'.   Here is my code: ddl_iFullname = New DropDownList ddl_iFullname.ID = "ddl_iFullname" ddl_iFullname.DataSource = ObjectDataSource3 ddl_iFullname.DataTextField = "fullname" ddl_iFullname.DataValueField = "...

Value of type 'System.Web.UI.Control' cannot be converted to 'System.Web.SiteMap'.
 Hello,         I receive this error "System.Web.UI.Control' cannot be converted to 'System.Web.SiteMap" when I try to find the Sitemap control.  ...            <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />            <asp:ListView ID="ListView1" runat="server">            <LayoutTemplate>    ...

Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'.
Hi, any idea why I'm getting the following error?Line 45: protected void CartGrid_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) Line 46: { Line 47: TextBox QuantityTextBox = (TextBox)CartGrid.Rows[e.RowIndex].Cells[2].Controls[0]; Line 48: int Quantity = Convert.ToInt32(QuantityTextBox.Text); Line 49: Are you sure that the control at CartGrid.Rows[e.RowIndex].Cells[2].Controls[0] isn't a LiteralControl?  How are you creating code this in your code?Brent JenkinsASP.NET, C#, Web Developerwww.valewebdesign.co.uk  ...

Error Serializing Value 'System.Web.UI.WebCOntrols.TreeNode' of type 'System.Web.UI.WebCOntrols.TreeNode'
Hi, I am  getting the error stated in the subject when i am storing a TreeNode in a ViewState and then using it as follows if (ViewState["ProductCounty"]!=null) { TreeNode _productCountyNode = DataTree.FindNode(((TreeNode)ViewState["ProductCounty"]).ValuePath); _productCountyNode.Expand(); } what could be causing this error? Hi, I believe TreeNode isn't serializable in a way its required for objects which can be put to ViewState - as reference - (TreeNode implements IStateManager and is meant to work together with TreeView itself saving it...

Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'
Hello, Goal: enter a number in two fields HoursPerUnit and PeoplePerUnit and the value for the third field, TotalHoursPerUnit will populate after the the number in the two fields have been caculated.  Using the code below I receive the error message above.  Please tell me what am I doing wrong? Do I need to cast the text as a literal?  Please help? Thank you in advance, <%@ Page Language="VB" MasterPageFile="Default.master" AutoEventWireup="false" CodeFile="frmHR.aspx.vb" Inherits="frmHR"...

Error 1 The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\asse
Once I build project. I encounter this error. Does someone experience this error?Error    1    The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.6.0.0__31bf3856ad364e35\System.Web.Extensions.dll'    D:\Source Code\Linq_Lesson5\Default.aspx    1    1    D:\Source Code\Linq_Lesson5\  It appears tha...

The base class includes the field 'MyList', but its type (System.Web.UI.WebControls.DataList) is not compatible with the type of control (System.Web.UI.WebControls.DataGrid).
Hi guys,I am very new to asp.net and have been playing with the commerce starter kit at - http://asp.net/CommerceStarterKit/ one of the first pages that lists the catalogue items "ProductsList.aspx" uses a datalist, I need to use a datagrid as I need to use pagination as my catalogue is so huge, I have changed the necessary attributes in the ProductsList.aspx page to datagrid and also in the codebehind file ProductsList.aspx.vb, when I run the page I get the Error message below. Description: An error occurred during the parsing of a resource required to ser...

The base class includes the field 'MyList', but its type (System.Web.UI.WebControls.DataList) is not compatible with the type of control (System.Web.UI.WebControls.DataGrid).
Hi guys,I am very new to asp.net and have been playing with the commerce starter kit at - http://asp.net/CommerceStarterKit/ one of the first pages that lists the catalogue items "ProductsList.aspx" uses a datalist, I need to use a datagrid as I need to use pagination as my catalogue is so huge, I have changed the necessary attributes in the ProductsList.aspx page to datagrid and also in the codebehind file ProductsList.aspx.vb, when I run the page I get the Error message below. Description: An error occurred during the parsing of a resource required to ser...

Cannot convert type 'System.Web.UI.Control' to 'FileUpload'
Hi,I'm getting an error in the follow code:FileUpload fileUpload1 = (FileUpload)itemPanel.FindControl("fuDoc");Where itemPanel is a AjaxControlToolkit.TabPanel and the aspx code is: <asp:FileUpload ID="fuDocument_es" runat="server" />The error is Cannot convert type 'System.Web.UI.Control' to 'FileUpload' Why? Thanks You are trying to find and convert "fuDoc" or "fuDocument_es"  ?try thisFileUpload fileUpload1 = (FileUpload)itemPanel.FindControl("fuDocument_es");...

Cannot implicitly convert type 'System.Web.UI.WebControls.Label' to 'string'
I have a datagridLabel ID1 = (Label)(e.Item.FindControl("ID1")); Label Name1 = (Label)(e.Item.FindControl("Name1")); Label TableName = (Label)(e.Item.FindControl("TableName"));   No0w Iam trying to TBTableName.Text = lblTableName;                  tbid.Text = lblImageTypeID1;                   tbnameordes.Text = lblImageName1; I have tried l lbltablename.text,.tostring,convert.t...

Cannot implicitly convert type 'Login' to 'System.Web.UI.WebControls.Login'
hello  i have got this error on this part of code :protected void Wizard1_NextButtonClick(object sender, System.Web.UI.WebControls.WizardNavigationEventArgs e) {if (e.CurrentStepIndex == 0) {System.Web.UI.WebControls.Login l = (Login)Wizard1.FindControl("Login1");if (Membership.ValidateUser(l.UserName, l.Password)) { FormsAuthentication.SetAuthCookie(l.UserName, l.RememberMeSet);e.Cancel = false; } else {l.InstructionText = "Your login attempt was not successful. Please try again."; l.InstructionTextStyle.ForeColor = System.Drawing.Color.Red;e.Cancel = ...

Cannot implicitely convert type 'string' to 'System.Web.UI.WebControls.Label'
 I'm starting to make a website for users to login. Once they login, I'm showing their profile. So I populate some asp:label controls on Page_Load. My profile page (shown after the user logs in) contains: <%@ Page Language="C#" MasterPageFile="~/site.master" CodeFile="clientProfile.aspx.cs" Inherits="clientProfile" AutoEventWireup="true" Title="Car Look - Your profile" %> <asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server"> <div> &l...

Web resources about - ASPNET2 HELP! CS0266: Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.FileUpload'. - asp.net.web-forms

Resources last updated: 1/21/2016 12:37:54 PM