var vidList = document.getElementById("vidList");
var li = document.createElement("li");
li.id = "videoPlayer" + count;
var runat = document.createAttribute("runat");
runat.value = "server";
// Here I insert a flash video stream into li
This works as far as creating the elements and rendering them to the page. The issue is accessing them later. Since they are video streams I want to remove them when they are no longer valid streams. In my Visual Basic code behind I have the following code:
For videoNumber As Integer = 1 to numVideos
Dim li = vidList.FindControl("videoPlayer" & videoNumber.toString())
// Check if the stream is valid and delete it if it isn't
When I debug the call to
Nothing. So I looked through the local variables and found that my list had 5 elements all of which are
Nothing. I looked at both this question and this one, but neither quite worked for my needs. Is there a reason that the list items are coming into the code behind as null values?
Request.Form['videoPlayer' + count]
More generally you can use
Request.Form['clientID'] for dynamically created controls.