471,312 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,312 software developers and data experts.

Seeing a public variable

Hi

Hope someone can help me with this.Working with C#.net 2003

With my html I wanna display the string _controlMessage that was set in
my code behind

#region Class Variables
public string _controlMessage = "testing message";
#endregion Class Variables

#region Properties
public string Message
{
get
{
return _controlMessage;
}
set
{
_controlMessage = value;
}
}
#endregion Properties

<BODY>
<script type="text/javascript">
var globalHTML;

Function popup(str)
{
globalHTML="<html><body><form><textarea>"+str
+"</textarea><br><input type='button' value='Close'"
+"onclick='self.close()'></form></body></html>";
window.open("javascript:opener.globalHTML",
"myPopup",
"width=400,height=300").focus();
}
</script>

<a href="#"></TEXTAREA><IMG border="none"
onclick="popup(_controlMessage)" style="WIDTH: 24px; HEIGHT: 24px"
height="24"
src="../../Images/knowledgebase.gif" width="24"></a>
</BODY>

Feb 20 '06 #1
3 1408
Don't woory, its sorted.Thanks anyway

Feb 20 '06 #2
Hi
You can not use private variables in markup. code-behinds fields must
be protected or public(_mcontrolMessage), or you can use property
(ControlMessage) instead.

tnx
A.Hadi

Feb 20 '06 #3
"Aboulfazl Hadi" <AH****@gmail.com> a écrit dans le message de news:
11*********************@g44g2000cwa.googlegroups.c om...

| You can not use private variables in markup. code-behinds fields must
| be protected or public(_mcontrolMessage), or you can use property
| (ControlMessage) instead.

The OP's code showed _mcontrolMessage as being public not private. In this
case, I wonder why they declared a property as well :-)

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Feb 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Zap | last post: by
10 posts views Thread by darrel | last post: by
3 posts views Thread by Tor Inge Rislaa | last post: by
5 posts views Thread by Neil Steventon | last post: by
9 posts views Thread by Stefan De Schepper | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.