English 中文(简体)
协会没有看到Ajax的论点。 NET
原标题:Ajax arguments not been seen by ASP.NET

I m 转过Ajax的论点,从一个来源的ASP。 联系人网络网页。 NET page。 法典如下:

$( #sourcePageBtn ).click( function() {
     $.post( destination.aspx , { name: "John", time: "2pm" }, function(data) {                    
     });
});

I m 试图查阅目的地书目中的论点,即:

<script language="C#" runat="server">
    protected void Page_Load ( object src, EventArgs e) 
    {
     //Creating dynamic asp controls here
    }
</script>

我特别需要说明文字部分第_页的论据,因为我是在第_Load页上建立几个动态的图谱控制,这取决于这些论点。

<>Problem:——我看不到目的地档案中的论点。 我尝试使用<代码>Request["name”]和Request['time”

让我知道,它在哪里是错误的。

www.un.org/Depts/DGACM/index_spanish.htm P.S. - 我有以下网址:,其中涉及从来源的支部发射新网页,最后除这一论点外,所有工作罚款。

che

问题回答

不是作为员额请求发出,而是作为请求和审判请求发出。 Params [0] and Request. 段 次 页 次

我刚刚创建了一个新版的“yn”httphandler和“jax”电话:

$("#btnAjaxLoad").click(function() {
                $.ajax({ type: "GET",
                data: ({name :  John , time :  8pm }),                
                url: "DataSourceAsync.ashx",  
                contentType: "text/html; charset=utf-8",  
                dataType: "html",  
                success: function(data) { $("#AJAXGenerated").show(), $("#AJAXGenerated").html(data); $("#loading").hide(); }
                });
        });

现在,我能够作为背景,在“开始处理”活动中获得Jhon和8pm。 Request.Params [0] and context. 请求。 第(1)段,但一旦我改变类型:GET改为POST,这两个参数都没有。

很难说,看不见你的法典,但这可能是两个问题中的一个(或两个问题)。

第一是哪类纽子? Submit button? 页: 1

如果他们提交纽芬兰,那是你的问题,因为这样做会带来完全的后退,而你提出的亚克斯要求就没有发生。

第二种情况是,根据你的舱位代码,你不把点击功能束缚在负荷上,这样,当你点击一个吨子时,其功能永远不会受到约束。

<><><>>>>

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">


    </script>
    <script type="text/javascript">
        $(function()
        {
            $( #sourcePageBtn ).click(function()
            {
                $.post( Default.aspx , { name: "John", time: "2pm" }, function(data)
                {
                });
            });
        });


</script>



</head>
<body>
    <form id="form1" runat="server">
    <div>
         <input id="sourcePageBtn" type="button" value="button" />
         <%--asp button won t work as it does full post back --%>
        <asp:Button ID="sourcePageBtn" runat="server" Text="Button" />
    </div>

    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string test = Request["name"];
    }

}

如果你把它作为文字标签,也将取得同样的结果。

<script language="C#" runat="server">
    protected void Page_Load ( object src, EventArgs e) 
    {
     //Creating dynamic asp controls here
        string test = Request["name"];
    }
</script>




相关问题
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!

热门标签