asp.net - using VB.NET Shared Property in inline-code: `<% =<property> %>` -
i'm using shared property add text div.
step of procedure is:
- define
shared property submitted= "not submitted"inmyclass.vb. create
mymasterpage.masterdiv:<div><%=submited%></div>create
page1.aspxcode-behind:protected sub page_load (...) if action="submitted" submitted="submitted" end if end sub
so far, fine, problem when master loads again , submited keeps value , show:
<div>submitted</div>
i need 1 time specified submitted "submitted" ,next time submited called, returns "not submited" (i.e. it's orginal value)
<div>not submitted</div>
don't use shared variable or property this.
a shared (static in c#) variable shared across users of web application. imagine 2 users , b accessing web site @ same moment. doing cause user see supposed user b, , vice versa. wouldn't want that, you?
the solution simple: don't make property shared. if have trouble accessing instance (= non-shared) property within code, suggest open separate question on that. making property shared not solution.
Comments
Post a Comment