<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script src="js/stuHover.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="../style-projects-jquery.css" /> <!-- Arquivos utilizados pelo jQuery lightBox plugin --> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script> <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /> <!-- / fim dos arquivos utilizados pelo jQuery lightBox plugin --> <!-- Ativando o jQuery lightBox plugin --> <script type="text/javascript"> $(function() { $('#gallery a').lightBox(); }); </script> </head> <body> <!-- Here s as string variable --> <% s%> <form id="form1" runat="server"> <div> <div id="gallery"> <asp:Button ID="Button1" runat="server" Text="Button" /> <a href=> <asp:Image ID="Image1" runat="server" ImageUrl="~/gallery/Necklace/necklace13.jpg" /> </a> </div> </div> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> </asp:DropDownList> </form> </body> </html>
Partial Class test Inherits System.Web.UI.Page Public s As String Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Image1.ImageUrl = "gallery/Ring/ring5.jpg" MsgBox(s) End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load s = Image1.ImageUrl End Sub Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged If DropDownList1.SelectedValue = "1" Then Image1.ImageUrl = "gallery/Ring/ring5.jpg" ElseIf DropDownList1.SelectedValue = "2" Then Image1.ImageUrl = "gallery/Necklace/necklace2.jpg" ElseIf DropDownList1.SelectedValue = "3" Then Image1.ImageUrl = "gallery/bangal/bangal6.jpg" End If End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)