如何在不重新加载整个页面的情况下重新下载下拉列表 [英] How to reload a drop downlist without reloading the whole page

查看:83
本文介绍了如何在不重新加载整个页面的情况下重新下载下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,请有人帮我解决如何在不使用JQuerry或任何人重新加载页面的情况下重新下载下拉列表的情况..



目前我是使用此自动回发活动

 受保护  void  DropVentureName_SelectedIndexChanged( object  sender,EventArgs e)
{
if (DropName .SelectedIndex == 2
{
DropSelectWait.Visible = true ;

}
// 我使用的方法重新加载页面,我想要它只重新加载下拉列表......我怎么能这样做





谢谢,我很感激



SHOUTING删除 - OriginalGriff [/ edit]

解决方案

你可以使用客户端回发,它快并且易于使用Asp.net ajax扩展(在工具箱中)。



这里有一个如何使用它的链接:

http://www.youtube.com/watch?v = 3HdJu1U6ciQ< / a> [ ^ ]


确实使用AJAX,更具体的使用updatepanel将是最简单的方法。



 <   asp:ScriptManager     ID   =  ScriptManager1    runat   = 服务器 >  
< / asp:ScriptManager >
< asp:UpdatePanel ID = < span class =code-keyword> UpdatePanel1 runat = server >
< ContentTemplate >
< asp:DropDownList

ID = DropDownList1

runat = server

< span class =code-attribute> AutoPostBack = true

OnSelectedIndexChanged = DropDownList1_SelectedIndexChanged

>
< / asp:DropDownList >
< / ContentTemplate >
< / asp:UpdatePanel >





http://msdn.microsoft.com/en-us/library/bb399001.aspx [ ^ ]


使用juqery绑定下拉列表而不刷新页面

查看一些好的链接



使用jQuery和KnockOut填充下拉列表



HT TP://www.c-sharpcorner.com/Blogs/13350/bind-dropdownlist-in-Asp-Net-using-jquery.aspx

Good day all, please can some one help me out on how to reload a dropdownlist without reloading the page using JQuerry or any one..

Currently i am using this auto post back event

 protected void DropVentureName_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DropName.SelectedIndex == 2)
            {
                DropSelectWait.Visible = true;

            }
// the method i am using reloads the page, i want it to reload only dropdownlist...How can i do that 



Thanks, I do appreciate

[edit]SHOUTING removed - OriginalGriff[/edit]

解决方案

Hi, you can use client side postback, its fast and easy to use with Asp.net ajax extension (in the tool box).

here is a link how to use it:
http://www.youtube.com/watch?v=3HdJu1U6ciQ</a>[^]


Indeed use AJAX, more specific using updatepanel would be the easiest way.

<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
<asp:DropDownList

             ID="DropDownList1"

             runat="server"

             AutoPostBack="true"

             OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"

             >
        </asp:DropDownList>
            </ContentTemplate>
        </asp:UpdatePanel>



http://msdn.microsoft.com/en-us/library/bb399001.aspx[^]


Use juqery to bind dropdownlist without refresh of a page
See some good links

Populate dropdown using jQuery and KnockOut

http://www.c-sharpcorner.com/Blogs/13350/bind-dropdownlist-in-Asp-Net-using-jquery.aspx


这篇关于如何在不重新加载整个页面的情况下重新下载下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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