ASP.NET - No existe en el contexto actual

 
Vista:

No existe en el contexto actual

Publicado por Daniel Herrera (2 intervenciones) el 06/01/2020 16:42:19
Buenos dias tengo el siguiente codigo en ASP.NET YA LO INTENTE DE TODAS LAS FORMAS

1
2
3
4
5
6
7
8
9
10
11
12
<form runat="server">
    <!-- Column 1 (horizontal, vertical, horizontal, vertical) -->
        <asp:DataList ID="DataImagenes" runat="server" >
            <ItemTemplate>
                <asp:ImageButton ID="imgPelicululas" runat="server" ImageUrl='<%# Eval("imagen") %>' Width="220px" Height="320px" OnClick="imgPelicululas_Click"/>
                <asp:Label ID="lblNombre" runat="server" Text='<%#Eval("Nombre") %>' ></asp:Label >
                <asp:Label ID="lblIdImage" runat="server" Text='<%#Eval("idVideo") %>' ></asp:Label>
                <br>
                </br>
            </ItemTemplate>
        </asp:DataList>
</form>

Y ESTE EN C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
protected void imgPelicululas_Click(object sender, ImageClickEventArgs e)
{
    video ObjVideo = new video();
    videoL ObjDatosVideo = new videoL();
    List<video> Lista = new List<video>();
    Lista = ObjDatosVideo.MtdVideo();
    var pelicula = imgPelicululas.Text;
 
    if (ObjVideo.imagen)
    {
 
    }
    Response.Redirect("InformacionVideo.aspx?Imagen=" + ObjVideo.imagen);
}

PERO CUANDO TRATO DE INSTANCIAR CUALQUIER ELEMENTO QUE ESTA DENTRO DEL FORM DICE QUE EL ELEMENTO NO EXISTE EN EL CONTEXTO ACTUAL Y YA LO

tambien lo intente asi

1
2
int ID = int.Parse(lblIdImage.Text).ToString();
Response.Redirect("InformacionVideo.aspx?id=" + ID);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

No existe en el contexto actual

Publicado por Daniel Herrera (2 intervenciones) el 06/01/2020 17:03:44
LA IDEA ES CAPTURAR EL ID o Alguno de los Datos que traigo de la base de datos para asi enviarlos atra pagina y mostrar todos los datos correspondientes
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar