Hyper links and variables? possible?

Last post 08-15-2005 11:37 AM by L.Good. 4 replies.

Sort Posts:

  • Hyper links and variables? possible?

    08-13-2005, 11:47 PM
    • Member
      505 point Member
    • L.Good
    • Member since 11-24-2004, 1:57 PM
    • Posts 129
    I'm using Web Matrics and program in C#.
    I've asked about this before. I've made a Hyper link like this ( a href="\\Server\champaign\9291">click here ). I've replaced the < >  so as to show it. Can you use a variable in place of 'champaign' & '9291' some how. Or is there another approch I should use. This link does just what I want. Opens a page and displays the contents of the directory. Allowing you to double click on a file and bring it up in NotePad or Word for .doc. Any help would be appreciated.
  • Re: Hyper links and variables? possible?

    08-14-2005, 1:29 AM
    • Member
      275 point Member
    • Big_Brother
    • Member since 07-15-2005, 10:36 PM
    • Posts 55
    Hey,

    Yes you can do it. You can have a variable but it must be defined in the C# code and it must be a global variable. First define the variable in the C# code and to use this variable in the HTML code place it between <%$ variable_name %>. For example:

    <a href="<%$variable_name%>">Click Here</a>

  • Re: Hyper links and variables? possible?

    08-14-2005, 7:14 PM
    • Member
      505 point Member
    • L.Good
    • Member since 11-24-2004, 1:57 PM
    • Posts 129
    Compiler Error Message: CS1525: Invalid expression term ''
     
    <a href="<%$location%>">Click Here</a>
    I copied your suggestion and created the Global Var  location. I put a label on my form and it is getting the data assigned to it. But I get the error message at the top, So any suggestions, I appreciate the assistance so far. thanks.
  • Re: Hyper links and variables? possible?

    08-15-2005, 1:27 AM
    • Member
      275 point Member
    • Big_Brother
    • Member since 07-15-2005, 10:36 PM
    • Posts 55
    Hey,

    I am sorry for this. Instead of the dollar sign ($) it should be (=):

    <a href="<%=location%>">Click Here</a>

    It differes from language to language thats why I gave you the wrong one. Sorry again.

  • Big Smile [:D] Re: Hyper links and variables? possible?

    08-15-2005, 11:37 AM
    • Member
      505 point Member
    • L.Good
    • Member since 11-24-2004, 1:57 PM
    • Posts 129
    Got it, I was making some mistakes also, but it is working now. Thank you very much.Big Smile <img src=" src="/emoticons/emotion-2.gif">
Page 1 of 1 (5 items)