从itemtemplate获取Id并将其传递给json [英] Get Id from itemtemplate and pass it through json

查看:184
本文介绍了从itemtemplate获取Id并将其传递给json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在使用 jquey json
$ b传递 AssetId 时显示资产详情$ b我想将此资产ID传递给 json WebMethod

我该怎么做?

 <   asp:Repeater     ID   =  rptAssets    runat   =  server >  
< HeaderTemplate >
< ; / HeaderTemplate >
< itemtemplate >

< 按钮 id = Button1 value =' <% #Eval( AssetId)%>' title = 按钮 > < / button >

< div id = dvAssets class = assetDetails >
< span class =code-keyword><
a href = >
< h3 > <% #Eval( AssetDesc)%>
<% #Eval( AssetId)%>
< / h3 >
< span > <% #Eval( Staus)%> < / span >
< / a >
< / div >
< / itemtemplate >

解决方案

将数据包装在一个Control的属性或类似的内容中......

 < span class =code-keyword><   asp:Label     ID   =  lblAssetID    runat   =  server    文字  =' < span class =code-keyword> <% #Eval(  AssetId)%>' >  <   / asp:Lable  >  



然后当您发送值时,访问特定行并在行内找到特定的 AssetID 并发送。


I want to show assetss details while passing the AssetId using jquey or json
I want to pass this asset id to json WebMethod.
How can I do this?

<asp:Repeater ID="rptAssets" runat="server">
    <HeaderTemplate>
    </HeaderTemplate>
    <itemtemplate>
          
        <button id="Button1" value='<%# Eval("AssetId") %>'  title="button" ></button>

        <div id="dvAssets" class="assetDetails">
            <a href="#">
                <h3><%# Eval("AssetDesc") %>
                    <%# Eval("AssetId") %>
                </h3>
                <span><%# Eval("Staus")%></span>
            </a>
        </div>
    </itemtemplate>

解决方案

Wrap the data inside one Control's property or something like...

<asp:Label ID="lblAssetID" runat="server" Text='<%# Eval("AssetId") %>'></asp:Lable>


Then when you are sending the value, access the particular row and find that particular AssetID inside the row and send that.


这篇关于从itemtemplate获取Id并将其传递给json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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