English 中文(简体)
你如何在 Java文中设定一个届会变量?
原标题:How do you set a session variable in JavaScript?

能否用“页数”来做到这一点? 我需要避免控制中的某些变数,以便日后能够在另一页上加以控制。 是否有办法通过贾瓦文做到这一点?

最佳回答
问题回答

你可以利用联合材料来改变隐蔽领域的价值观,并将这些价值观带上背后,我认为,如果本届会议仅需要价值,那么这种背后更可取。

我谨采取以下方式:

javascript:

function SendData(data) {
    var postbackarg = "@@@@@" + data;
    __doPostBack("txtTest", postbackarg);
}

VB In Page_Load event:

If Me.IsPostBack Then
    Dim controlName As String = Request.Params.Get("__EVENTTARGET")
    Dim args As String = Request.Params.Get("__EVENTARGUMENT")
    ProcessUserInterfaceData(controlName, args)
    If (controlName = "txtTest" AndAlso args.IndexOf("@@@@@") = 0) Then
        args = args.Substring(5, args.Length - 5)
         args now = data from the UI
    End If
End If

从我发现的一个实例开始。 我找不到。 5 @的唯一目的是确定从SendData到来的背后情况。

Session variables cannot be set using Javascript directly But you can use the following code to set session variables in aspx page

<%Session["SESSION VARIABLE NAME"] ="SOME STRING"; %>

你们可以用javascript的警示来检查同样的变量。

 alert( <%=Session["SESSION VARIABLE NAME"] %> );

Yes session variability can be set using pagemethods using the following way

宣布以下代码为px.cs页

  [WebMethod]
        public static void functionname(string st)
        {
            Home h = new Home();
            System.Web.HttpContext.Current.Session["SessionUserName"] = st;
            h.strUserName = (string)System.Web.HttpContext.Current.Session["SessionUserName"];
        }

并使用px中的页数表示功能

 PageMethods.functionname("HELLO");

这将把本届会议改为

如果你打算使用网页方法,你也可以向网上浏览。 !





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!