asked on
ASKER
ASKER
ASKER
<asp:image id="imgMyPicture" runat="server" ImageUrl="Try2_ImageSupplier.aspx"></asp:image>
ASKER
ASKER
ASKER
ASKER
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="imgPicture" runat="server" AlternateText="Picture" ImageUrl="~/Draw.aspx" /></div>
</form>
</body>
</html>
'Draw.aspx
Partial Class Draw
Inherits System.Web.UI.Page
Dim ds As New DataSet
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("AdventureWorks2000ConnectionString").ToString())
Dim sda As New SqlDataAdapter()
sda.SelectCommand = New SqlCommand("SELECT ThumbNailPhoto, LargePhoto FROM ProductPhoto WHERE (ProductPhotoID = 1)", conn)
sda.Fill(ds)
Dim dr As DataRow = ds.Tables(0).Rows(0)
Dim data() As Byte
data = dr("ThumbNailPhoto")
Response.ContentType = "image/jpeg"
Response.OutputStream.Write(data, 0, data.Length)
Response.End()
End Sub
End Class
Try
da.Fill(m_dsPhotos)
drows = m_dsPhotos.Tables(0).Select("InventoryItemUniqueID=3")
bytes = drows(0).Item("Picture")
Response.ContentType = "image/jpeg"
Response.BinaryWrite(bytes)
Response.End()
Catch ex As Exception
End Try
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY