Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. urgent

urgent

Scheduled Pinned Locked Moved ASP.NET
sysadmintoolsquestionlearning
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    harithadotnet
    wrote on last edited by
    #1

    In my script i set a variable called impath="whatever.jpg"; ex: <% string impath; impath="wallpaper/" + idvalue + " /thumbs/" + cnt1 + ".jpg";%> I want to be able to use this variable in a href command such as:- src=impath ![](<%=impath%) runat="server" > but of course this syntax is wrong.. How would I define the img src line to use the variable? if u know ans plz let me know ASAP Haritha

    K N S 3 Replies Last reply
    0
    • H harithadotnet

      In my script i set a variable called impath="whatever.jpg"; ex: <% string impath; impath="wallpaper/" + idvalue + " /thumbs/" + cnt1 + ".jpg";%> I want to be able to use this variable in a href command such as:- src=impath ![](<%=impath%) runat="server" > but of course this syntax is wrong.. How would I define the img src line to use the variable? if u know ans plz let me know ASAP Haritha

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      Set it up as a public variable in your code behind. Then you can access it with the <% %> You just need to make sure you do some sort of Page.Bind so that the <% %> gets translated to your value. Hope that helps. Ben

      N 1 Reply Last reply
      0
      • H harithadotnet

        In my script i set a variable called impath="whatever.jpg"; ex: <% string impath; impath="wallpaper/" + idvalue + " /thumbs/" + cnt1 + ".jpg";%> I want to be able to use this variable in a href command such as:- src=impath ![](<%=impath%) runat="server" > but of course this syntax is wrong.. How would I define the img src line to use the variable? if u know ans plz let me know ASAP Haritha

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        Urgent is not a acceptable message title. Read the how to get answers post at the top of this forum. You may get more/better responses that way.


        only two letters away from being an asset

        1 Reply Last reply
        0
        • K kubben

          Set it up as a public variable in your code behind. Then you can access it with the <% %> You just need to make sure you do some sort of Page.Bind so that the <% %> gets translated to your value. Hope that helps. Ben

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          A proper design would be to use properties rather than public fields.


          only two letters away from being an asset

          K 1 Reply Last reply
          0
          • N Not Active

            A proper design would be to use properties rather than public fields.


            only two letters away from being an asset

            K Offline
            K Offline
            kubben
            wrote on last edited by
            #5

            True enough. I guess I wasn't sure if I wanted to go into the detail of creating a property. Ben

            1 Reply Last reply
            0
            • H harithadotnet

              In my script i set a variable called impath="whatever.jpg"; ex: <% string impath; impath="wallpaper/" + idvalue + " /thumbs/" + cnt1 + ".jpg";%> I want to be able to use this variable in a href command such as:- src=impath ![](<%=impath%) runat="server" > but of course this syntax is wrong.. How would I define the img src line to use the variable? if u know ans plz let me know ASAP Haritha

              S Offline
              S Offline
              Saifi Hasan
              wrote on last edited by
              #6

              This is correct however you can add single Quotes or double quotes

              Nobody is perfect i'm Nobody

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups