从anopther软件中获取值到c#中,然后使用javascipt将其显示到asp.net标签中。 [英] Fetching value from anopther software into c# and then showing it into asp.net label using javascipt.

查看:84
本文介绍了从anopther软件中获取值到c#中,然后使用javascipt将其显示到asp.net标签中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我有一个创作软件,我使用asp.net的Request.Form []从中获取价值。价值取得成功。但后来我想在asp.net标签中显示价值。如何使用javascript做到这一点?请告诉我,我是javascript和学习的新手。我试着在我的.aspx文件中写下面的代码。



Hello. I have one authoring software from which I am fetching value using Request.Form[] of asp.net. Value is fetched succesfully. But then I want to show the value in a asp.net Label. How to do it using javascript? Kindly instruct me, I am new into javascript and learning. I tried to write the below code in my .aspx file.

<asp:Label ID="Label1" runat="server" Text="Label" Font-Size="Larger"></asp:Label>
<script type="text/javascript">
function text()
{
if (document.getElementById("Label1") == "")
{
document.getElementById("Label1")= testname;

}
}
</script>

推荐答案

你试过像这样。

解决方案1:

============

You have try like this.
Solution 1 :
============
<script lanugage=javascript runat=server>
function ontextchange()
{
 document.getElementById("lableid").value = "change in text or whatever";
}
</script>





解决方案2:

========= ===



Solution 2 :
============

<script lanugage=javascript runat=server>

function ontextchange()

{

 // check if browser is IE

 if(ie)

 document.getElementById("lableid").innerHTML = "change in text or whatever";

else

 document.all('labelid').innerHTML ="hello word"

}

</script>





希望这对您有所帮助。!



Hope this will helpful to you.!


替换如下



Replace it like below

if (document.getElementById("Label1").value  == "")
{
document.getElementById("lable1").value = "test name";
}











or

if (document.getElementById("Label1").innerHTML == "")
{
document.getElementById("lable1").innerHTML = "test name";
}


这篇关于从anopther软件中获取值到c#中,然后使用javascipt将其显示到asp.net标签中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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