'System.Web.UI.WebControls.TextBox' does not contain a definition for 'InnerHtml' and ...

Hi,
I have the problems (the following is one of those) with the codes below.

Error 4 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'InnerHtml' and no extension method 'InnerHtml' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?)  

Here is the markup file of 'Start.aspx'

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="Newsite._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Login Page</title>
    <link href="format.css" originalAttribute="href" originalPath=""format.css"" originalAttribute="href" originalPath="format.css" originalAttribute="href" originalPath="format.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
    <form id="form1" runat="server">
   <b>LOGIN:</b><br />
   UserID: <asp:TextBox ID="LoginUserIDTextBox" runat="server"></asp:TextBox> <span id="Userid" runat="server" /> <br />
   Password: <asp:TextBox ID="PasswordTextBox" runat="server" TextMode="Password"> </asp:TextBox> <span id="loginpassword" runat="server" />
   <br /><br />
    <asp:Button ID="LoginButton" runat="server" Text="Login"
        onclick="LoginButton_Click" />
   <br /><br />
    </form>
</body>
</html>

Here is 'Start.aspx.cs'

using System;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data.OracleClient;
using System.Security.Cryptography; // This was needed to make everything related to MD5 function

namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    {
        TextBox LoginUserIDTextBox, PasswordTextBox, Userid;
        string tempString;
        OracleConnection conn = new OracleConnection();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            if (LoginUserIDTextBox.Text == "")
            {
                Userid.InnerHtml = "(1) Please type your User ID...";
            }
            else
            {
                if (Session["UserName"] == "")
                {
                    Userid.InnerHtml = "(2) Incorrect UserID...";
                }
                else
                {
                    if (PasswordTextBox.Text == "")
                    {
                        loginpassword.InnerHtml = "(3) Please type in your password...";
                    }
                    else
                    {
                    }
                }
            }
        }

    }
}

Here is the last one - 'Start.aspx.designer.cs'
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Newsite {
   
   
    public partial class _Default {
       
        /// <summary>
        /// Head1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
       
        /// <summary>
        /// form1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlForm form1;
       
        /// <summary>
        /// LoginUserIDTextBox control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox LoginUserIDTextBox;
       
        /// <summary>
        /// Userid control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlGenericControl Userid;
       
        /// <summary>
        /// PasswordTextBox control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox PasswordTextBox;
       
        /// <summary>
        /// loginpassword control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlGenericControl loginpassword;
       
        /// <summary>
        /// LoginButton control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button LoginButton;
    }
}


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/17/2009 3:57:13 AM
asp.net.web-forms 93655 articles. 3 followers. Follow

42 Replies
6429 Views

Similar Articles

[PageSpeed] 29

Use .Text instead of InnerHTML when assigning values in TextBox server control like.

Userid.Text = "something";


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/17/2009 4:02:59 AM

Hi mate,

The problem is here : TextBox LoginUserIDTextBox, PasswordTextBox, Userid;

In your code you are having a Span called Userid and in CodeBehind you are declaring a textbox with name Userid.  The compiler would not understand whether the innerHTML is for Span or TextBox.

Just give different names to your controls and your problem would be solved.


Please mark it as answer if this post seems to be useful.
-1
nishit_123
2/17/2009 4:09:53 AM

dear,

the base class of TextBox does not contain the property "innerHtml", you can use ".text" property to get and set the values.


Kind Regards,
Saurabh Sharma

only dead fish swim along the flow of river, learn to make your own way.


Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread
1
saurabhsharma18
2/17/2009 4:31:56 AM

Many thanks Nishit and all. Nishit, ou're right for that 'Userid' is the Span ID. Should we have defined it as another object type within Codebehind before we further use the object in there? If not, how to make it defined within Codebehind (since you know it's a Span ID)?


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/17/2009 5:02:10 AM

 Hi,

There is no use of this line :   TextBox LoginUserIDTextBox, PasswordTextBox, Userid;

You can remove it.  Your page already has these controls and so no need to repeat them in codebehind.

Just remove the 2 lines and you are done.

Please mark it as answer if this OR above post helped you mate !


Please mark it as answer if this post seems to be useful.
-1
nishit_123
2/17/2009 5:12:09 AM

wmec:
Should we have defined it as another object type within Codebehind before we further use the object in there? If not, how to make it defined within Codebehind (since you know it's a Span ID)?
 

As stated in the member above, you don't have to define a new object if you just need to use the controls that is already declared in the markup (ASPX). All you need to do is reference the control (in your case the Span element) using its ID to access the control in your codes.. 

Check this codes below:

 

protected void LoginButton_Click(object sender, EventArgs e)
{
if (LoginUserIDTextBox.Text == "")
{
Userid.InnerText = "(1) Please type your User ID...";
}
else
{
if (Session["UserName"] == "")
{
Userid.InnerText = "(2) Incorrect UserID...";
}
else
{
if (PasswordTextBox.Text == "")
{
loginpassword.InnerText = "(3) Please type in your password...";
}
else
{
}
}
}
}
  
Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
1
vinz
2/17/2009 8:23:34 AM

Many thanks Vinz and all. How about the Span ID? Do we need to declare them in Codebehind? If not, when referring to that, it will be a problem (something like "The name '...' does not exist in the current context").


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/17/2009 9:02:31 AM

Your Label is rendered as span

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

Label1.Text = "aaa";

and if tou want to use span you can do this way

<span id = "span1" runat = "server" ></span>

span1.InnerHtml = "aa";

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
-1
mudassarkhan
2/17/2009 9:19:27 AM

Thanks Mak. Only one thing is if we need to declare 'span1' in Codebehind. If not, we'll have such error


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
1
wmec
2/17/2009 9:58:54 AM

no need you only need to add runat = "server" and you can use it in codebehind

span id = "span1" runat = "server" ></span>


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
-1
mudassarkhan
2/17/2009 10:04:28 AM

Sorry I've missed the error message above. When referring to 'span1' in Codebehind, we'll have this
Error 1 The name 'span1' does not exist in the current context

(even if we've declared it in the Markup)


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/17/2009 10:21:16 AM

wmec:

Sorry I've missed the error message above. When referring to 'span1' in Codebehind, we'll have this
Error 1 The name 'span1' does not exist in the current context

(even if we've declared it in the Markup)

did you add runat="server" to it?? try adding this one below

<span id = "span1" runat = "server" ></span>


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
1
mudassarkhan
2/17/2009 10:34:19 AM

wmec:

Sorry I've missed the error message above. When referring to 'span1' in Codebehind, we'll have this
Error 1 The name 'span1' does not exist in the current context

(even if we've declared it in the Markup)

 

Be sure to set runat="server" attribute in your span element so that you can gain access to it in the code behind by referencing its ID..

If intellisense  won't pick up in your codes when typing the ID of the span then try to use FindControl method like:

 

        HtmlGenericControl span = (HtmlGenericControl)Page.FindControl("SpanID");
span.InnerText = "Found Control!";
  
Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/18/2009 1:14:18 AM

Use Textbox1.Text = "some text" using server script or document.getElementById("Textbox1").value = "some text" using javascript.

Textbox controls do not have a innerHTML property.


Bind GridView to Dynamically created DataTable | Bind DataTable to DropDownList

My Blog
-1
shahed
2/18/2009 1:26:18 AM

Thanks all. I do have runat="server" in the codes below

Start.aspx Markup
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="Newsite._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Login Page</title>
    <link href="format.css" mce_href="format.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
    <form id="form1" runat="server">
   <b>LOGIN:</b><br />
   UserID: <asp:TextBox ID="LoginUserIDTextBox" runat="server"></asp:TextBox> <span id="Userid" runat="server" /> <br />
   Password: <asp:TextBox ID="PasswordTextBox" runat="server" TextMode="Password"> </asp:TextBox> <span id="loginpassword" runat="server" />
   <br /><br />
    <asp:Button ID="LoginButton" runat="server" Text="Login"
        onclick="LoginButton_Click" />
    <asp:Label runat="server" id="lblMessage" />
   <br /><br />
    </form>
</body>
</html>

Start.aspx.cs
using System;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;

namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    {
        TextBox LoginlblMessageTextBox, PasswordTextBox;
        Label lblMessage;
        string tempString;
        HtmlGenericControl Userid = (HtmlGenericControl) Page.FindControl("SpanID");

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            if (LoginlblMessageTextBox.Text == "")
            {
                Userid.InnerText = "(1) Please type your User ID...";
            }
            else
            {
                if (Session["UserName"] == "")
                {
                    lblMessage.Text = "(2) Incorrect User ID...";
                }
                else
                {
                    if (PasswordTextBox.Text == "")
                    {
                        loginpassword.Text = "(3) Please type in your password...";
                    }
                    else
                    {
                    }
                }
            }
        }

    }
}

Vinz, after I've used 'HtmlGenericControl' for taking the control of that ID, I got this error
Error 1 An object reference is required for the non-static field, method, or property 'System.Web.UI.Control.FindControl(string)'


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
1
wmec
2/18/2009 2:51:02 AM

wmec:
        HtmlGenericControl Userid = (HtmlGenericControl) Page.FindControl("SpanID");
 

You should use the ID of the Span that was set up in the ASPX.. so changed the line above to this below:

HtmlGenericControl Userid = (HtmlGenericControl) Page.FindControl("Userid");

Note:Userid is the ID of your Span..


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
1
vinz
2/18/2009 3:03:20 AM
I've changed it like this. But I still have the same issue. 

        HtmlGenericControl Userid = (HtmlGenericControl) Page.FindControl("Userid");


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
1
wmec
2/18/2009 3:57:29 AM

Did you get any error when using the code above?


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/18/2009 4:41:19 AM

wmec:
I've changed it like this. But I still have the same issue.

        HtmlGenericControl Userid = (HtmlGenericControl) Page.FindControl("Userid");

I don't think you need to search for it

you can directly access it using ID as you do for normal controls

span1.innerHTML = ""


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
-1
mudassarkhan
2/18/2009 4:46:00 AM

wmec:
TextBox LoginUserIDTextBox, PasswordTextBox, Userid;
 

Only remove this in your first reply code


We All move to our original place.
Don't forget.

Imran Baloch
1
imran_ku07
2/18/2009 5:30:12 AM

Then I'll have this issue

Error 1 The name 'spanid' does not exist in the current context 


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/18/2009 5:30:52 AM

wmec:

Then I'll have this issue

Error 1 The name 'spanid' does not exist in the current context 

 

It seems that you are still using the ID that don't exist in your page..

try this:

 

using System;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;

namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    {

        string tempString;
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            HtmlGenericControl Userid = (HtmlGenericControl) Page.FindControl("Userid");
            //or Access the Span element directly in your codes using its ID
            //Like Userid.InnerText = "something";
            if (LoginlblMessageTextBox.Text == "")
            {
                Userid.InnerText = "(1) Please type your User ID...";
            }
            else
            {
                if (Session["UserName"] == "")
                {
                    Userid.InnerText = "(2) Incorrect User ID...";
                }
                else
                {
                    if (PasswordTextBox.Text == "")
                    {
                        loginpassword.InnerText = "(3) Please type in your password...";
                    }
                    else
                    {
                    }
                }
            }
        }

    }
}
  
Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
1
vinz
2/18/2009 5:42:38 AM

Where is spanid in your aspx?



We All move to our original place.
Don't forget.

Imran Baloch
1
imran_ku07
2/18/2009 5:43:42 AM

try adding this one

aspx

<span id = "span1" runat = "server" ></span>

code

span1.InnerHtml = "Hello";

 


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
-1
mudassarkhan
2/18/2009 5:48:41 AM

Vinz, here are the programs.

Start.aspx Markup
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="Newsite._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Login Page</title>
    <link href="format.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
    <form id="form1" runat="server">
   <b>LOGIN:</b><br />
   UserID: <asp:TextBox ID="LoginUserIDTextBox" runat="server"></asp:TextBox> <span id="Userid" runat="server" /> <br />
   Password: <asp:TextBox ID="PasswordTextBox" runat="server" TextMode="Password"> </asp:TextBox> <span id="loginpassword" runat="server" />
   <br /><br />
    <asp:Button ID="LoginButton" runat="server" Text="Login"
        onclick="LoginButton_Click" />
    <asp:Label runat="server" id="lblMessage" />
   <br /><br />
    </form>
</body>
</html>

Start.aspx.cs
using System;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;


namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    {
        TextBox LoginlblMessageTextBox, PasswordTextBox;
        Label lblMessage;
        string tempString;
        HtmlGenericControl Userid = (HtmlGenericControl) Page.FindControl("Userid");

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            if (LoginlblMessageTextBox.Text == "")
            {
                Userid.InnerText = "(1) Please type your User ID...";
            }
            else
            {
                if (Session["UserName"] == "")
                {
                    lblMessage.Text = "(2) Incorrect User ID...";
                }
                else
                {
                    if (PasswordTextBox.Text == "")
                    {
                        loginpassword.Text = "(3) Please type in your password...";
                    }
                    else
                    {
                    }
                }
            }
        }

    }
}

I still have this problem!


Error 1 An object reference is required for the non-static field, method, or property 'System.Web.UI.Control.FindControl(string)'


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/18/2009 6:26:56 AM

wmec:
Error 1 An object reference is required for the non-static field, method, or property 'System.Web.UI.Control.FindControl(string)'
 

You are still using the same code.. Try to use the codes that I have posted above, Please check it.


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
1
vinz
2/18/2009 6:30:25 AM

Vinz and all, all of you did give me great help!
I still do have this problem when running that.

Server Error in '/' Application.
--------------------------------------------------------------------------------

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: 'Newsite._Default' is not allowed here because it does not extend class 'System.Web.UI.Page'.

Source Error:


Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="Newsite._Default" %>
Line 2: 
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 

Source File: /Start.aspx    Line: 1


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

 


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/18/2009 6:50:55 AM

Did you try what I suggested??


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
-1
mudassarkhan
2/18/2009 6:57:04 AM

wmec:
Parser Error Message: 'Newsite._Default' is not allowed here because it does not extend class 'System.Web.UI.Page'.
 

be sure that the value in the Inherits attribute match.. so if you have this:

namespace NewSite
{
public partial class _Default : System.Web.UI.Page
{
Then be sure that also have this in your Page directives
 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="NewSite._Default" %> 

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
1
vinz
2/18/2009 7:18:20 AM

Yes, I have both inside both files.

namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    ...

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="Newsite._Default" %>
...


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/18/2009 7:50:25 AM

wmec:

Yes, I have both inside both files.

namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    ...

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="Newsite._Default" %>

 

Newsite is different from NewSite. Your NameSpace is NewSite with capital S on it. So Change it it like this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="NewSite._Default" %>


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/18/2009 8:00:00 AM

Hi Vinz,
By the way I want to ask if the following way is only applicable to a Span ID.
(HtmlGenericControl)Page.FindControl


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
1
wmec
2/19/2009 8:39:51 AM

wmec:
By the way I want to ask if the following way is only applicable to a Span ID.
(HtmlGenericControl)Page.FindControl
 

No.. that also applies to an HTML element that do not represent in a specific .NET Framework class like <body>, <span>,<font> and so on..

You can look here for more information.


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/19/2009 9:05:19 AM

using System;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data.OracleClient;
using System.Security.Cryptography; // This was needed to make everything related to MD5 function

namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    {
        TextBox LoginUserIDTextBox, PasswordTextBox, Userid;
        string tempString;
        OracleConnection conn = new OracleConnection();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            if (LoginUserIDTextBox.Text == "")
            {
                Userid.Text= "(1) Please type your User ID...";
            }
            else
            {
                if (Session["UserName"] == "")
                {
                    Userid.Text= "(2) Incorrect UserID...";
                }
                else
                {
                    if (PasswordTextBox.Text == "")
                    {
                        loginpassword.Text= "(3) Please type in your password...";
                    }
                    else
                    {
                    }
                }
            }
        }

    }
}


Mark as Answer if it helped you

Gayathri
1
gayathri
2/19/2009 9:06:52 AM

My wonder is, how come we need to declare that Textbox - 'LoginUserIDTextBox' which is already defined inside the Markup, again in the Codebeind?


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/19/2009 9:14:41 AM

My wonder is, how come we need to declare that Textbox - 'LoginUserIDTextBox' which is already defined inside the Markup, again in the Codebeind.

Since we can refer to the defined Span ID in Codebehind, can we do the same against the Textboxes?

If we declare that again in Codebehind, does it mean we're referring to the same object in the Markup?


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/19/2009 9:14:50 AM

wmec:
My wonder is, how come we need to declare that Textbox - 'LoginUserIDTextBox' which is already defined inside the Markup, again in the Codebeind.
 

Basically, We don't need to declare an object (TextBox, Button) once it is already declared in the mark up.. If the control is located direclty on the page then we can simply access that control in code behind by using its ID as a referece.. Like for instance you have a TextBox declared and the ID is set to TextBox1 then we can simple reference that ID in our codes.

If we need to access a control that was resided in a Naming Container or DataBound Control like Grid, FormViews then  we can use FindControl method. But since we used FindControl then that's the time that we need to create an Object for casting the control that was found since we cannot directly used the ID of the control as a reference.. for example we need to access a TextBox that's inside the GridView template columns then we can use this codes below:

TextBox tb = (TextBox)GridView1.Rows[0].Cells[0].FindControl("TextBox1");

wmec:
Since we can refer to the defined Span ID in Codebehind, can we do the same against the Textboxes?
 

YES!


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
1
vinz
2/19/2009 9:48:07 AM

Many thanks Vinz. How to refer to the following textbox that is defined in the Markup like this, in the Codebehind?
<asp:TextBox ID="LoginUserIDTextBox" runat="server">


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
-1
wmec
2/19/2009 9:54:04 AM

wmec:
How to refer to the following textbox that is defined in the Markup like this, in the Codebehind?
<asp:TextBox ID="LoginUserIDTextBox" runat="server">
 

Since the ID of the TextBox is LoginUserIDTextBox then you can reference that control like this:

LoginUserIDTextBox.Text = "Something";

You can also type the ID of the control in code behind so that you call see all the available properties and methods for that control..

PS: Don't forget to mark those helpful post which helps you as answer(s) for future references..

Thanks! 

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/19/2009 10:03:02 AM

But then I'll have this issue with the following codes
Error 1 The name 'PasswordTextBox' does not exist in the current context

using System;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;

namespace NewSite
{
    public partial class _Default : System.Web.UI.Page
    {
        string tempString;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            HtmlGenericControl Userid = (HtmlGenericControl)Page.FindControl("Userid");
            HtmlGenericControl loginpassword = (HtmlGenericControl)Page.FindControl("loginpassword");

            if (LoginUserIDTextBox.Text == "")
            {
                Userid.InnerText = "(1) Please type your User ID...";
            }
            else
            {
                if (Session["UserName"] == "")
                {
                    Userid.InnerText = "(2) Incorrect User ID...";
                }
                else
                {
                    if (PasswordTextBox.Text == "")
                    {
                        loginpassword.InnerText = "(3) Please type in your password...";
                    }
                    else
                    {
                    }
                }
            }
        }

    }
}


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
Mail it to me at HuaMin_Chen@Ymail.com for the client-server projects
2
wmec
2/19/2009 10:12:29 AM

wmec:
But then I'll have this issue with the following codes
Error 1 The name 'PasswordTextBox' does not exist in the current context
 

Are you sure that you have TextBox in the mark up that has the ID PasswordTextBox? Also does intellisense picks up when you type that ID in code behind?

If intellisense won't pick up then try to replace that TextBox with a new one, compile your application and access it again..


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
-1
vinz
2/19/2009 10:21:44 AM

Actually Your .aspx Class is converted to a Class at run time that Inherits with your Code Behind,

    Thereofore <asp:TextBox  Converted into TextBox Object, <asp:Label into HTMLGeneric Object, check your Designer File.

     you can dig around in the c:\Windows\Microsoft.NET\Framework\v2.0.50727\
    TemporaryASP.NET Files directory to see the automatically generated classes.

Also Note that all are Protected therefore they can be access in Child Class.


We All move to our original place.
Don't forget.

Imran Baloch
-1
imran_ku07
2/19/2009 10:49:56 AM
Reply:

Similar Artilces:

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" runat="server" Font-Names="Arial" Font-Size="11px" HorizontalAlign="Left" ItemStyle-Font-Size="x-small" HeaderStyle-Font-Bold="True"HeaderStyle-Font-Size="x-small" AlternatingItemStyle-BackColor="#FFFFFF" Cellpadding="0" BorderWidth="0"AutoGenerateColumns="False" BorderStyle="None" GridLines="None" BorderColor="#404040" Width="75%"DataKeyField="FacilityID"OnUpdateCommand="MyDataGrid_UpdateCommand"OnCancelCommand="MyDataGrid_CancelCommand"OnEditCommand="DG_Combo_Edit"> <AlternatingItemStyle BackColor="#FFFFFF"></AlternatingItemStyle><ItemStyle Font-Size="X-Small"></ItemStyle><HeaderStyle Font-Size="X-Small" Font-Bold="True" ForeCo...

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" title="HR" %><asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">    HR<br /><script language =javascript  type="text/javascript">function Calculate(HoursPerUnit, PeoplePerUnit, TotalHoursPerUnit){    TotalHoursPerUnit.value = HoursPerUnit.value * PeoplePerUnit.value;}   </script>    <br />    <asp:LinkButton ID="CheckAll" runat="server">Check All</asp:LinkButton>    <asp:LinkButton ID="UncheckAll" runat="server">Uncheck All</asp:LinkButton><br />    &nbsp;<br />    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="HR...

'System.Web.UI.WebControls.Panel' does not contain a definition for 'drpData'
Hi i have the following problem: Compiler Error Message: CS0117: 'System.Web.UI.WebControls.Panel' does not contain a definition for 'drpData' Source Error: Line 59: strvBilled = filepath.ToString(); Line 60: strvPris = tbvPris.Text; Line 61: strvKategori = tbvKategori.drpData.SelectedItem.Value.ToString(); Line 62: strSQL = "INSERT INTO varelist (vNummer, vNavn, vBeskriv, vBilled, vPris, vKategori) Values ("; Line 63: strSQL += strvNummer + ", '"; It should come from this list: <asp:panel ID="tbvKategori" r...

'System.Web.UI.WebControls.Label' does not contain a definition for 'Invoke'
I am making an asyncronous call to a web service. When the callback happens and my delegate is called, I want to set a text value on a label on my page. In order to do this I need to use Label1.Invoke -- However, when I compile this I get an error'System.Web.UI.WebControls.Label' does not contain a definition for 'Invoke'I thought all controls should have an Invoke method on it.. I don't understand why I get this error? Any one experience the same thing or have any clue as to what is going on? // we must invoke to get back to the UI thread...this.Label1.Invoke(new La...

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

CS0117: 'System.Web.UI.WebControls.Calendar' does not contain a definition for 'SelectedValue'
am I missing some class info somewhere perhaps?Any ideas or suggestions would be appreciated!error being thrown here:Line 16:                   Calendar1.SelectedValue = ("DueDate"); here is my current code:<%@ Page EnableViewState="true" Language="C#" AutoEventWireup="true" Inherits="CommunityServer.Controls.CSThemePage" MasterPageFile="tasks.Master" %><%@ Import Namespace="CommunityServer.Components" %><%@ Register TagPrefix="CSUserControl" TagName="AdTop" src="../Themes/leanandgreen/Common/Ad-Top.ascx" mce_src="../Themes/leanandgreen/Common/Ad-Top.ascx" %><%@ Register TagPrefix="CSUserControl" TagName="AdBottom" src="../Themes/leanandgreen/Common/Ad-Bottom.ascx" mce_src="../Themes/leanandgreen/Common/Ad-Bottom.ascx" %> <script language="cs" runat="server">          string Username = CSContext.Current.User.Username;          void Page_Load()          {              TextBox1.Text = Username;          }       ...

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

'System.Web.HttpRequest' does not contain a definition for 'form'
Hello all. .NET 2.0 newbie here.... What I'm trying to do is learn how to use the LoadVars() in actionscript. Here is the .NET / C#/ html code  1 <form id="form1" runat="server"> 2 <div> 3 <% 4 if (Request.form("userName") == "Cameron") 5 { 6 Response.Write("&aspvar=it is You!"); 7 } 8 else 9 { 10 Response.Write("&aspvar=you are not Cameron&"); 11 } 12 13 %> ...

Error Message CS0117: 'System.Web.UI.WebControls.DropDownList' does not contain a definition for 'Text'
I get this Error Message: ( CS0117: 'System.Web.UI.WebControls.DropDownList' does not contain a definition for 'Text' ) from my Register.aspx when I try to open it. I've added a DropDownList to the Register.aspx page and it throws me this (CS0117 Error message). Could use some help on this. Don't know where and how to correct this problem. If I remove the Dropdownlist and recompile the CustomersDB.cs file, and run the Register.aspx page again then it opens up. But as soon as I add the DropdownList I receive this (Error CS0117). Would appreciate any help. Thank You. TIA. Here is the co...

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

'System.Web.UI.Control' does not contain a definition for 'DataItem'
Hi, I am getting this error does anyone knows how to solve this :DHighOnCodingWanna get high! Show us the code that produces this error. Other than the exactness of the error, which explains what is exactly happening, we can't see why this is happening without seeing your code.David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as Answer' when i...

'System.Web.UI.Control' does not contain a definition for 'DataItem'
Hi, I am recieving this error: 'System.Web.UI.Control' does not contain a definition for 'DataItem' What iam trying to do is when a user clicks the hyperlink column in the datagrid then the ID of that user is send to another page and I need to run the Query or something and bind the Label on the page 2 with the name of the Person. So I am using the HTML view and writing something like this : '<%# DataBinder.Eval(Container.DataItem,"Name") %> ' here is my code behind file so how can i bind the Name of the person with the label: private void Page_Lo...

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

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

'Image' is an ambiguous reference between 'System.Web.UI.WebControls.Image' and 'System.Drawing.Image'
In my aspx page, I have the following snippet: <%@ Page Language="C#" %><%@ Import Namespace="System.IO" %><%@ Import Namespace="System.Drawing" %>     public System.Drawing.Image Test()    {      ...    }  I keep getting the 'Image' is an ambiguous reference between 'System.Web.UI.WebControls.Image' and 'System.Drawing.Image' error in my Test function (which returns an Image). How do I fix this? Right which is possible; use the full...

CS0104: 'Image' is an ambiguous reference between 'System.Web.UI.WebControls.Image' and 'System.Drawing.Image'
 CS0104: 'Image' is an ambiguous reference between 'System.Web.UI.WebControls.Image' and 'System.Drawing.Image'   <%@ Page Language="C#" %> <%@ Import Namespace="System.Drawing" %> <%@Import Namespace="System.Drawing.Imaging" %>   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script type="text/C#" runat="server"> void Page_Load() {//The @ means "Ignore escape characters!" in the following string. It is a verbatim //literal string - any backslashes (and newlines) in...

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

'System.Web.UI.WebControls.DataListItem.DataItem' is a 'property' but is used like a 'method'
 HI I have a datalist with OnItemDataBoundI get the following error when I try to get the DataItem 'System.Web.UI.WebControls.DataListItem.DataItem' is a 'property' but is used like a 'method' , any idea what's wrong with the line ?  public void Item_Bound(object sender, DataListItemEventArgs e)    {        Label originalPriceLabel;        if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)        {            originalPriceLabel = ((Label)(e.Item.FindControl("originalPriceLabel")));            decimal result = Convert.ToDecimal(e.Item.DataItem("originalPrice"));            if (result < 1)            {                originalPriceLabel.Visible = false;            }            else            {                originalPriceLabel.Visible = true;      &nb...

Error showing up: Unable to cast object of type 'System.Web.UI.WebControls.TextBox' to type 'System.IConvertible'.
Hi, I am trying to pass date values from two textboxes in a stored procedure from ASP.net page. However, it seems it is not passing the date properly. I am getting the following error at the following line: cmd_r.Parameters("@initial_est_date").Value = Convert.ToDateTime(Textbox1)  and the error is as stated in the title. I would appreciate any help to resolve this. Thanks  CODE:<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %><%@ Import Namespace="System.Data.Common" %> <%@ I...

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

DataBinding: 'System.Web.UI.WebControls.DropDownList' does not contain a property with the name 'Value'.
i'm using gridview and i'm changing the GRIDVIEW data based on what i have selected in my dropdownlist<asp:DropDownList ID="ddlPageItems" runat="server" Font-Names="Verdana" Font-Size="11px"AutoPostBack="True" OnSelectedIndexChanged="ddlPageItems_SelectedIndexChanged"><asp:ListItem Text="All" Value="0"></asp:ListItem><asp:ListItem Text="ABGY" Value="5"></asp:ListItem><asp:ListItem Text="AFT" Value="10" Selected="True"&...

Web resources about - 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'InnerHtml' and ... - asp.net.web-forms

Resources last updated: 3/5/2016 7:39:34 PM