locked
reference to a non-shared member requires an object reference RRS feed

  • Question

  • User-1585918428 posted

    Dear Gurus,

    I have the above mentioned error on the following code:-

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

    But I have no problem compiling my asp.net in visual web developer. But after I add a textbox to my page and adjust the width & length of the textbox. I have problem compiling the asp page. If I don't adjust the width & length of the textbox. It has no problem compiling the asp page

    Why this happen? how do i resolve it? thanks in advance

    garf

    Saturday, September 15, 2018 3:15 AM

All replies

  • User283571144 posted

    Hi garfchong,

    According to your description, I have created a test demo, it works well.

    Could you please tell how you  adjust the width & length of the textbox?

    Below is my test demo:

    ASPX:

    <%@ Page Language="C#" AutoEventWireup="false" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:TextBox ID="TextBox1" runat="server" Height="155px" Width="245px"></asp:TextBox>
            </div>
        </form>
    </body>
    </html>
    

    Result:

    Best Regards,

    Brando

    Monday, September 17, 2018 3:24 AM
  • User-1585918428 posted

    Thanks for reply Brando. I used mouse to pull and drag the textbox to my desire length and width... 

    I create a new project, and use the same code, it works. I also wondering whats wrong...

    Tuesday, September 18, 2018 1:20 AM
  • User283571144 posted

    Hi garfchong,

    Could you please share your application for us to reproduce your issue?

    If possible, I suggest you could upload the project to the onedrive or github.

    Best Regards,

    Brando

    Tuesday, September 18, 2018 5:28 AM