A
Annie
hello guys,
I have a header file in the form of user control (.ascx) that all my pages
inherit from it. I have a textbox that i need to access it
from all the pages actually i show there user details there and needs to
update it. So i set this textbox as Public and Static. The
code compiles fine and the textbox is accessable to all pages however i have
the following compilation errr:
Compiler Error Message: CS0176: Static member 'MobileShop.Header.txtClient'
cannot be accessed with an instance reference; qualify it with a type name
instead
Source Error:
Line 1: <%@ Control Language="c#" AutoEventWireup="false"
Codebehind="Header.ascx.cs" Inherits="MobileShop.Header"
targetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
Line 2: <P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PAGE-BREAK-BEFORE:
auto; PADDING-BOTTOM: 0px; MARGIN: 0px; PAGE-BREAK-AFTER: auto; CLIP:
rect(0px auto auto 0px); PADDING-TOP: 0px; POSITION: static; TEXT-ALIGN:
left"
Line 3: align="left">
Source File: http://localhost/MobileShop/Header.ascx Line: 1
I don't know why this error please help
TIA
I have a header file in the form of user control (.ascx) that all my pages
inherit from it. I have a textbox that i need to access it
from all the pages actually i show there user details there and needs to
update it. So i set this textbox as Public and Static. The
code compiles fine and the textbox is accessable to all pages however i have
the following compilation errr:
Compiler Error Message: CS0176: Static member 'MobileShop.Header.txtClient'
cannot be accessed with an instance reference; qualify it with a type name
instead
Source Error:
Line 1: <%@ Control Language="c#" AutoEventWireup="false"
Codebehind="Header.ascx.cs" Inherits="MobileShop.Header"
targetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
Line 2: <P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PAGE-BREAK-BEFORE:
auto; PADDING-BOTTOM: 0px; MARGIN: 0px; PAGE-BREAK-AFTER: auto; CLIP:
rect(0px auto auto 0px); PADDING-TOP: 0px; POSITION: static; TEXT-ALIGN:
left"
Line 3: align="left">
Source File: http://localhost/MobileShop/Header.ascx Line: 1
I don't know why this error please help
TIA