Hi Jason,
Many Thanks, the code work fine with little adjustment, Another problem which I faced now is, I need to store the responses of user using images, For this I used java script but it not work,
<?xml version="1.0" standalone="yes"?>
<PICTURE_BOX>
<PBTop>544</PBTop>
<PBHeight>150</PBHeight>
<PBWidth>200</PBWidth>
</PICTURE_BOX>
ASPX.
VB
Public Image1 As System.Web.UI.WebControls.Image = New System.Web.UI.WebControls.Image()
Protected Overrides Sub OnInit(ByVal e As EventArgs)
Dim ds As Data.DataSet = New Data.DataSet()
Dim filePath As String = Server.MapPath("~/App_Data/My.XML")
ds.ReadXml(filePath)
For tcount = 0 To (ds.Tables.Count) - 1
Select Case (ds.Tables(tcount).TableName)
Case " PICTURE_BOX "
For Each dr As Data.DataRow In ds.Tables("TEXT_BOX").Rows
ph.Controls.Add(Image1)
Image1.ID = dr("ABLeft").ToString
Image1.Style.Add("top", dr("ABTop").ToString + "px")
Image1.ImageUrl = "~/p.gif"
Image1.Attributes.Add("name", dr("ABLeft").ToString))
Image1.Attributes.Add("onclick", "Javascript
:click1()")
Image1.Attributes.Add("ondblclick", "Javascript
:click2()")
End Select
Next
End Sub
ASPX
<script type="text/javascript" >
function click1(){document.getElementsById(
XXXX).src='blank.gif';}
function click2(){document.getElementsById(
XXXX).src='fill.gif';}
</script>
<html><body><form><div>
<asp:PlaceHolder ID="ph" runat="server"></asp:PlaceHolder>
</html></body></form></div>
If I hardcode the ID in document.getElementsById its work, My problem is how do I pass the Image ID from .aspx.
vb to .aspx wihch used in document.getElementsById and store it.
Thanks in advance