dynamically creating image name.

Results 1 to 2 of 2

Thread: dynamically creating image name.

  1. #1
    Join Date
    Dec 1969

    Default dynamically creating image name.

    I have several menus in the lefthand side frame and next to the menu I have a small gif file that shows (different for each menuname)<BR>I have created the menu dynamically ....i.e. I findout what are the menus the user has access to and display accordingly.Now my challenge is how do I find the image name also.<BR><BR>Example: For Home menu I have Menu name as "home" and the image name to appear next to it is bhome.gif<BR>so to find the image name I did the following....<BR><BR>Dim img<BR>img = "b"&rs("menu")& ".gif"<BR>&#039;this displays the image name correctly ....bhome.gif or blibrary.gif etc.<BR>But when I put the image tag <BR>&#060;IMG src="navbar/&#060;%= img%&#062;" width=32 height=32 border=0&#062;<BR>The image doesn&#039;t get displayed though I have the right path. <BR>I right clicked on the image and checked properties I got the following...<BR>navbar/bHome%20%20%20.gif<BR>how do I get navbar/bHome.gif<BR><BR>Thank you so much for the help!!<BR><BR>

  2. #2
    Michael Blythe Guest

    Default RE: dynamically creating image name.

    It looks like the name is coming out of the DB right padded with spaces (is the field in the DB set as char(), rather than varchar()), so you can call trim on the recordset field to remove all spaces before and after the gif name:<BR><BR>img = "b" & trim(rs("menu")) & ".gif"<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts