Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > display html on web page

Reply
Thread Tools

display html on web page

 
 
Guoqi Zheng
Guest
Posts: n/a
 
      04-19-2004
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



 
Reply With Quote
 
 
 
 
Matt Berther
Guest
Posts: n/a
 
      04-19-2004
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
 
Reply With Quote
 
 
 
 
Pete Beech
Guest
Posts: n/a
 
      04-19-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
Guoqi Zheng
Guest
Posts: n/a
 
      04-19-2004
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" <(E-Mail Removed)> wrote in message
news:OSh$(E-Mail Removed)...
> 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



 
Reply With Quote
 
Matt Berther
Guest
Posts: n/a
 
      04-19-2004
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
 
Reply With Quote
 
Sueffel
Guest
Posts: n/a
 
      04-21-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have one ASP.NET Page. It's for display customer information. Now I want this page to handle the function "Edit" and "Display", Is it possible? Benny Ng ASP .Net 1 01-04-2007 08:00 PM
How can I display my .ASPX page from within an HTML page? Bob Segrest ASP .Net 1 04-13-2005 03:57 PM
CHtmlView: How to read html text before display, change and give to display changed html code? Marek Kurowski C Programming 1 08-18-2004 06:41 PM
Re: Web page is not available - "The Web page you requested is not available offline. To view this page, click Connect" Natty Gur ASP .Net 0 06-06-2004 05:46 AM
How to display a html page after the original html page runs a perl script Stu HTML 2 04-06-2004 05:19 AM



Advertisments