onclick方法想要显示特定的状态候选信息 [英] onclick method wanted to display particular state candidate information
本文介绍了onclick方法想要显示特定的状态候选信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的新求职网站需要一个jquery程序。我创建了雇主搜索页面,因此该页面包含多个州候选人详细信息。当用户单击给定状态的复选框并提交按钮时,特定学生的详细信息将显示在整个页面上。
I need a jquery program for my new jobconsultancy website. i have created employer searchng page so thiz page is containg several state candidate details.when the user click the check box of given state and submit the button .the the particular students details display on the entire page.
<div class="refaine123">
<div class="af-experiance"><span class="search-af-af-11">Location</span></div>
<div class="af-exp-dtl-1"><input name="sa" type="checkbox" value="" id="chk_delhi" runat="server"/>
Delhi </div>
<div class="af-exp-dtl-1"><input name="sa" type="checkbox" value="" id="chk_kochi" runat="server" />
Ernamkulam </div>
<div class="af-exp-dtl-1"><input name="sa" type="checkbox" value="" />
Mumbai </div>
<div class="af-exp-dtl-1"><input name="sa" type="checkbox" value="" />
Chennai </div>
<div class="af-exp-dtl-1"><input name="sa" type="checkbox" value="" />
Bangalore </div>
<div class="af-exp-dtl-1"><input name="sa" type="checkbox" value="" />
Others </div>
<div class="af-exp-dtl-2">Submit</div>
</div>
推荐答案
我们无法继续工作整个源代码。相反,我可以给出逻辑。
1.调用一个 JavaScript 函数onclick
那些CheckBoxes
。
2.在那个事件中,做一个jQuery Ajax
调用Code Behind中的WebMethod
并传递所选的CheckBox
值。
3.在那里WebMethod
,根据您的逻辑,根据CheckBox
值获取学生的详细信息。
4.从WebMethod
返回那些记录。
5.通过在aspx中分配返回值来显示记录详细信息
页面由 JavaScript / jQuery 。
要了解jQuery Ajax
和WebMethod
,请参阅 - 使用jQuery直接调用ASP.NET AJAX页面方法 [ ^ ]。
We can't work on the entire source code. Instead I can give the logic.
1. Call one JavaScript functiononclick
of thoseCheckBoxes
.
2. In that event, make ajQuery Ajax
call to aWebMethod
in Code Behind and pass the selectedCheckBox
value.
3. In thatWebMethod
, fetch the details of student according toCheckBox
value according to your logic.
4. Return those records from thatWebMethod
.
5. Show the record details by assigning returned values inaspx
page by JavaScript/jQuery.
To learn aboutjQuery Ajax
andWebMethod
, refer - Using jQuery to directly call ASP.NET AJAX page methods[^].
按照 Tadit Dash 给出的分步说明。
只需添加额外的参考链接
Article [ ^ ]
Follow the Step by Step instructions given by Tadit Dash.
Just adding an additional reference link
Article [^]
这篇关于onclick方法想要显示特定的状态候选信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文