what is <%#

Discussion in 'C#' started by descarte, Apr 12, 2010.

  1. #1
    hi friends,

    i am new to c sharp. I saw this tag <%# ... %>

    can anyone tell me what that is?
     
    descarte, Apr 12, 2010 IP
  2. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    It evaluates the expression within the tags. For example:
    <%# myVar %>
    will display the value for myVar.
    it is short for typing:
    <% Response.Write (myVar) %>
     
    camjohnson95, Apr 12, 2010 IP
  3. descarte

    descarte Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    wouldnt that be <%= myVar ?>

    ??
     
    descarte, Apr 13, 2010 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    yeah my bad. I think it is similar but is used to evaluate expressions within an asp control. So for if you wanted to assign a variable to a property of a .net control. you would use <%#
     
    camjohnson95, Apr 14, 2010 IP
  5. bhuppi890109

    bhuppi890109 Member

    Messages:
    1,337
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #5
    sry frnd i dont remember this i have left working on asp so i dont remember
     
    bhuppi890109, Jun 8, 2010 IP
  6. conledy

    conledy Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you can use this

    <%=myVar %>
     
    conledy, Jun 9, 2010 IP
  7. chanda

    chanda Peon

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    it is used in html coding through<%#Eval("column name")%>
    u can use the data base data of that column
     
    chanda, Aug 19, 2010 IP