I have the following line of code in a code-behind file. It's part of a
event which is run when a user clicks an asp:imagebutton on a page.
tblMainImage.Rows[0].Cells[0].Attributes.Add("background",
"../images/albums/" & Request.QueryString("d") & "/" &
RowView("strFilename") & ".jpg")
However, when I view the page I get an error message with this line
highlighted, saying:
'Property access must assign to the property or use its value.'
Am I not assigning to the property with the line I'm using??? I'm adding the
attribute so surely I'm assigning to it? I've looked at lots of past posts
and they all seem to indicate using the syntax above. So where am I going
wrong?! Thanks in advance to anyone who can point me in the right direction.
Haydn 5 1177
"Haydnw" <ha****@removeyahooremove.com> wrote in message
news:ur*************@TK2MSFTNGP12.phx.gbl... I have the following line of code in a code-behind file. It's part of a event which is run when a user clicks an asp:imagebutton on a page.
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "../images/albums/" & Request.QueryString("d") & "/" & RowView("strFilename") & ".jpg")
However, when I view the page I get an error message with this line highlighted, saying:
'Property access must assign to the property or use its value.'
Am I not assigning to the property with the line I'm using??? I'm adding
the attribute so surely I'm assigning to it? I've looked at lots of past posts and they all seem to indicate using the syntax above. So where am I going wrong?! Thanks in advance to anyone who can point me in the right
direction.
Haydn,
Simplify the situation by replacing the attribute value with "x" and see
what happens:
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "x")
--
John Saunders
johnwsaundersiii at hotmail
I'm a bit confused here - if this is VB.NET code, shouldn't those []
brackets be () ones?
Steve
"Haydnw" <ha****@removeyahooremove.com> wrote in message
news:ur*************@TK2MSFTNGP12.phx.gbl... I have the following line of code in a code-behind file. It's part of a event which is run when a user clicks an asp:imagebutton on a page.
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "../images/albums/" & Request.QueryString("d") & "/" & RowView("strFilename") & ".jpg")
However, when I view the page I get an error message with this line highlighted, saying:
'Property access must assign to the property or use its value.'
Am I not assigning to the property with the line I'm using??? I'm adding
the attribute so surely I'm assigning to it? I've looked at lots of past posts and they all seem to indicate using the syntax above. So where am I going wrong?! Thanks in advance to anyone who can point me in the right
direction. Haydn
Hi John,
Thanks for the quick response! I had tried something similar, but have just
tried it again with "x" to be on the safe side. I get exactly the same error
(obviously with all my concatenation junk in the first post replaced with
"x").
Any other ideas? :) I'm starting to go out of my mind trying to figure this
one out!!
Cheers,
Haydn
"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl... "Haydnw" <ha****@removeyahooremove.com> wrote in message news:ur*************@TK2MSFTNGP12.phx.gbl... I have the following line of code in a code-behind file. It's part of a event which is run when a user clicks an asp:imagebutton on a page.
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "../images/albums/" & Request.QueryString("d") & "/" & RowView("strFilename") & ".jpg")
However, when I view the page I get an error message with this line highlighted, saying:
'Property access must assign to the property or use its value.'
Am I not assigning to the property with the line I'm using??? I'm adding the attribute so surely I'm assigning to it? I've looked at lots of past
posts and they all seem to indicate using the syntax above. So where am I
going wrong?! Thanks in advance to anyone who can point me in the right direction.
Haydn,
Simplify the situation by replacing the attribute value with "x" and see what happens:
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "x")
-- John Saunders johnwsaundersiii at hotmail
Erm...yes. Yes they should.
*Shuffles off into the corner looking sheepish...*
Cheers guys. :)
H
"Steve Willcock" <st***@N-O-S-P-A-Mwillcockconsulting.com> wrote in message
news:cf*******************@news.demon.co.uk... I'm a bit confused here - if this is VB.NET code, shouldn't those [] brackets be () ones?
Steve
"Haydnw" <ha****@removeyahooremove.com> wrote in message news:ur*************@TK2MSFTNGP12.phx.gbl... I have the following line of code in a code-behind file. It's part of a event which is run when a user clicks an asp:imagebutton on a page.
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "../images/albums/" & Request.QueryString("d") & "/" & RowView("strFilename") & ".jpg")
However, when I view the page I get an error message with this line highlighted, saying:
'Property access must assign to the property or use its value.'
Am I not assigning to the property with the line I'm using??? I'm adding the attribute so surely I'm assigning to it? I've looked at lots of past
posts and they all seem to indicate using the syntax above. So where am I
going wrong?! Thanks in advance to anyone who can point me in the right direction. Haydn
AttributeCollection coll = tblMainImage.Rows[0].Cells[0].Attributes;
coll.Add("background", "x");
--
John Saunders
johnwsaundersiii at hotmail
"Haydnw" <ha****@removeyahooremove.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl... Hi John,
Thanks for the quick response! I had tried something similar, but have
just tried it again with "x" to be on the safe side. I get exactly the same
error (obviously with all my concatenation junk in the first post replaced with "x").
Any other ideas? :) I'm starting to go out of my mind trying to figure
this one out!!
Cheers, Haydn "John Saunders" <jo**************@notcoldmail.com> wrote in message news:OK**************@TK2MSFTNGP12.phx.gbl... "Haydnw" <ha****@removeyahooremove.com> wrote in message news:ur*************@TK2MSFTNGP12.phx.gbl... I have the following line of code in a code-behind file. It's part of
a event which is run when a user clicks an asp:imagebutton on a page.
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "../images/albums/" & Request.QueryString("d") & "/" & RowView("strFilename") & ".jpg")
However, when I view the page I get an error message with this line highlighted, saying:
'Property access must assign to the property or use its value.'
Am I not assigning to the property with the line I'm using??? I'm
adding the attribute so surely I'm assigning to it? I've looked at lots of past posts and they all seem to indicate using the syntax above. So where am I going wrong?! Thanks in advance to anyone who can point me in the right
direction.
Haydn,
Simplify the situation by replacing the attribute value with "x" and see what happens:
tblMainImage.Rows[0].Cells[0].Attributes.Add("background", "x")
-- John Saunders johnwsaundersiii at hotmail
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: James Lapalme |
last post by:
Hy,
I understand that attribute programming is used to add metadata to the code,
but since they are implemented with a class and we can extend that class, we
should be able to do any normal class...
|
by: Grant Edwards |
last post by:
I'm using xml.sax to parse the "datebook" xml file generated by
QTopiaDesktop. When I look at the xml file, some of the
attribute strings have newlines in them (as they are supposed
to).
...
|
by: Martin Plantec |
last post by:
Hi again,
If I may, I have another, slightly more complex, XSLT question. (I'm
learning, but it's not as easy as I would have thought!) I would like a
rule that says: for every element that has...
|
by: Arjen |
last post by:
Hi,
I have a class with some attributes. For example class person with name as
attribute.
I have add multiple persons in an arraylist.
Now I need a function to get/find a person by the name...
|
by: ADavidson |
last post by:
I'm getting a {"Parser Error: The Runat attribute must have the value
Server." } error when I try to get the Server.GetlastError() in the
Global.asax codebehind.
Why am I getting this?
I...
|
by: gary.goodwin |
last post by:
HI
I am trying to understand Attribute usage. For example the class
SerializableAttribute is a class correct? So why when it is actually u
sed the "Attribute" portion of the name is dropped. The...
|
by: perspolis |
last post by:
Hi all
I created a Web Project but it dosen't support some properties of HTML tags
and it gives me following error:
Attribute 'height' is not a valid attribute of element 'table'
I don't know...
|
by: =?Utf-8?B?U2VyZ2lvIE1hcnRpbnM=?= |
last post by:
Hi.
I have an ActiveX DLL, developed in Visual Basic 6.0 and I need to use that
DLL inside an ASP.NET application, developed in Visual Basic .Net 2003.
My problem is that in my machine I get the...
|
by: Nathan Sokalski |
last post by:
I am attempting to create icons for controls I have created using VB.NET by
using the System.Drawing.ToolboxBitmap attribute. I have managed to do this
in C# by specifying the path to the *.ico...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |