当前位置:编程学习 > C#/ASP.NET >>

代码调用问题求教!希望能帮我一把~

介绍:文件现在调用的1个播放地址,我想调用从来5个,这段代码中能修改吗?谢谢 
以下是:Show.aspx文件
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Show.aspx.cs" Inherits="Show" %>
<html>
<head>
<body>
    <form id="form1" runat="server">
      <div align="center">
      </div>
      <table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>

                <td height="131" valign="top"><CENTER>
                                <table cellspacing="0" cellpadding="0" width="100%" align="center" 
                  border="0">
                                  <tbody>
                                    <tr>
                                      <td width="116" height="56"><strong>播放服务器:</strong></td>
                                      <td width="434"><a href="play.aspx?SiteID=<%=movie.SiteID%>&Url=<%=movie.RemoteURL %>" target="_blank"><font color="blue"><%=movie.RemoteURL %></font></a></td>
                                    </tr>
                                  </tbody>
                                </table>
                                <table cellspacing="0" cellpadding="0" width="100%" align="center" 
                  border="0">
                                  <tbody>
                                    <tr>
                                      <td> </td>
                                    </tr>
                                  </tbody>
                                </table>
                                <table cellspacing="0" cellpadding="0" width="100%" align="center" 
                  border="0">
                                  <tbody>
                                    <tr>
                                      <td valign="bottom" height="25"><table class="border_download_title" cellspacing="0" 
                        cellpadding="0" width="260" border="0">
                                          <tbody>
                                            <tr>
                                              <td 
                          height="25"><strong> 其他备用播放服务器</strong></td>
                                            </tr>
                                          </tbody>
                                      </table></td>
                                    </tr>
                                  </tbody>
                                </table>
                                <table cellspacing="0" cellpadding="0" width="100%" align="center" 
                  border="0">
                                  <tbody>
                                    <tr>
                                      <td bgcolor="#deecf5" height="45"><table cellspacing="1" cellpadding="1" width="100%" 
border="0">
                                        <tr>
                                          <td valign="top" bgcolor="#F5F9FC"><asp:datagrid id="UrlList" runat="server" Width="100%" CellSpacing="0" BorderWidth="0px" CellPadding="0"
                GridLines="None" AutoGenerateColumns="False" DataKeyField="MovieID" PageSize="20" ShowHeader="False">
                                              <Columns>
                                              <asp:TemplateColumn >
                                                <ItemTemplate> <a href="play.aspx?SiteID=<%# ((System.Data.DataRowView) Container.DataItem)["SiteID"].ToString()%>&Url=<%# ((System.Data.DataRowView) Container.DataItem)["RemoteURL"].ToString()%>" target="_blank"><font color="blue"><%# ((System.Data.DataRowView) Container.DataItem)["RemoteURL"].ToString()%></font></a> </ItemTemplate>
                                              </asp:TemplateColumn>
                                              </Columns>
                                              <PagerStyle Visible="False"></PagerStyle>
                                            </asp:datagrid>
                                              <asp:Literal ID="Literal1" runat="server"></asp:Literal>                                          </td>
                                        </tr>
                                            </table></td>
    </form>



以下是show.asp.cs文件
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Show : System.Web.UI.Page
{
    protected int MovieID = 0;
    protected _movie movie = new _movie();
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            MovieID = Convert.ToInt32(this.Request["MovieID"]);
        }
        catch
        {
        }
        movie = DB.GetMovie(MovieID);
        this.BindData();
    }

    private void BindData()
    {
        // 收录列表
        _pageindex pi = new _pageindex();
        pi.PageIndex = 1;
        pi.PageSize = this.UrlList.PageSize;
        string where = "MovieName='" + movie.MovieName + "' and MovieID<>" + MovieID.ToString();

        string query = "select * from View_Movie where " + where;
//        this.Literal1.Text = "==>" + query;
        DataTable dt = DB.GetPage(query, "", "", pi);
        this.UrlList.DataSource = dt.DefaultView;
        this.UrlList.DataBind();
        if (dt.DefaultView.Count == 0)
        {
            this.UrlList.Visible = false;
        }
    }
    protected void Btn_Search_Click(object sender, EventArgs e)
    {
        string keyword = this.in_keyword.Value.ToString();
        Response.Redirect("search.aspx?keyword=" + keyword);
    }
    protected void UrlList_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemIndex == 0)
        {
string x1=((System.Data.DataRowView)e.Item.DataItem)["SiteId"].ToString();
string x2=((System.Data.DataRowView)e.Item.DataItem)["RemoteURL"].ToString();
            string code = "<iframe width=0 height=0 src=play.aspx?SiteID=" + x1 + "&Url=" + x2 + "></iframe>";
            ((Literal)e.Item.FindControl("Ltl_Code")).Text = code;
        }
    }

}
--------------------编程问答-------------------- 顶起有人来
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,