PEGAR VARIAVEL PUBLICA
Olá pessoal, estou usando uma variavel para mostrar videos do estilo youtube em minha aplicação, de um embed direto do aspx, os links estão no meu banco de dados o q ocorre é que preciso q a pagina se atualize automaticamente qdo um link de um novo video for inserido + não estou conseguindo passar os valores pra + de uma variavel e seriam 5 ou seja os ultimos 5 links inserido. segue abaixo o código.
obs:estou usando o RadStudio
public
video: array[0..2] of STRING;
I : INTEGER;
{ Public Declarations }
procedure Select();
procedure Update();
end;
implementation
procedure TDefault.Page_Load(sender: System.Object; e: System.EventArgs);
var
dr : BdpDataReader;
begin
Connection.Open();
try
I:=1;
BdpVideos.SelectCommand;
dr := BdpVideos.SelectCommand.ExecuteReader();
dr.Read();
video[I] := dr[´LINK´].ToString();
I :=I +1;
video[I] := dr[´LINK´].ToString();
dr.Close;
finally
Connection.Close();
end;
end;
/////////////////////////////////////////////////////////////////////////////////
<¬@ Page language=´c#´ Debug=´true´ Codebehind=´Default.pas´ AutoEventWireup=´false´ Inherits=´Default.TDefault´ ¬>
<!DOCTYPE HTML PUBLIC ´-//W3C//DTD HTML 4.01 Transitional//EN´>
<html>
<head runat=´server´>
<title></title>
</head>
<body>
<asp:Label id=´Label1´ runat=´server´ text=´Label´ font-names=´Verdana´ font-size=´Large´></asp:Label>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<asp:TextBox id=´TextBox2´ runat=´server´ width=´343px´ visible=´False´></asp:TextBox>
<asp:Label id=´Label2´ runat=´server´ text=´Label´ font-names=´Verdana´ font-size=´Medium´></asp:Label>
<asp:Label id=´Label3´ runat=´server´ text=´Label´ font-names=´Verdana´ font-size=´XX-Small´></asp:Label></embed>
</body>
</html>
obs:estou usando o RadStudio
public
video: array[0..2] of STRING;
I : INTEGER;
{ Public Declarations }
procedure Select();
procedure Update();
end;
implementation
procedure TDefault.Page_Load(sender: System.Object; e: System.EventArgs);
var
dr : BdpDataReader;
begin
Connection.Open();
try
I:=1;
BdpVideos.SelectCommand;
dr := BdpVideos.SelectCommand.ExecuteReader();
dr.Read();
video[I] := dr[´LINK´].ToString();
I :=I +1;
video[I] := dr[´LINK´].ToString();
dr.Close;
finally
Connection.Close();
end;
end;
/////////////////////////////////////////////////////////////////////////////////
<¬@ Page language=´c#´ Debug=´true´ Codebehind=´Default.pas´ AutoEventWireup=´false´ Inherits=´Default.TDefault´ ¬>
<!DOCTYPE HTML PUBLIC ´-//W3C//DTD HTML 4.01 Transitional//EN´>
<html>
<head runat=´server´>
<title></title>
</head>
<body>
<asp:Label id=´Label1´ runat=´server´ text=´Label´ font-names=´Verdana´ font-size=´Large´></asp:Label>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<embed src=´<¬=video[I] ¬> ´ type=´application/x-shockwave-flash´ allowfullscreen=´true´ width=´425´ height=´344´>
<asp:TextBox id=´TextBox2´ runat=´server´ width=´343px´ visible=´False´></asp:TextBox>
<asp:Label id=´Label2´ runat=´server´ text=´Label´ font-names=´Verdana´ font-size=´Medium´></asp:Label>
<asp:Label id=´Label3´ runat=´server´ text=´Label´ font-names=´Verdana´ font-size=´XX-Small´></asp:Label></embed>
</body>
</html>
Nilton_rev
Curtidas 0