I've got a datagrid with a HyperLinkColumn in it. What I want to do is take a part number (in another column) and link to an image of the part by adding .jpg to the end of it. I'm using "/images{0}.jpg" as the URL format string.
The problem is that the result I get has the part number padded out with spaces, to the field width defined in the database. So if the pn is "12345", I get "images/12345%20%20%20%20%20%20%20.jpg". If I just use "/images{0}" as the URL format string, there's no padding. Any tricks for getting rid of this? It seems to be happening in the hyperlink itself, for example if I edit the row with an edit/update/cancel column, the spaces are not there in the data.
I also tried changing the hyperlink column to a button so I could write code behind it, but I couldn't figure out how to get a browser window open on the client from this server-side code.
The problem is that the result I get has the part number padded out with spaces, to the field width defined in the database. So if the pn is "12345", I get "images/12345%20%20%20%20%20%20%20.jpg". If I just use "/images{0}" as the URL format string, there's no padding. Any tricks for getting rid of this? It seems to be happening in the hyperlink itself, for example if I edit the row with an edit/update/cancel column, the spaces are not there in the data.
I also tried changing the hyperlink column to a button so I could write code behind it, but I couldn't figure out how to get a browser window open on the client from this server-side code.