NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: JohanR on November 07, 2026, 06:03:15 AM

Title: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
Post by: JohanR on November 07, 2026, 06:03:15 AM
Hi,

I have some HTML loaded in a session variable.
the HTML contains a tag <!-- Net:s:SessionVariable -->

Is there a method that will parse/substitute the tags?

thanks

Johan

Title: Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
Post by: osquiabro on November 07, 2026, 06:33:14 AM
yes you can with string Theory, example of my code

 Htm:TemplateId = 3
        GET(HtmlTemplates,Htm:PK_HtmlTemplates)
        IF ~ERROR()
            Loc:HTML = Htm:TemplateHTML
            st.SetValue(Loc:HTML)         
            st.replace('@nombre@',p_web.GSV('nombre'))
            st.replace('@fechadepago@',format(p_web.GSV('Afi:FechaPago_DATE'),@d03))
            st.replace('@cantidadpagada@',FORMAT(p_web.GSV('Afi:CantidadPagada'),@n$6.2))
            st.replace('@referencia@',p_web.GSV('Afi:NumeroPago' ))
            st.replace('@recibo@',p_web.gsv('Afi:NumeroPago'))
            Loc:HTML = st.Getvalue()       
            Loc:TemplateSubject = Htm:TemplateSubject
            st.SetValue(Loc:TemplateSubject)               
            Loc:TemplateSubject = st.Getvalue()
        END
        Access:HtmlTemplates.Close()       
Title: Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
Post by: JohanR on November 07, 2026, 09:52:16 PM
Hi,

Yes, thanks, I can certainly do manual replace exercise.
Was wondering if there was a handy NT function that does the same as the tag replacement with the static files.
Using the NT functions would be preferable as it would work for all cases and follow the NTWS method of doing it.

thanks

Johan