在ASP.net按钮上单击,使用VB脚本填充ASP.Net文本框. [英] On ASP.net Button click populate a ASP.Net textbox using VB Script

查看:80
本文介绍了在ASP.net按钮上单击,使用VB脚本填充ASP.Net文本框.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个vbscript函数,它将从ActiveX控件IntegriSign1获取一个值,如下面的代码所示.

I have a vbscript function which will get a value from ActiveX control IntegriSign1 as shown in the code below.

我的asp.net页面中有一个ASP.net Texbox和ASP.net按钮,如下面的代码所示.

I have a ASP.net Texbox and ASP.net Button in my asp.net page as show in the code below.

从我的GetSignData()函数如何使用SignData值填充txtIntegri1

From my GetSignData() function How can I populate txtIntegri1 with SignData Value

谢谢

<script type="text/vbscript" >
    sub GetSignData()
        SignData=window.document.IntegriSign1.GetSignData()
        'window.document.frmIntegriSign.txthashdata.value
        set t1=window.document.getElementById("<%=txtIntegri1.clientID%>") 
        If tl<> null Then
            t1.value=SignData
        else
            msgbox signData
        End If
    end sub
</script>
<asp:TextBox ID="txtIntegri1" runat="server" ></asp:TextBox>
<input type="button" id="btnAccept" name="btnAccept" runat="server" value="Accept " onclick="GetSignData();" /> 

我遇到错误对象必需txtIntegri

I am getting an error Object Required txtIntegri

推荐答案

您不能.文本框上的 Visible ="false" 属性意味着它根本不会呈现为html.就您的浏览器而言,它不存在.

You can't. The Visible="false" property on your textbox means that it isn't rendered to html at all. As far as your browser is concerned, it doesn't exist.

但是撇开这一点(假设您还有其他代码可以更正此问题),您可以按照Ahmad Mageed的建议使用 .ClientID 属性引用控件的ID.

But putting that aside (assuming you have other code that corrects this), you can reference the ID of the control using the .ClientID property as Ahmad Mageed suggests.

这篇关于在ASP.net按钮上单击,使用VB脚本填充ASP.Net文本框.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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