帮助在C#中编写javscript和html [英] Help in writing javscript and html in C#

查看:89
本文介绍了帮助在C#中编写javscript和html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii ..i正在编写javascript& C#中的html.
我已经用javascript写了一个函数,现在我称之为.
这是功能


 setTimeout("  + CharacterPos +  ')",延迟); 



我需要用C#加上逗号分隔.

我已经尝试过,但是在此行中出现错误


这就是我尝试过的方式

 字符串 s = 字符串 .format(  setTimeout(" StartTyping(" + CharacterPos +') ,delay);");  pre> 

请帮助我.

解决方案

如何将其写为

string s = string.format("setTimeout(\"StartTyping(''{0}'')\", {1});", CharacterPos, delay);

我希望这会起作用. :rose:


很抱歉,它不起作用......仅当characterPos有一个单双倍的反向逗号时才起作用.

setTimeout("StartTyping(""+ CharacterPos +"''),delay);


nimishasurendran写道:

Sry Abishek,它不起作用......仅当characterPos有一个单双倍的反逗号时才起作用.
这是HTML代码
setTimeout("StartTyping(""+ CharacterPos +"''),delay);
我需要用c#
编写



但它被发布为新问题-我已将其移至此处,以便Abishek可以(可能)看到它,并删除了错误的问题.


Hii ..i am writing javascript & html in C# .
I have written a function in javascript and i am calling this .
This is the function


setTimeout("StartTyping('"+CharacterPos+"')",delay);



i needed to write this in c# with inverted commas.

I have tried but i am getting error in this line


This is how i tried

string s=string.format("setTimeout("StartTyping('"+CharacterPos+"')",delay);");



Please help me.

解决方案

How about writing this as

string s = string.format("setTimeout(\"StartTyping(''{0}'')\", {1});", CharacterPos, delay);

I hope this will work. :rose:


Sry its not working ...... It works only when there is a single,double inverted comma for characterPos .

setTimeout("StartTyping(''"+CharacterPos+"'')", delay);


nimishasurendran wrote:

Sry Abishek ,its not working ...... It works only when there is a single,double inverted comma for characterPos .
This is the HTML code
setTimeout("StartTyping(''"+CharacterPos+"'')", delay);
I need to write this in c#



But it was posted as a new question - I have moved it here so Abishek can (possibly) see it, and deleted the false question.


这篇关于帮助在C#中编写javscript和html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆