ASP.Net/HTML Control/Image Control

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Displaying an Image through the HTML Image Control (VB.net)

   <source lang="csharp">

<%@ Page Language=VB Debug=true %> <script runat=server> Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs) End Sub </SCRIPT> <HTML> <HEAD> <TITLE>Displaying an Image through the HTMLImage Control</TITLE> </HEAD> <BODY> <form runat="server"> <img

   id="Image1"
   runat="Server"
   src="http://www.nfex.ru/style/download.png"

>

<img

   id="Image2"
   runat="Server"
   src="http://www.nfex.ru/style/download.png"
   alt="Picture of a button."
   border="4"

>

<img

   id="Image3"
   runat="Server"
   src="http://www.nfex.ru/style/download.png"
   width="300"
   height="300"

> </form> </BODY> </HTML>

      </source>
   
  


Retrieving Clicked Coordinates through the HTML Input Image Control (VB.net)

   <source lang="csharp">

<%@ Page Language=VB Debug=true %> <script runat=server> Sub SubmitBtn_Click(Source As Object, E as ImageClickEventArgs)

   MyMessage.InnerHTML = "Coordinates Clicked

" _ & "X: " & E.X & "
" _ & "Y: " & E.Y

End Sub </SCRIPT> <HTML> <HEAD> <TITLE>Retrieving Clicked Coordinates through the HTMLInputImage Control</TITLE> </HEAD> <BODY> <form runat="server">

<input

   id="ImageButton1"
   runat="server"
   type="image"
   src="http://www.nfex.ru/style/logo.png"
   onserverclick="SubmitBtn_Click" 

> </Form> </BODY> </HTML>

      </source>
   
  


Using the HTML Input Image Control to triger event (VB.net)

   <source lang="csharp">

<%@ Page Language=VB Debug=true %> <script runat=server> Sub SubmitBtn_Click(Source As Object, _

   E as ImageClickEventArgs)
   MyMessage.InnerHTML = "Hello " & YourName.Value

End Sub </SCRIPT> <HTML> <HEAD> <TITLE>Using the HTMLInputImage Control</TITLE> </HEAD> <BODY> <form runat="server">
Name:
<input

   id="YourName"
   runat="server"
   type="text"

>


<input

   id="ImageButton1"
   runat="server"
   type="image"
   src="http://www.nfex.ru/style/download.png"
   onserverclick="SubmitBtn_Click" 

> </Form> </BODY> </HTML>

      </source>