> Hi all,
>
[quoted text clipped - 17 lines]
> <%else%>
> <option
value="<%=oProductList.GetProduct(iCtr).ID%>"><%=oProductList.GetProduct(iCt
> r).Name%></option>
> <%End If
[quoted text clipped - 5 lines]
> Thanks in advance
> Prabhat
Here is a mock up:-
<%
Class CProd
Public Name
Public ID
Public Version
End Class
Class CList
Public Count
Public GetProduct
Private Sub Class_Initialize()
Count = 3
ReDim GetProduct(3)
Set GetProduct(1) = New CProd
Set GetProduct(2) = New CProd
Set GetProduct(3) = New CProd
GetProduct(1).ID = 1
GetProduct(2).ID = 2
GetProduct(3).ID = 3
GetProduct(1).Name = "First"
GetProduct(2).Name = "Second"
GetProduct(3).Name = "Third"
GetProduct(1).Version = "1.0"
GetProduct(2).Version = "1.1"
GetProduct(3).Version = "2.0"
End Sub
End Class
Dim oProductList: Set oProductList = New CList
Dim sProdID : sProdID = Request.QueryString("cmbProduct")
%>
<html>
<body>
<script type="text/javascript">
function cmdProduct_onchange()
{
document.getElementById('spnProdVer').innerHTML =
this.options[this.selectedIndex].getAttribute("version")
}
</script>
<select id="cboProd" name="cmbProduct"
onchange="cmdProduct_onchange.call(this)" >
<option <%=SelectedText("", sProdID)%> >Select a Product</option>
<%
Dim oProd
For iCtr = 1 to oProductList.Count
Set oProd = oProductList.GetProduct(iCtr)
%>
<option value="<%=oProd.ID%>" <%=SelectedText(oProd.ID, sProdID)%>
version="<%=Server.HTMLEncode(oProd.Version)%>"
><%=Server.HTMLEncode(oProd.Name)%></option>
<%
Next
Function SelectedText(rsID, rsProdID)
If CStr(rsID) = rsProdID Then
SelectedText = "selected"
Else
SelectedText = ""
End If
End Function
Function VersionText(roList, rsProdID)
If rsProdID <> "" Then
VersionText = roList.GetProduct(Clng(rsProdID)).Version
End If
End Function
%>
</select>
<span class="version"
id="spnProdVer"><%=Server.HTMLEncode(VersionText(oProductList,
sProdID))%></span>
</body>
</html>
Anthony.
Prabhat - 22 May 2006 15:36 GMT
Hi Anthony,
It was great. Working as I expected. I never know about this technique in
ASP. Thanks for this. I will also study more on this
Thanks again
Prabhat
> Here is a mock up:-
>
[quoted text clipped - 83 lines]
>
> Anthony.