menu dinamico
Publicado por Ignadyne (1 intervención) el 15/07/2009 21:27:33
Hola
estoy trabajando en un proyecto en asp.net el cual muestra video en vivo, dependiendo del perfil de usuario registrado al cual a su vez puede acceder a 4 subcanales del servicio.
En general esta funcionando todo lo de proceso de validacion y redireccion, streaming, etc, el problema esta que en la pagina del cliente, en la cual tiene a la vista los servicios no he logrado hacer que estos sean dinamicos, o sea que los valores de alternativas dentro del box cambien respecto al cliente que accede.
ahi va el codigo:
[CODE]<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Vivo!" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsPostBack Then
Session("ClientID") = Nothing
If User.Identity.IsAuthenticated Then
If User.IsInRole("admin") Then
If Request("ClientID") IsNot Nothing Then
Session("ClientID") = Request("ClientID")
End If
Else
Session("ClientID") = User.Identity.Name
End If
End If
End If
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
</script>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<script language="javascript" type="text/javascript">
</script>
<%
Dim servid --> esto lo arme para ver el codigo del servicio, pero es temporal
servid = Request.QueryString("servid")
Response.Write("Servicio:" & servid)
Response.Write("<br>")
%>
Seleccione
<select onchange="javascript:document.getElementById('mediaPlayer1').Filename=this.value;document.getElementById('mediaPlayer1').src=this.value;">
<option value="mms://video1.com:8000">.::canal1::.</option> -->aqui esta el atado
<option value="mms://video2.com:8001">.::Canal2::.</option> -->coloque datos estaticos para probar el box, pero donde dice “video1.com” necesito colocar el resultado de la consulta(esta al final)
<option value="mms://video3.com:8002">.::Canal3::.</option>
<option value="mms://video4.com:8003">.::Canal4::.</option>
</select>
<div style="width: 320px; height: 157px">
<div style="width: 308px; height: 180px">
<object id="MediaPlayer1" align="right" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Gardenet Webcam Service" style="width: 322px; height: 238px" type="application/x-oleobject">
<param name="FileName" value="mms://video1.com:8000"/> -->option value se utiliza aqui
<param name="ShowStatusBar" value="True"/>
<param name="DefaultFrame" value="Vivo!"/>
<param name="ShowControls" value="false"/>
<param name="ShowDisplay" value="false"/>
<param name="enableContextMenu" value="false"/>
<param name="transparentatStart" value="true"/>
<embed height="265" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" showcontrols="0"
showstatusbar="1" src="mms://Vivo!" type="application/x-mplayer2" width="320"> </embed></object>
<center>
</center>
<a href="mms:Vivo!"><span style="font-size: 9pt"><span style="font-family: Georgia">
<span style="color: #0000ff"></span></span></span></a>
</div>
</div>
<br />
<br />
<br />
<br />
<span style="font-size: 10pt"><span style="font-size: 14pt">
<br />
<br />
Bienvenido</span><br />
<span /></span>
<asp:LoginName ID="LoginName1" runat="server" />
<br />
<br />
<br />
<span style="font-size: 10pt"><span style="font-size: 14pt">
Usted esta conectado en :</span><br />
<span /></span>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Cliente"
DataSourceID="SqlDataSource1" Width="519px" EnableSortingAndPagingCallbacks="True" Height="33px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Recinto" HeaderText="Recinto" SortExpression="Recinto" />
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ReadOnly="True" SortExpression="Cliente" />
<asp:BoundField DataField="Canales Activos" HeaderText="Canales Activos" SortExpression="Canales Activos" />
<asp:BoundField DataField="Fono" HeaderText="Fono" SortExpression="Fono" />
<asp:BoundField DataField="Contacto" HeaderText="Contacto" SortExpression="Contacto" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:GardenetDBConnectionString1 %>"
SelectCommand="SELECT aspnet_Service.ServName AS Recinto, aspnet_ServiceDetails.ServID AS Cliente, aspnet_ServiceDetails.CamActive AS [Camaras Activas], aspnet_Service.ServPhone AS Fono, aspnet_Service.ServContact AS Contacto FROM aspnet_Service INNER JOIN aspnet_ServiceDetails ON aspnet_Service.ServID = aspnet_ServiceDetails.ServID WHERE (aspnet_Service.ClientID = @ClientID) AND (aspnet_Service.ServID = @ServID)">
<SelectParameters>
<asp:SessionParameter Name="ClientID" SessionField="ClientID" />
<asp:QueryStringParameter Name="ServID" QueryStringField="ServID" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content> [/CODE]
-------------------------------------------------------------
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:GardenetDBConnectionString1 %>"
SelectCommand="SELECT aspnet_ServiceDetails.WebtxIP FROM aspnet_Service INNER JOIN aspnet_ServiceDetails
ON aspnet_Service.ServID = aspnet_ServiceDetails.ServID
WHERE (aspnet_Service.ClientID = @ClientID) AND (aspnet_Service.ServID = @ServID) ">
<SelectParameters>
<asp:SessionParameter Name="ClientID" SessionField="ClientID" />
<asp:QueryStringParameter Name="ServID" QueryStringField="ServID" />
</SelectParameters>
</asp:SqlDataSource>
-------------------------------------------------------------------------------------------------------------------------
[B]esta es la consulta que quiero usar para entablecer el parametro.[/B]
Seguramente es simple, pero no doy con la solucion y es lo unico que me resta para poder terminar esto.
Saludos y Gracias :-)
estoy trabajando en un proyecto en asp.net el cual muestra video en vivo, dependiendo del perfil de usuario registrado al cual a su vez puede acceder a 4 subcanales del servicio.
En general esta funcionando todo lo de proceso de validacion y redireccion, streaming, etc, el problema esta que en la pagina del cliente, en la cual tiene a la vista los servicios no he logrado hacer que estos sean dinamicos, o sea que los valores de alternativas dentro del box cambien respecto al cliente que accede.
ahi va el codigo:
[CODE]<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Vivo!" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsPostBack Then
Session("ClientID") = Nothing
If User.Identity.IsAuthenticated Then
If User.IsInRole("admin") Then
If Request("ClientID") IsNot Nothing Then
Session("ClientID") = Request("ClientID")
End If
Else
Session("ClientID") = User.Identity.Name
End If
End If
End If
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
</script>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<script language="javascript" type="text/javascript">
</script>
<%
Dim servid --> esto lo arme para ver el codigo del servicio, pero es temporal
servid = Request.QueryString("servid")
Response.Write("Servicio:" & servid)
Response.Write("<br>")
%>
Seleccione
<select onchange="javascript:document.getElementById('mediaPlayer1').Filename=this.value;document.getElementById('mediaPlayer1').src=this.value;">
<option value="mms://video1.com:8000">.::canal1::.</option> -->aqui esta el atado
<option value="mms://video2.com:8001">.::Canal2::.</option> -->coloque datos estaticos para probar el box, pero donde dice “video1.com” necesito colocar el resultado de la consulta(esta al final)
<option value="mms://video3.com:8002">.::Canal3::.</option>
<option value="mms://video4.com:8003">.::Canal4::.</option>
</select>
<div style="width: 320px; height: 157px">
<div style="width: 308px; height: 180px">
<object id="MediaPlayer1" align="right" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Gardenet Webcam Service" style="width: 322px; height: 238px" type="application/x-oleobject">
<param name="FileName" value="mms://video1.com:8000"/> -->option value se utiliza aqui
<param name="ShowStatusBar" value="True"/>
<param name="DefaultFrame" value="Vivo!"/>
<param name="ShowControls" value="false"/>
<param name="ShowDisplay" value="false"/>
<param name="enableContextMenu" value="false"/>
<param name="transparentatStart" value="true"/>
<embed height="265" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" showcontrols="0"
showstatusbar="1" src="mms://Vivo!" type="application/x-mplayer2" width="320"> </embed></object>
<center>
</center>
<a href="mms:Vivo!"><span style="font-size: 9pt"><span style="font-family: Georgia">
<span style="color: #0000ff"></span></span></span></a>
</div>
</div>
<br />
<br />
<br />
<br />
<span style="font-size: 10pt"><span style="font-size: 14pt">
<br />
<br />
Bienvenido</span><br />
<span /></span>
<asp:LoginName ID="LoginName1" runat="server" />
<br />
<br />
<br />
<span style="font-size: 10pt"><span style="font-size: 14pt">
Usted esta conectado en :</span><br />
<span /></span>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Cliente"
DataSourceID="SqlDataSource1" Width="519px" EnableSortingAndPagingCallbacks="True" Height="33px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Recinto" HeaderText="Recinto" SortExpression="Recinto" />
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ReadOnly="True" SortExpression="Cliente" />
<asp:BoundField DataField="Canales Activos" HeaderText="Canales Activos" SortExpression="Canales Activos" />
<asp:BoundField DataField="Fono" HeaderText="Fono" SortExpression="Fono" />
<asp:BoundField DataField="Contacto" HeaderText="Contacto" SortExpression="Contacto" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:GardenetDBConnectionString1 %>"
SelectCommand="SELECT aspnet_Service.ServName AS Recinto, aspnet_ServiceDetails.ServID AS Cliente, aspnet_ServiceDetails.CamActive AS [Camaras Activas], aspnet_Service.ServPhone AS Fono, aspnet_Service.ServContact AS Contacto FROM aspnet_Service INNER JOIN aspnet_ServiceDetails ON aspnet_Service.ServID = aspnet_ServiceDetails.ServID WHERE (aspnet_Service.ClientID = @ClientID) AND (aspnet_Service.ServID = @ServID)">
<SelectParameters>
<asp:SessionParameter Name="ClientID" SessionField="ClientID" />
<asp:QueryStringParameter Name="ServID" QueryStringField="ServID" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content> [/CODE]
-------------------------------------------------------------
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:GardenetDBConnectionString1 %>"
SelectCommand="SELECT aspnet_ServiceDetails.WebtxIP FROM aspnet_Service INNER JOIN aspnet_ServiceDetails
ON aspnet_Service.ServID = aspnet_ServiceDetails.ServID
WHERE (aspnet_Service.ClientID = @ClientID) AND (aspnet_Service.ServID = @ServID) ">
<SelectParameters>
<asp:SessionParameter Name="ClientID" SessionField="ClientID" />
<asp:QueryStringParameter Name="ServID" QueryStringField="ServID" />
</SelectParameters>
</asp:SqlDataSource>
-------------------------------------------------------------------------------------------------------------------------
[B]esta es la consulta que quiero usar para entablecer el parametro.[/B]
Seguramente es simple, pero no doy con la solucion y es lo unico que me resta para poder terminar esto.
Saludos y Gracias :-)
Valora esta pregunta


0