BC30311: Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.TextBox'.

 Hello everyone,

I receive the error in the subject when viewing this page, I can get it to work fine without the master page and only the textboxes, but that causes an error with line 11, even when the page contents do process to the form.

I don`t understand the error and I would appreciate any guidance on this.

Thanks for reading.

1    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
2    
3    <script runat="server">
4    
5        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
6            Dim Dbconnection, sqlcommand, dbcommunication, dbread
7            Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb"))
8            Dbconnection.Open()
9            sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Title],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Title.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')"
10           dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection)
11           dbread = dbcommunication.ExecuteNonQuery()
12           dbread.Close()
13           Dbconnection.Close()
14       End Sub
15   </script>
16   
17   <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
18       <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" />
19       .<br />
20       <br />
21       <table>
22           <tr>
23               <td style="width: 100px; height: 26px;">
24                   CustomerID 5</td>
25               <td style="width: 100px; height: 26px;">
26                   <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td>
27           </tr>
28           <tr>
29               <td style="width: 100px">
30                   LastName 20</td>
31               <td style="width: 100px">
32                   <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td>
33           </tr>
34           <tr>
35               <td style="width: 100px">
36                   FirstName 10</td>
37               <td style="width: 100px">
38                   <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td>
39           </tr>
40           <tr>
41               <td style="width: 100px">
42                   Title 4</td>
43               <td style="width: 100px">
44                   <asp:TextBox ID="Title" runat="server"></asp:TextBox></td>
45           </tr>
46           <tr>
47               <td style="width: 100px">
48                   BirthDate
49               </td>
50               <td style="width: 100px">
51                   <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td>
52           </tr>
53           <tr>
54               <td style="width: 100px">
55                   Address 50</td>
56               <td style="width: 100px">
57                   <asp:TextBox ID="Address" runat="server"></asp:TextBox></td>
58           </tr>
59           <tr>
60               <td style="width: 100px">
61                   Town 15</td>
62               <td style="width: 100px">
63                   <asp:TextBox ID="Town" runat="server"></asp:TextBox></td>
64           </tr>
65           <tr>
66               <td style="width: 100px">
67                   County 15</td>
68               <td style="width: 100px">
69                   <asp:TextBox ID="County" runat="server"></asp:TextBox></td>
70           </tr>
71           <tr>
72               <td style="width: 100px; height: 26px;">
73                   PostCode 10</td>
74               <td style="width: 100px; height: 26px;">
75                   <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td>
76           </tr>
77           <tr>
78               <td style="width: 100px">
79                   HomePhone 24</td>
80               <td style="width: 100px">
81                   <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td>
82           </tr>
83       </table>
84       <br />
85       <input id="Button1" type="button" value="button" />
86       </form>
87       
88   </asp:Content>
0
Susan_M
3/20/2007 11:47:18 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

5 Replies
1727 Views

Similar Articles

[PageSpeed] 0

Try http://scottonwriting.net/sowblog/posts/10878.aspx 

Hope that helps.

Aaron


Don't forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved so everyone will know you have been helped.
0
agolden
3/20/2007 12:48:33 PM

Thanks a lot. It now works, but when I apply my master page, I get a strange error:

 Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>

<script runat="server">

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim Dbconnection, sqlcommand, dbcommunication, dbread
        Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb"))
        Dbconnection.Open()
        sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Titl],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Titl.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')"
        dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection)
        dbread = dbcommunication.ExecuteReader()
        dbread.Close()
        Dbconnection.Close()
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" />
    .<br />
    <br />
        <div>
            <div>
                <table>
                    <tr>
                        <td style="width: 100px">
                CustomerID 5</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                LastName 20</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                FirstName 10</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                        Titl 4</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Titl" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                BirthDate
                        </td>
                        <td style="width: 100px">
                            <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                Address 50</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Address" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                Town 15</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Town" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                County 15</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="County" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                PostCode 10</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                HomePhone 24</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td>
                    </tr>
                </table>
                <br />
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
        </div>
    <br />
         </form>
    
</asp:Content>

 
0
Susan_M
3/20/2007 2:44:24 PM

Thanks a lot. It now works, but when I apply my master page, I get a strange error:

 Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>

<script runat="server">

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim Dbconnection, sqlcommand, dbcommunication, dbread
        Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb"))
        Dbconnection.Open()
        sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Titl],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Titl.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')"
        dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection)
        dbread = dbcommunication.ExecuteReader()
        dbread.Close()
        Dbconnection.Close()
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" />
    .<br />
    <br />
        <div>
            <div>
                <table>
                    <tr>
                        <td style="width: 100px">
                CustomerID 5</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                LastName 20</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                FirstName 10</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                        Titl 4</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Titl" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                BirthDate
                        </td>
                        <td style="width: 100px">
                            <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                Address 50</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Address" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                Town 15</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Town" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                County 15</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="County" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                PostCode 10</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                HomePhone 24</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td>
                    </tr>
                </table>
                <br />
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
        </div>
    <br />
         </form>
    
</asp:Content>

 
0
Susan_M
3/20/2007 2:44:48 PM

Thanks a lot. It now works, but when I apply my master page, I get a strange error:

 Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>

<script runat="server">

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim Dbconnection, sqlcommand, dbcommunication, dbread
        Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb"))
        Dbconnection.Open()
        sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Titl],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Titl.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')"
        dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection)
        dbread = dbcommunication.ExecuteReader()
        dbread.Close()
        Dbconnection.Close()
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" />
    .<br />
    <br />
        <div>
            <div>
                <table>
                    <tr>
                        <td style="width: 100px">
                CustomerID 5</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                LastName 20</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                FirstName 10</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                        Titl 4</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Titl" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                BirthDate
                        </td>
                        <td style="width: 100px">
                            <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                Address 50</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Address" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                Town 15</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="Town" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                County 15</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="County" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                PostCode 10</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                HomePhone 24</td>
                        <td style="width: 100px">
                            <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td>
                    </tr>
                </table>
                <br />
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
        </div>
    <br />
         </form>
    
</asp:Content>

 
0
Susan_M
3/20/2007 2:44:59 PM

I`ve solved it all, but don`t have a clue how!

Thanks for the help, sorry for the triple-post!

0
Susan_M
3/20/2007 4:16:39 PM
Reply:

Similar Artilces:

Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.TextBox'
I have a new page (wireframe) based on the User_Create page in the Time Tracker starter kit.  I have no code in the code behind page.  What might be causing this error?  This newbie needs help. I had a TextBox control named "Title" which appearantly conflicted with the page title. thanks!!! ...

BC30311: Value of type 'System.Web.UI.WebControls.RadioButtonList' cannot be converted to 'String'.
I have a listview that I'm working with.  Each record returned by my sql query is displayed in my list view as text, with the exception of one field, which I need to display as a radiobutton list.  I tried to set the value of the radiobutton in my codebehind, but keep getting errors.  How do I tell this radiobutton list that the value that should be selected when the page loads is equal to the value returned from my sql query?    The line in bold throws the error... How am I supposed to indicate what value to have selected when the page loads? <asp:Radi...

BC30311: Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.Label'.
I have a pretty basic vb.net page that includes a listview.  (Note, this is my first time working with listview, so I may have some of the terminology wrong).  In my list view, I display all the important data for each record, and ask the user to provide a status for each record by including a radiobutton list with various responses.  At the bottom of the page is one submit button, and when the user clicks submit, I'm saving each records value based upon which response is selected in the radiobutton list. My saving of data is working,  but I'm ...

Having an error: BC30311: Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.Label'.
Error Message: Compiler Error Message: BC30311: Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.Label'. Line 13: myGetRandom.RetrieveDetails(lblQuestion.text, lblAnswers.text, lblViewCount.text, lblLastUpdated.text) Sub Page_Load Dim myGetRandom as new GetRandom myGetRandom.RetrieveDetails(lblQuestion.text, lblAnswers.text, lblViewCount.text, lblLastUpdated.text) End Sub Code behind Sub RetrieveDetails(lblQuestion as label, _ lblAnswers as label, _ lblViewCount as label, _ lblLastUpdated as...

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.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  ...

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 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...

Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.TextBox'
Can anyone tell me what this error message means, and what to do to correct it.  Here is the code that has the error:  Dim sql As Stringsql = "INSERT INTO tblConnecting (Date, Member, Name, Company, Phone, Fax, Address, NamesofAttendees, PaymentType, Email) " _ & "Values('" & Today() & "', '" & blnMember & "', '" & Me.txtName.Text & "', '" & Me.txtCompany.Text & "', '" _& Me.txtPhone.Text & "', '" & Me.txtFax.Text &...

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...

BC30311: Value of type 'Control' cannot be converted to 'System.Web.UI.WebControls.CheckBox'
 Hi, can somebody help me on this problem. It works at first, but all of a sudden, it fails, and I can't find out why.    1 Sub btnSave_Click(ByVal sender As Object, ByVal e As EventArgs) 2 3 If Not CheckRequiredField() Then 4 MessageBox("Please complete the input data!") 5 Exit Sub 6 End If 7 8 Dim nRow As Integer 9 Dim Ctrl As Control 10 Dim chkDelete As Object 11 Dim LookupID, Name, Desc, Type As String 12 13 nRow = 0 14 1...

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.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 = "...

Error 60 Operator '&' is not defined for types 'System.Web.UI.WebControls.TextBox' and 'String'.
The comment control is a textbox:<td align="right" style="width: 228px"><asp:TextBox ID="comment" runat="server" TextMode="multiLine" Rows="10" Columns="50" onkeyup="return ismaxlength(this)" Width="260px" Height="100px" Font-Overline="false" /></td> and I'm being told by VS (underlined in blue ) that the for the comment field: Error 60 Operator '&' is not defined for types 'System.Web.UI.WebControls.TextBox' and 'String...

Web resources about - BC30311: Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.TextBox'. - asp.net.web-forms

Resources last updated: 2/11/2016 2:59:13 PM