473,382 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 1502
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class...
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
2
by: THY | last post by:
Hi, I am having some problem, I declare few variable in a public module and use them in the web application. But after that I found that the variable declared in public variable =...
10
by: darrel | last post by:
I'm still trying to sort out in my head the differences between public and shared when referring to declaring properties or variables. This is my understanding: shared - akin to a 'global'...
3
by: Tor Inge Rislaa | last post by:
How to use a public variable In VB.6.0 I could in the declaration part of a form declare a public variable, then assign a value to the variable, open a new form and address the variable and read...
5
by: Neil Steventon | last post by:
Hi, I am new to VB.net , well the objects concept anyway and was wondering if there were any good articles / turorials on when and why you would use certain declarations such as Private test...
9
by: Stefan De Schepper | last post by:
Should I use: Private m_Name As String Public Property Name() As String Get Return m_Name End Get Set(ByVal Value As String) m_Name = Value
11
by: dgk | last post by:
If I have a class with a public variable, isn't this the same as a private variable with a property? ie, isn't this: Public Class MyTest Public MyVar as String End Class the same as this: ...
10
by: timber910 | last post by:
OK, I've searched all over and used the help on the VBA editor. Helped a little but I'm not getting close enough to see where I'm going wrong. I need a public variable that I will be able to use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.