Ok i am design a website in VS 2008. I have a page Default.aspx which contains 3 iframes. frame1, frame2, frame3. At the load of Default.aspx frame1 loads top.aspx.
Top.aspx has a drop down list and a button on it. What i want to do is change the src of frame2 depending on what they select from the dropdownlist in top.aspx.
Now i have placed the following code in top.aspx
Protected WithEvents frame2 As System.Web.UI.HtmlControls.HtmlGenericControl
Protected Sub btnGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGo.Click
Dim frame2 As HtmlControl = CType(Page.FindControl("frame2"), HtmlControl)
frame2.Attributes("src") = "Page2.aspx"
Now Page2.aspx will eventually be changed to the option they choose from the dropdownlist but the problem is that when i run this frame2 has a NullReferenceException.
Have i placed the code in the wrong place? Is it supposed to be in Default.aspx if so how can i change the src of frame2 to whatever is chosen from the dropdownlist in top.aspx which is displayed in frame1
Any help is much appreciated