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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to take image path into variable

how to take image path into variable

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorial
8 Posts 5 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

    HI In pageLoad of asp.net app i am getting the variables as string m=strPart ; (m="1" getting this) string k ; k=Convert.ToString(Session["impath"]); (k="pg/photo") now i want to take string ppath as "pg/photo/sample(this is folder name)/1.jpg" my code is string ppath=" ' + k + ' "/"sample"/" ' + m + ' ".jpg; but i am getting the erroe as operator " / " can't be applied for operands of type string and string plz help me thanks in advance Haritha

    Haritha

    C A S S 4 Replies Last reply
    0
    • H harithadotnet

      HI In pageLoad of asp.net app i am getting the variables as string m=strPart ; (m="1" getting this) string k ; k=Convert.ToString(Session["impath"]); (k="pg/photo") now i want to take string ppath as "pg/photo/sample(this is folder name)/1.jpg" my code is string ppath=" ' + k + ' "/"sample"/" ' + m + ' ".jpg; but i am getting the erroe as operator " / " can't be applied for operands of type string and string plz help me thanks in advance Haritha

      Haritha

      C Offline
      C Offline
      Chetan Ranpariya
      wrote on last edited by
      #2

      Hi, I think ur ppath should be assigned like following. string ppath="'" + k + "'/sample/'" + m + ".jpg"; I hope this will help u.

      Thanks and Regards, Chetan Ranpariya

      H 1 Reply Last reply
      0
      • C Chetan Ranpariya

        Hi, I think ur ppath should be assigned like following. string ppath="'" + k + "'/sample/'" + m + ".jpg"; I hope this will help u.

        Thanks and Regards, Chetan Ranpariya

        H Offline
        H Offline
        harithadotnet
        wrote on last edited by
        #3

        string ppath="'" + k + "'/sample/'" + m + ".jpg"; i have changed like this too but i am getting the same error

        Haritha

        1 Reply Last reply
        0
        • H harithadotnet

          HI In pageLoad of asp.net app i am getting the variables as string m=strPart ; (m="1" getting this) string k ; k=Convert.ToString(Session["impath"]); (k="pg/photo") now i want to take string ppath as "pg/photo/sample(this is folder name)/1.jpg" my code is string ppath=" ' + k + ' "/"sample"/" ' + m + ' ".jpg; but i am getting the erroe as operator " / " can't be applied for operands of type string and string plz help me thanks in advance Haritha

          Haritha

          A Offline
          A Offline
          ash04
          wrote on last edited by
          #4

          string ppath=k + "/sample/" + m + "/.jpg";

          DAsh04

          H 1 Reply Last reply
          0
          • A ash04

            string ppath=k + "/sample/" + m + "/.jpg";

            DAsh04

            H Offline
            H Offline
            harithadotnet
            wrote on last edited by
            #5

            i have tried like this it is not working

            Haritha

            A 1 Reply Last reply
            0
            • H harithadotnet

              HI In pageLoad of asp.net app i am getting the variables as string m=strPart ; (m="1" getting this) string k ; k=Convert.ToString(Session["impath"]); (k="pg/photo") now i want to take string ppath as "pg/photo/sample(this is folder name)/1.jpg" my code is string ppath=" ' + k + ' "/"sample"/" ' + m + ' ".jpg; but i am getting the erroe as operator " / " can't be applied for operands of type string and string plz help me thanks in advance Haritha

              Haritha

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              I tried with this code its working fine Session["impath"]="C:/FilesForXml/Photo/"; string m="1"; string k = Session["impath"].ToString(); string path = k +"Sample/" + m + ".jpg"; Are you trying to store the file ? Debug your application and see what is the value of ppath .

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              1 Reply Last reply
              0
              • H harithadotnet

                HI In pageLoad of asp.net app i am getting the variables as string m=strPart ; (m="1" getting this) string k ; k=Convert.ToString(Session["impath"]); (k="pg/photo") now i want to take string ppath as "pg/photo/sample(this is folder name)/1.jpg" my code is string ppath=" ' + k + ' "/"sample"/" ' + m + ' ".jpg; but i am getting the erroe as operator " / " can't be applied for operands of type string and string plz help me thanks in advance Haritha

                Haritha

                S Offline
                S Offline
                sundar_amu
                wrote on last edited by
                #7

                string m=strPart ; (m="1" getting this) string k ; k=Convert.ToString(Session["impath"]); (k="pg/photo") now i want to take string ppath as "pg/photo/sample(this is folder name)/1.jpg" string ppath=" ' + k + ' "["sample"}" ' + m + ' ".jpg; rhh

                1 Reply Last reply
                0
                • H harithadotnet

                  i have tried like this it is not working

                  Haritha

                  A Offline
                  A Offline
                  ash04
                  wrote on last edited by
                  #8

                  string ppath=k + "//sample//" + m + "//.jpg";

                  DAsh04

                  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