在asp.net中使用AJAX进行部分页面刷新 [英] partial page refresh using AJAX in asp.net

查看:92
本文介绍了在asp.net中使用AJAX进行部分页面刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个asp.net(3.5)网站。它包含两个webforms:



1.Parent.aspx --->此页面包含一个scriptmanager,updatepanel(有一个下拉列表连接到sqlsource,createnew按钮)和updatepanel外面的Refresh按钮。



-下拉列表显示sql中的客户名称表名为Customer。



2.Child.aspx --->这个webform包含一个名为txtCusName的文本框和一个提交按钮。





现在,我想要实现的目标如下:





- >当用户在parent.aspx时。它在下拉列表中查找客户名称。当用户没有在列表中看到所需的客户名称时。他按下createnew按钮。这将导致child.aspx显示在父项上。 aspx。



- >用户将使用txtCusName和提交按钮创建新的客户名称。新的客户名称将保存在数据库中。



我已经实现到这里,但之后关闭child.aspx并按下parent.aspx上updatepanel中的刷新按钮。下拉列表没有得到更新...



如何更新下拉列表???? plz帮帮我?????我想asap it it it。

I am trying to built an asp.net(3.5) website.It contains two webforms:

1.Parent.aspx--->This page contains a scriptmanager,updatepanel(having one dropdownlist connected to a sqlsource,createnew button) and a Refresh button outside updatepanel.

-The dropdownlist displays the customer name from the sql table named Customer.

2.Child.aspx--->THis webform contains a textbox named txtCusName and a submit buttton.


Now,What i want to achieve is the following:


-> When the user is at parent.aspx.It looks for the customer name in the dropdownlist.When the user doesnt see the required customer name in list.He presses the createnew button.This will cause the child.aspx to appear over the parent.aspx.

->the user will create new customer name by using txtCusName and submit button.The new customer name gets save in the database.

I have implemented till here but after that when i close the child.aspx and press refresh button in the updatepanel on parent.aspx.The dropdownlist is not getting updated...

how can i update the dropdownlist????plz help me out????? i want to imlement it asap.

推荐答案

请确保您的刷新按钮和下拉列表在同一个更新面板中,并且您在刷新按钮中将客户数据绑定到下拉列表中点击事件。



如果以上所有事情都是正确的,那么在刷新按钮点击事件中设置一个断点并检查下拉列表是否与客户数据绑定。



希望这对你有所帮助。
Please make sure that your refresh button and dropdownlist are in same update panel and you are binding dropdownlist with the customer data in refresh button click event.

If above every thing is right then put a break point into refresh button click event and check dropdownlist is binding with customer data or not.

Hope this will help you.


我在刷新按钮的c#代码中进行了操作。

i只需使用按钮绑定下拉列表就可以了。
I made a chaange in the c# code for the refresh button.
i just bound the dropdownlist with the button and it did the trick.


这篇关于在asp.net中使用AJAX进行部分页面刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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