display html on web page

Discussion in 'ASP .Net' started by Guoqi Zheng, Apr 19, 2004.

  1. Guoqi Zheng

    Guoqi Zheng Guest

    Probably very simple question since I am new in Dot Net....

    I have a DisplayHtml function in moudle1.vb which is:

    Function DisplayHtml(ByRef fstrText As String)

    ' replace line break with <br> in html

    fstrText = Replace(fstrText, Chr(10), "<br>")

    'fstrText = Replace(fstrText, Chr(13), "<br>")

    Return fstrText

    End Function


    I have the following on apsx page...

    <%# DisplayHtml(DataBinder.Eval(Container.DataItem, "Content"))%>


    Of course you know what I want to do... I want to change link break to Html
    code < br>.

    However, I met an error of "Compiler Error Message: BC30451: Name
    'DisplayHtml' is not declared."

    Where can I look for the error? What did I do wrong???


    --
    Kind regards

    Guoqi Zheng
    guoqi AT meetholland dot com
    Http://www.meetholland.com
     
    Guoqi Zheng, Apr 19, 2004
    #1
    1. Advertising

  2. Guoqi Zheng

    Matt Berther Guest

    Hello Guoqi,

    > However, I met an error of "Compiler Error Message: BC30451: Name
    > 'DisplayHtml' is not declared."


    Is DisplayHtml defined in the ASPX's code-behind? An ASPX page generates a subclass of your code-behind class and if the method isnt available there, that would lead to your error.

    --
    Matt Berther
    http://www.mattberther.com
     
    Matt Berther, Apr 19, 2004
    #2
    1. Advertising

  3. Guoqi Zheng

    Pete Beech Guest

    It could be the accessibility of the function (though I don't know VB.NET so
    well, especially how the accessibility defaults).
    The function must be accessible to the aspx page, which is inherited from
    the aspx.vb codebehind class. I presume it defaults to private, and it needs
    to be at least protected.

    Pete Beech

    "Guoqi Zheng" <> wrote in message
    news:...
    > Probably very simple question since I am new in Dot Net....
    >
    > I have a DisplayHtml function in moudle1.vb which is:
    >
    > Function DisplayHtml(ByRef fstrText As String)
    >
    > ' replace line break with <br> in html
    >
    > fstrText = Replace(fstrText, Chr(10), "<br>")
    >
    > 'fstrText = Replace(fstrText, Chr(13), "<br>")
    >
    > Return fstrText
    >
    > End Function
    >
    >
    > I have the following on apsx page...
    >
    > <%# DisplayHtml(DataBinder.Eval(Container.DataItem, "Content"))%>
    >
    >
    > Of course you know what I want to do... I want to change link break to

    Html
    > code < br>.
    >
    > However, I met an error of "Compiler Error Message: BC30451: Name
    > 'DisplayHtml' is not declared."
    >
    > Where can I look for the error? What did I do wrong???
    >
    >
    > --
    > Kind regards
    >
    > Guoqi Zheng
    > guoqi AT meetholland dot com
    > Http://www.meetholland.com
    >
    >
    >
     
    Pete Beech, Apr 19, 2004
    #3
  4. Guoqi Zheng

    Guoqi Zheng Guest

    What do you mean by code-behind... DisplayHtml function is available on
    Mudule... I didn't put anything on .aspx.vb file... What should I put
    there???


    --
    Kind regards

    Guoqi Zheng
    guoqi AT meetholland dot com
    Http://www.meetholland.com

    "Matt Berther" <> wrote in message
    news:OSh$...
    > Hello Guoqi,
    >
    > > However, I met an error of "Compiler Error Message: BC30451: Name
    > > 'DisplayHtml' is not declared."

    >
    > Is DisplayHtml defined in the ASPX's code-behind? An ASPX page generates a

    subclass of your code-behind class and if the method isnt available there,
    that would lead to your error.
    >
    > --
    > Matt Berther
    > http://www.mattberther.com
     
    Guoqi Zheng, Apr 19, 2004
    #4
  5. Guoqi Zheng

    Matt Berther Guest

    Hello Guoqi,

    > What do you mean by code-behind... DisplayHtml function is available
    > on Mudule... I didn't put anything on .aspx.vb file... What should I
    > put there???


    Put your DisplayHtml method in the .aspx.vb file.

    --
    Matt Berther
    http://www.mattberther.com
     
    Matt Berther, Apr 20, 2004
    #5
  6. Guoqi Zheng

    Sueffel Guest

    Specifically make it public, i had the same problem till I did that. Not
    sure why, but it seemed to work for me.

    HTH,
    Sueffel
    "Guoqi Zheng" <> wrote in message
    news:...
    > Probably very simple question since I am new in Dot Net....
    >
    > I have a DisplayHtml function in moudle1.vb which is:
    >
    > Function DisplayHtml(ByRef fstrText As String)
    >
    > ' replace line break with <br> in html
    >
    > fstrText = Replace(fstrText, Chr(10), "<br>")
    >
    > 'fstrText = Replace(fstrText, Chr(13), "<br>")
    >
    > Return fstrText
    >
    > End Function
    >
    >
    > I have the following on apsx page...
    >
    > <%# DisplayHtml(DataBinder.Eval(Container.DataItem, "Content"))%>
    >
    >
    > Of course you know what I want to do... I want to change link break to

    Html
    > code < br>.
    >
    > However, I met an error of "Compiler Error Message: BC30451: Name
    > 'DisplayHtml' is not declared."
    >
    > Where can I look for the error? What did I do wrong???
    >
    >
    > --
    > Kind regards
    >
    > Guoqi Zheng
    > guoqi AT meetholland dot com
    > Http://www.meetholland.com
    >
    >
    >
     
    Sueffel, Apr 21, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Segrest
    Replies:
    1
    Views:
    517
    Patrice
    Apr 13, 2005
  2. Stu
    Replies:
    2
    Views:
    821
    Rob McAninch
    Apr 6, 2004
  3. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    How to: display page, post back, display again

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Jul 14, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,052
    Walter Wang [MSFT]
    Jul 14, 2006
  4. Marek Kurowski
    Replies:
    1
    Views:
    1,033
    Mark A. Odell
    Aug 18, 2004
  5. Chrysan

    Display image being captured by web-camera on web-page

    Chrysan, Apr 19, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    135
    Chrysan
    Apr 19, 2006
Loading...

Share This Page