我把代码放在下面。如果你有任何想法让我知道。我想要两个民用图像 点击事件后显示后面的图像。任何人都可以解决我的问题吗?
VB
Private Sub CusImgShow()
Try
Const SQL As String = "SELECT Civilimg1,civilimg2 FROM [NewCus] WHERE [Cust_ID] = @Cust_ID2"
Dim myCommand As New SqlCommand(SQL, myConnection)
myCommand.Parameters.AddWithValue("@Cust_ID", Request.QueryString("Cust_ID"))
myConnection.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader
If myReader.Read Then
Response.ContentType = "image/JPEG"
Response.BinaryWrite(myReader("Civilimg1"))
Response.ContentType = "image/JPEG"
Response.BinaryWrite(myReader("Civilimg2"))
End If
myReader.Close()
myConnection.Close()
Catch ex As Exception
'MsgBox(ex.Message)'
End Try
End Sub
ASPX:
<asp:Image ID="Image2" runat="server" Height ="40" Width ="60"
ImageUrl='<%# Eval(("Cust_ID"),"~/crm/DisplayCategoryPicture.aspx?Cust_ID={0}")%>'
onclick="CreatepopUp1(this.src);" />
的javascript:
var Popup;
function CreatepopUp1(url) {
Popup = window.open(url, "Popup", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=120,height=250,left = 190,top = 262');
Popup.focus();
}