question

schlebe-8883 avatar image
0 Votes"
schlebe-8883 asked ·

Is it possible to add <style> and <script> to html file contained in .Net WebView control ? How ?

I have written following VB.Net code (see below) to display an HTML file containing Unicode characters greater than 0xFFF.

 Dim sText As XElement =
 &lt;html&gt;
     &lt;head&gt;
         &lt;style type=&#34;text/css&#34;&gt;
             unicode
                 {
                 background-color: yellow;
                 }
         &lt;/style&gt;
     &lt;/head&gt;
     &lt;body&gt;
         &lt;script type=&#39;text/javascript&#39;&gt;
             function clickUnicode()
                 {
                 var sValue = &#34;?&#34;;
                 window.external.notify(sValue);
                 }  
         &lt;/script&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F600;&lt;/div&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F601;&lt;/div&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F602;&lt;/div&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F603;&lt;/div&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F604;&lt;/div&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F605;&lt;/div&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F606;&lt;/div&gt;
         &lt;div class=&#34;unicode&#34; onclick=&#34;clickUnicode()&#34;&gt;&amp;#x1F607;&lt;/div&gt;
     &lt;/body&gt;
 &lt;/html&gt;]
 wv.Settings.IsScriptNotifyAllowed = True 
 wv.Settings.IsJavaScriptEnabled = True
 wv.NavigateToString(sText)

When I analyse the result (see Image), I see that &lt;script&gt; text and &lt;style&gt; text has been added as TEXT.

7611-captureunicode.png

Normally only emoticons are visible !

Is it possible to add &lt;style&gt; and &lt;script&gt; to html file contained in .Net WebView control ? How ?

If I copy HTML element in an HTML file and I double click on it, I obtain following result on Chrome

7577-capturewebviewonchrome.png



@schlebe-8883

I have put any tag because following tags are not accepted !

VB.Net Javascript CSS WebView WinForm


not-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered ·

QnA currently supports the products listed in right-hand pane (more to be added) Better to reach out to subject matter experts in dedicated forums over here.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral


https://forums.asp.net/36.aspx/1?Visual+Basic+NET

(please don't forget to mark helpful replies as answer)


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

schlebe-8883 avatar image
0 Votes"
schlebe-8883 answered ·

Yes, but I have tried to put a question on MSDN just before but the system have refused to include the images because I'm not VALIDATED.
I have also seen a message indicating that MSDN is migrating. So I have followed the link in MSDN to create a post here.

I'm very disappointed when searching to add some tags. Now I understand why important tags as VB.Net are missing !

Please, can you make something for me ?

Can you validate my login so that I can post my question with images on MSDN ?

I'm new on x.x@gmail.com because I'm in retirement and that I cannot more have access to my professional email that was x.x@atos.net.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered ·

Many of the MSDN/TechNet forums including the ones I linked have not yet migrated. As to MSDN verification you can expedite verification by replying to this thread with your request.


https://social.msdn.microsoft.com/Forums/en-US/94f05325-8566-4c4c-806c-179a5a0beafc/verify-accounts-43?forum=reportabug


Sticky located at top of Forums Issues (not product support) forum


https://social.msdn.microsoft.com/Forums/en-US/home?forum=reportabug



·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.