需要在VB代码隐藏中使用java脚本发送按钮单击事件的值 [英] Need to send a value on button click event using java script in VB codebehind

查看:62
本文介绍了需要在VB代码隐藏中使用java脚本发送按钮单击事件的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Vb windows应用程序,我需要使用java脚本将按钮点击事件的值发送到公共集线器。



以下是提到的Javascript代码。





任何人都可以指导我



什么我试过了:



$(function(){

//设置连接的集线器URL

$ .connection.hub.url =http:// localhost:8080 / signalr;



//声明代理以引用集线器。

var chat = $ .connection.myHub;

I have a Vb windows application where i need to send a value on button click event to a common hub using java script.

below is the mentioned Javascript code.


Could anyone please guide me

What I have tried:

$(function () {
//Set the hubs URL for the connection
$.connection.hub.url = "http://localhost:8080/signalr";

// Declare a proxy to reference the hub.
var chat = $.connection.myHub;

// Set initial focus to message input box.
           $('#message').focus();
           // Start the connection.
           $.connection.hub.start().done(function () {
               $('#sendmessage').click(function () {
                   // Call the Send method on the hub.
                   chat.server.send($('#displayname').val(), $('#message').val());
                   // Clear text box and reset focus for next comment.
                   $('#message').val('').focus();

推荐答案

(function() {

//设置连接的集线器URL
(function () {
//Set the hubs URL for the connection


.connection.hub.url =http:// localhost:8080 / signalsr ;



//声明代理以引用集线器。

var chat =
.connection.hub.url = "http://localhost:8080/signalr";

// Declare a proxy to reference the hub.
var chat =


.connection.myHub;

.connection.myHub;
// Set initial focus to message input box.


这篇关于需要在VB代码隐藏中使用java脚本发送按钮单击事件的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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