Showing variables in html

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tome73

    #1

    Showing variables in html

    I’m new to .NET-
    How can I get my html page to display the custID variable --- Customer
    <b><%# custID %> --- when the variable is declared in the code behind page?
    It works just fine when using a code render block on the same page.

  • Jim M

    #2
    Re: Showing variables in html

    page.databind

    "Tome73" <Tome73@discuss ions.microsoft. com> wrote in message
    news:931A555A-8E00-4442-91CF-8B84C626CD13@mi crosoft.com...[color=blue]
    > I'm new to .NET-
    > How can I get my html page to display the custID variable --- Customer
    > <b><%# custID %> --- when the variable is declared in the code behind
    > page?
    > It works just fine when using a code render block on the same page.
    >[/color]


    Comment

    • Tome73

      #3
      Re: Showing variables in html

      I have page.databind set on page_load, but still it doesn't work on the
      codebehind.

      "Jim M" wrote:
      [color=blue]
      > page.databind
      >
      > "Tome73" <Tome73@discuss ions.microsoft. com> wrote in message
      > news:931A555A-8E00-4442-91CF-8B84C626CD13@mi crosoft.com...[color=green]
      > > I'm new to .NET-
      > > How can I get my html page to display the custID variable --- Customer
      > > <b><%# custID %> --- when the variable is declared in the code behind
      > > page?
      > > It works just fine when using a code render block on the same page.
      > >[/color]
      >
      >
      >[/color]

      Comment

      • Jim M

        #4
        Re: Showing variables in html

        You will have to post some code.

        "Tome73" <Tome73@discuss ions.microsoft. com> wrote in message
        news:036991BC-352B-44CD-9223-AB1876799CA8@mi crosoft.com...[color=blue]
        >I have page.databind set on page_load, but still it doesn't work on the
        > codebehind.
        >
        > "Jim M" wrote:
        >[color=green]
        >> page.databind
        >>
        >> "Tome73" <Tome73@discuss ions.microsoft. com> wrote in message
        >> news:931A555A-8E00-4442-91CF-8B84C626CD13@mi crosoft.com...[color=darkred]
        >> > I'm new to .NET-
        >> > How can I get my html page to display the custID variable --- Customer
        >> > <b><%# custID %> --- when the variable is declared in the code behind
        >> > page?
        >> > It works just fine when using a code render block on the same page.
        >> >[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • Angelos Karantzalis

          #5
          Re: Showing variables in html

          The code behind is a class. you need to define the variable as a class
          variable & tell the html code:

          <%=this.custID% > .. perhaps some modification in the access modifier of the
          variable will be required,like define it as protected or even public

          Angel
          O:]


          "Tome73" <Tome73@discuss ions.microsoft. com> wrote in message
          news:931A555A-8E00-4442-91CF-8B84C626CD13@mi crosoft.com...[color=blue]
          > I'm new to .NET-
          > How can I get my html page to display the custID variable --- Customer
          > <b><%# custID %> --- when the variable is declared in the code behind[/color]
          page?[color=blue]
          > It works just fine when using a code render block on the same page.
          >[/color]


          Comment

          Working...