如何在同一个视图页面中处理两个或多个下拉列表框和按钮之间的多个回发 [英] How Do I Handle multiple Post Backs Between Two or More Dropdown List Boxes and the Button In same View page

查看:70
本文介绍了如何在同一个视图页面中处理两个或多个下拉列表框和按钮之间的多个回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Friends,

I am new to MVC,

I should manage three <b>DropDownListBoxes</b> in my<b> single view page</b> , let it be

<b>Scheme_category</b><pre lang="xml">&lt;DDL1&gt;</pre>
                   <pre lang="xml">
                   &lt;scheme_item 1=&quot;&quot;&gt;
                   &lt;scheme_item 2=&quot;&quot;&gt;
                   ......
                   &lt;scheme_item n=&quot;&quot;&gt;</pre>



<b>Fund_category</b> <pre lang="xml">&lt;DDL2&gt;</pre>
                   <pre lang="xml">
                   &lt;fund_item 1=&quot;&quot;&gt;
                   &lt;fund_item 2=&quot;&quot;&gt;
                   ......
                   &lt;fund_item n=&quot;&quot;&gt;</pre>



<b>Payment_Category</b><pre lang="xml">&lt;DDL3&gt;</pre>

                   <pre lang="xml">
                   &lt;payment_item 1=&quot;&quot;&gt;
                   &lt;payment_item 2=&quot;&quot;&gt;
                   ......
                   &lt;payment_item n=&quot;&quot;&gt;</pre>


 1. If i click anyone of the Scheme_item from <b>DDL1</b> means, <b>DDl2 </b>and <b>DDL3 </b>should load their related category items  by automatically depending upon the condition of <b>DDL1</b> (It means Postback should be done in there itself)

(or else)

If I click anyone of the DDL's item, other two DDLs should Load their items ,automatically depending upon the conditions


2. after that i have to submit the page through the button_click(postback will be done here)


my Question is : Multiple Postbacks should be done , but different controls like(<b> DDL1,DDL2,DDL3 and BUTTON</b>

How can i handle the multiple postbacks in same view page, help me

but in MVC we cant use auto postback,

also the upadate panel

if we use the updatepanel through Ajax(javascript to invoke Ajax) means, suppose javascript is disabled in that browser means there is no use know

so give me some more idea


note: three DropDownList Boxes  and button are placed in Same view page.

Thanks In Advance,

Velsamy A





推荐答案

您好Avelsamy,



解决您的问题/问题可以做得很好很容易,你需要使用以下两个选项之一:



1)部分回发使用AJAX功能所谓的AJAX UpdatePanel触发器。但是,如果您确实从DDL1启用了回发驾驶,则会出现问题 - > DDL2;一种方法,这将工作,但如果你将做反之亦然,它将永远不会结束回发循环。

2)我将在这里强烈建议使用Webservices和Jquery来做这个操作,你可以使用智能编码驱动这个实现。



在最后,一旦你很好地使用Form及其验证,因此你可以使用完全回发使用一个普通的ASP.Net按钮。



如果需要进一步的帮助,请随时与我联系rahul.g2510@gmail.com。



问候

Rahul Goel
Hi Avelsamy,

Solution to your question/problem can be done quite easy that you will need to use either of two options:

1) Partial Postback using AJAX feature so called "AJAX UpdatePanel triggers". However there is a problem in that, if you do enable postback driving from DDL1 -> DDL2; One way, that will work, but if you will do vece-versa that it will be never ending postback loop.
2) I will srongly suggest here to use Webservices and Jquery to do this operation and you can drive this implementation using that with a smart coding.

And In final, Once you are good to go with Form and its validation, hence you can do full postback using a normal ASP.Net Button.

Feel free to contact me on rahul.g2510@gmail.com for any further help.

Regards
Rahul Goel


这篇关于如何在同一个视图页面中处理两个或多个下拉列表框和按钮之间的多个回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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