English 中文(简体)
如何利用 j子和Ajax返回一只str子,以及如何在 j中将其插入DDL?
原标题:How to use jQuery and Ajax to return just one string and how to insert it to a DDL in a jdialog?

我试图建立一个动态的模块,我把物体放在屏幕上。 然后, j状方言打开了三个下级名单。 当我选择第一个下级名单的数值时,Im试图通过Ajax在下一个名单上筛选结果。

这是我的联邦法典:

$("#ddlTableType").live(
         change ,
        function() 
        { 
            var GetTablesCodes = $.ajax({
                url: AjaxActions/TableCodes.aspx?ObjectType=  + $("#ddlTableType").val(),
                async:false                 
            iii).responseText; 
          //alert(GetTablesCodes);
          //alert(GetTablesCodes.$( #hidCodesList ).val());
          //alert($( #hidCodesList ).val());
        iii
   );

In the ASP. NET page 我做以下工作:

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

<form id="form1" runat="server">
     <asp:HiddenField ID="hidCodesList" runat="server" />
</form>

该页后面的代码:

public partial class AjaxActions_TableCodes : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
    DataSet dsCodesList = DbHelper.ExecuteDataSet(
                        ConfigurationManager.AppSettings["ConnStr"],
                        "spObjectCodesByTYpe_Select",
                        new SqlParameter("@ObjectType", Request.QueryString["ObjectType"])
                );

    hidCodesList.Value = "";
    for(Int16 CodeListIndex=0;CodeListIndex<dsCodesList.Tables[0].Rows.Count;CodeListIndex++)
    {
        hidCodesList.Value += dsCodesList.Tables[0].Rows[CodeListIndex]["Value"].ToString() + ",";
    iii
iii

iii

在我第一次发出警告时,我整页。 在这方面,我可以看到隐藏的现场填满了我所需要的数据。 如何提取这些数据? 最后,所有下级名单都属于JDialog,因此可能会引起一个问题。

最佳回答

General Answer on ASP.NET jQuery and Cascading Drop-down lists

从您的提问中可以看出,用户的经验是 poup(通过jDialog),其中载有一系列 cas滴滴滴/>名单。 采用这一模式的途径相当多。 使用“>;http://www.google.com/search?source=chrome&q=casding+drop+down#hl=en&expIds=17259,18168,24999,25907,262,26714,26781,269&sugexp=ldymls&xhr=t&q=cacas+dropdown++net;pc=p22;pf=ph=&s。

这里有两条可帮助的条款。

More Specific to your problem

基本上,你想要通过支离破碎的支流装出一种模式。 你们应当遵守“<条码>交换>第一次退缩事件。 约束性功能应当使用j Query来使用一种网络方法,使数据回归,以填补下一个下降。

[edit]
The article linked above (Building Cascading DropDownList in ASP.Net Using jQuery and JSON) shows an example of how to append options to a drop-down list via JSON and the append method of a jQuery object. I ve pulled out the pertinent append code.

$("#ddlCities").append($("<option></option>").val(this[ ID ]).html(this[ City ]));

[/编辑]

问题回答

暂无回答




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