jQuery的asp.net中设置会话 [英] jquery setting session in asp.net

查看:88
本文介绍了jQuery的asp.net中设置会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在jQuery中设置会话。这里是code,但想不出看着办吧。请看下面的注释行。我该怎么办呢?

  $(文件)。就绪(函数(){
    $(#演示输入Facebook的主题是).tokenInput(http://xxx.com/MedService.aspx,{
        使用onAdd:函数(项目){
            // *********
            //我要item.name添加到下面code
            // *********
            <%HttpContext.Current.Session [Session_Post_Kategori] + =item.name; %GT;
        },
        onDelete:函数(项目){},
        主题:脸谱
     });
});


解决方案

  

jQuery的设置在asp.net会话


会话的无法的可以在使用jQuery / JavaScript的客户端设置。会话被保持在服务器端,并且必须在没有jQuery的服务器年底成立虽然你可以在jQuery中使用sessoin值。您可以发送 Ajax调用以服务器从JavaScript设置的会话。

I am trying to set a session in jquery. here is the code but couldnt figure it out. Please look at the line below the comment. How can I do it?

$(document).ready(function () {
    $("#demo-input-facebook-theme").tokenInput("http://xxx.com/MedService.aspx", {
        onAdd: function (item) {
            // *************************************
            // I want to add item.name to below code
            // *************************************
            <% HttpContext.Current.Session["Session_Post_Kategori"] += "item.name"; %>
        },
        onDelete: function (item) { },
        theme: "facebook"
     });
});

解决方案

jquery setting session in asp.net

Session could not be set on client side using jQuery / javascript. Sessions are maintained on server side and has to be set on server end not in jQuery although you can use sessoin values in jQuery. You can send an ajax call to server for setting the sessions from javascript.

这篇关于jQuery的asp.net中设置会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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