如何在Datalist中设置Div的值 [英] How to set a value on Div in Datalist
问题描述
我试过谷歌但是还没有得到合适的解决方案。我想在jquery的Datalist帮助中设置Div的值。因为我想要在没有页面回发的情况下获取并保存在数据库中。我尝试了很多方法,但不能成功。我尝试添加cssclass值find但所有cssclass值都找不到。就像我们的数据主义者有三个记录一样
那样
1。 job_id 11
2。 job_id 12
3。 job_id 13
假设我点击job_id 11然后只更改值11而不是12或13条记录。
下面提到一些代码。
i have try google but can't get a proper solution yet. I want set a value on Div in Datalist help of jquery. Because i want value get and save in database without page postback. I have try many way but can't success. i try add cssclass value find but all cssclass value find. like that our datalist have three record's
like that
1 . job_id 11
2 . job_id 12
3 . job_id 13
suppose I click the job_id 11 then change the value only 11 not a 12 or 13 record's.
some code mention below.
<asp:ImageButton ID="Img_Up_vote" runat="server" OnClientClick="upvote(this);return false;"
ImageUrl="~/images/up.png" data-JobID='<%#Eval("OrgJob_id")%>' />
</a>
<br />
<div id="vote_score">
<%#Eval("VoteCount")%></div> //Change the Data here
<br />
plz有些身体帮助我...在预先感谢。
plz some body help me ...thanks in Advance.
推荐答案
好的,首先给你的div一个属性,即runat =server
。
像这样:
Okay, first give one attribute to your div first, i.erunat="server"
.
Like this :
<div ID="div1" runat="server">
<%#Eval("YourColumName")%>
</div>
最后,您的代码将是:
So finally, your code would be :
<asp:imagebutton id="Img_Up_vote" runat="server" onclientclick="upvote(this);return false;" xmlns:asp="#unknown">
ImageUrl="~/images/up.png" data-JobID='<%#Eval("OrgJob_id")%>' />
<br />
<div id="vote_score" runat="server">
<%#Eval("VoteCount")%></div>
<br /></asp:imagebutton>
-KR
-KR
这篇关于如何在Datalist中设置Div的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!