Question : aspx/c# looping through data from within body

This aspx/c# stuff keeps dogging me as I am now trying to rewrite code so it dynamically lists my data content, but am getting these invalid token errors when attempting to open my database connection as follows:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1519: Invalid token '(' in class, struct, or interface member declaration

Source Error:

Line 61:             myConnection.Open();

Source File: C:\Inetpub\wwwroot\bhhlegal\news2.aspx    Line: 61

see below code as I'm not sure if I have to private some of the code or not
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:

Answer : aspx/c# looping through data from within body

>> '#main: sites/default/files/imagecache/thumbnail_square/images/city_clock.jpg '] }" src="sites/default/files/imagecache/thumbnail_square/images/city_clock.jpg"/>

seems you have an extra blank space

I would probably change your lines
<?php
$path = $fields['field_artphoto_fid']->content;
$pur_path = strip_tags($path);
$node_id = $row->nid;  
?>
to
<?php
$path = $fields['field_artphoto_fid']->content;
$pur_path = trim(strip_tags($path)); //remove any extra space at start or end
$node_id = $row->nid;  

$debug=true; // easy to change
if ($debug) { echo "Node ID is [$node_id] - Path is [$pur_path]<br>";};
?>

and then
<a href="/node/<? print $node_id ?>"><img id="Thumb_1" class="swapImageDisjoint { sin: ['#main:<? print $pur_path ?>'], sout: ['#main:<? print $pur_path ?>'] }" src="<? print $pur_path ?>" /></a>

should work (I use echo instead of print but it does not matter). (Note: I use <?php just to be sure..)

If it does not work and still keep adding extra space, change course and replace the above line with
<a href="/node/<?php print $node_id ?>"><img id="Thumb_1" class="swapImageDisjoint { sin: ['<?php echo "#main:$pur_path" ?>'], sout: ['<?php echo "#main:$pur_path" ?>'] }" src="<?php print $pur_path ?>" /></a>

Random Solutions  
 
programming4us programming4us