#HtmlRaw One Word - asp.net-mvc-4

im trying to use razor to generate a url like this
<img id="currentPic" src="/content/img/#Html.Raw(Model.user.defaultImage).png" />
but the .png bit is being added to the #htmlraw syntax and is not compiling. I know i need to tell the page that #htmlraw is over. I tried using ; which worked - but the ; was also displayed in the string when displayed.
How can i get it so it would display like this. When Model.user.defaultImage = random1
<img id="currentPic" src="/content/img/random1.png" />
thanks

try adding a new set of parenthesis
<img id="currentPic" src="/content/img/#(Html.Raw(Model.user.defaultImage)).png" />

Try #{Html.Raw(Model.user.defaultImage)}

I think you don't need Html.Raw, just use
<img id="currentPic" src="/content/img/#(Model.user.defaultImage).png" />

This feels like a hack, but works:
<img id="currentPic" src="/content/img/#Html.Raw(Model.user.defaultImage + ".png")" />

Related

VueJS3 dynamic asset

I load some images like this in my template:
<img
v-if="idRobot === 7"
src="~#/assets/img/faceTibot.png" />
But I'd like to load the asset dynamically. For example, something like this would be great:
<img
v-if="idRobot === 7"
:src="`~#/assets/img/${dynamicasset}.png`" />
Actually, when I do this, VueJS thinks I want to load the string "~#/assets/img/${dynamicasset}.png".
Is what I want even possible in VueJS3?
Ah, BTW I searched SO and found this but suggested require solutions don't work: https://stackoverflow.com/a/47480286/1098303
Thanks in advance
Have you tried this solution ?
<img :src="require(`~#/assets/img/${dynamicasset}.png`)" />

CKEditor5 setData() stripping <code> tags

When I try to run
editor.setData("<p>test comment</p><code class=\"python-code\">def withCodeBlock:<br /> print('test')</code>");
The resulting editor contains the html:
<p>test comment</p>
<p>def withCodeBlock:
<br>print('test')</p>
It strips out the <code> tags, how can I stop this?
I found my issue, my sanitizer was removing a wrapping <pre> tag around the codeblock
editor.setData("<p>test comment</p><pre><code class=\"python-code\">def withCodeBlock:<br /> print('test')</code></pre>");
works perfect

How can I write and ampersand in a v-input in vue?

How can I write and ampersand in a v-input in vue?
<v-input
label="Terms"
description="I agree to Terms & Conditions
type="checkbox"
:value.sync="registerDetails.terms"
:v="$v.registerDetails.terms"
/>
Try the following including using the html code for ampersand as well as correcting usage of single and double quotes:
<v-input
label="Terms"
description="I agree to <a href='/legal-information/terms-conditions' target='_blank'>Terms & Conditions</a>"
type="checkbox"
:value.sync="registerDetails.terms"
:v="$v.registerDetails.terms"
/>
Hopefully that helps!

Has TabBarIOS an Icon-Only Style?

I'm currently playing with the TabBarIOS-Component. It works perfectly but what I'm missing is a Icon-Only Style like TweetBot. Is there a way to tell TabBarIOS that I don't need/want the title?
You must explicitly set the title to an empty string:
<TabBarItem title="" />

ModX Eform: Captcha not generating image

I am trying to get CAPTCHA working on the eForm plugin. I have added the input form field:
<label for="cfCaptcha">Captcha:<br />
<img src="[+verimageurl+]" alt="verification code"><br />
<input id="vericode" name="vericode" class="text" type="text">
and I have added
&vericode=`1`
to the eForm call.
and have added the Template Variable [+verimageurl+] to my template.
However, when I preview the form all I see in the image area is <img src="" alt="verification code">
Would anyone know what I am doing wrong?
Did you get this fixed?
Check that you ended the label code. Run it through w3c code checker too.
A few times I have left a element un-closed and it breaks the whole thing.