Modify HTML Code


Donald Walker

I am using html to display an image on my server in an app.

I want to make one of the folders in the image string a variable. what would be the best way to do that?

I would like to search and replace a /##Folder##/ variable in the html string, and then use a variable in the HTML property, but not sure how to do that. If I use the search and replace, where should the html text be that is processed?

That might be one way to do it, is there another way?

Can I do a search and replace on the HtmlContent2.HTML for example?


decsoft

Hello Donald,

The HtmlContent control is a bit special, since we can't access their HTML variable in runtime. In fact probably we can do it using Javascript, however, such variable is plained to used at designtime, commonly to put inside one or more variables. Then this variables are parsed in compile time and therefore become available at runtime.

Therefore, probably what you can do is to think about variables, because variables can be changed at runtime. Then, for example, if you shown an image in your HTMLContent control using a code similar to this:

In the app's view Show event we can set the variable to this:

And then, in every other place (a Push Button's Click event, for example) we can place another similar code:

Also, we can made the entire HTMLContent control a variable, that is, we can simply place inside something like "[MyVariable]", then we can change the content of that variable at runtime.

Hope this can help you in some manner Donald. :)



Ade Wale

Hi,
Will this logic work with audio file?


decsoft

Hello,

Hi,
Will this logic work with audio file?

Yes, edunt. In principle, the HTMLContent control can contains any HTML and app variables.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.