Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从ListView asp.net获取单元格值_Asp.net_Listview - Fatal编程技术网

从ListView asp.net获取单元格值

从ListView asp.net获取单元格值,asp.net,listview,Asp.net,Listview,我有列表视图控件,我在其中显示一些乘客详细信息,如名字、姓氏等。每行代表一个乘客记录。现在,我使用两个按钮制作机票,并在每个按钮上单击URL代码。我想获取乘客URL代码或PNR代码以签发机票。我的问题是我无法获得按钮点击事件的值。你能建议我一些方法来获取代码隐藏的数据吗。下面你可以找到我的代码 <asp:ListView ID="showReservationDetails" runat="server" EnableViewState="False" O

我有列表视图控件,我在其中显示一些乘客详细信息,如名字、姓氏等。每行代表一个乘客记录。现在,我使用两个按钮制作机票,并在每个按钮上单击URL代码。我想获取乘客URL代码或PNR代码以签发机票。我的问题是我无法获得按钮点击事件的值。你能建议我一些方法来获取代码隐藏的数据吗。下面你可以找到我的代码

 <asp:ListView ID="showReservationDetails" runat="server" EnableViewState="False"
                OnPagePropertiesChanging="showReservationDetails_OnPagePropertiesChanging">
                <ItemTemplate>
                    <tr>
                        <td><%# Eval("ReservationCode")%></td>
                        <td><%# Eval("URLCode")%></td>
                        <td><%# Eval("ProviderCode")%></td>
                        <td><%# Eval("Status")%></td>
                        <td><%# Eval("Origin")%></td>
                        <td><%# Eval("Destination")%></td>
                        <td><%# Eval("TotalPrice")%></td>
                        <td><%# Eval("BasePrice")%></td>
                        <td><%# Eval("FirstName")%></td>
                        <td><%# Eval("LastName")%></td>
                        <td><%# Eval("ContactNumber")%></td>
                        <%--<td><asp:Button runat="server" Text="IssueTicket" ID="btnTicketRequest" CssClass="btn btn-primary btn-xs"  /> </td>
                        <td><asp:Button runat="server" Text="GetURICode" ID="btnURLRequest" CssClass="btn btn-primary btn-xs" /> </td>
                        --%>
                        <td>
                            <button id="btnTicketRequest" class="btn btn-primary btn-xs" runat="server" OnServerClick="btnTicketRequest_OnServerClick"
                                name="<%# Eval("ReservationCode")%>"></button>
                            <button id="btnUrlRequest" class="btn btn-primary btn-xs" runat="server" OnServerClick="btnUrlRequest_OnServerClick" 
                                name="<%# Eval("URLCode")%>"
                                mytag="something"></button>

                        </td>


                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <div class="table-responsive">
                        <table id="tbl1" runat="server" class="table table-striped table-condensed small">
                            <tr id="tr1" runat="server" class="success">
                                <th id="td1" runat="server">ReservationCode</th>
                                <th id="td2" runat="server">URLCode</th>
                                <th id="td3" runat="server">ProviderCode</th>
                                <th id="td4" runat="server">Status</th>
                                <th id="td5" runat="server">Origin</th>
                                <th id="td6" runat="server">Destination</th>
                                <th id="td7" runat="server">TotalPrice</th>
                                <th id="td8" runat="server">BasePrice</th>
                                <th id="td9" runat="server">FirstName</th>
                                <th id="td10" runat="server">LastName</th>
                                <th id="td12" runat="server">ContactNumber</th>
                                <th id="Th1" runat="server">GetTicket</th>
                                <th id="Th2" runat="server">URICode</th>

                            </tr>
                            <tr id="ItemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </div>
                </LayoutTemplate>

                <EmptyDataTemplate>  
            <table class="table">  
                <tr>  
                    <th class="danger text-center">  
                        No record found against provided data.  
                    </th>                      
                </tr>  
            </table>  
        </EmptyDataTemplate>  
            </asp:ListView>
        </div>
    </div>
    <div class="row">
        <div class="form-group col-lg-4">
            <asp:DataPager ID="dataPager" runat="server" PagedControlID="showReservationDetails" PageSize="10">
                <Fields>
                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowPreviousPageButton="True"
                        ShowNextPageButton="False" ButtonCssClass="btn btn-primary btn-xs" />
                    <asp:NumericPagerField ButtonType="Link" />
                    <asp:NextPreviousPagerField ButtonType="Button" ButtonCssClass="btn btn-primary btn-xs"
                        ShowNextPageButton="True" ShowLastPageButton="True" ShowPreviousPageButton="False" />
                </Fields>
            </asp:DataPager>
        </div>
    </div>

预订代码
URL代码
提供者代码
地位
起源
目的地
总价
基准价
名字
姓氏
联系电话
盖蒂克特
尿码
未根据提供的数据找到任何记录。