Referencing a frame

Discussion in 'ASP.NET / ASP.NET Core' started by Ken McLean, Dec 2, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am building an ASP.Net web page divided into frames. The frame on the left contains a Microsoft IE TreeView server control which is used for navigating the site. The frame on theright displays the page requested by the user. When the user clicks a node on the left it generates a server-side event which I am trying to code to change the contents of the frame on the right but I don't know how to get a reference to the right-side frame to change its src property in order to display the new page. I can refer to the page which contains the frame but I can't figure out how to get a reference to the frame on the page. Any suggestions will be appreciated. Thanks.

    Ken McLean
     
  2. Ken,


    I think you kind of have an application structure issue here, changing the source property of a frame is kind of a client side, I have not used the IE Tree View much, but does it not have the ability to fire client side events as well, so you can use the Target attribute e.g Target="Secondframe" which is the name of the frame on the right hand side the content frame.


    Alternatively you could go fully ASPX and convert your old pages to ascx and basically load the ascx into a server side panel control, then you would avoid those sorts of issues.


    So you get the postback from Treeview dependant on the node clicked you load a different ascx into a panel control, this would be much better :)


    you existing pages should convert to ascx controls very easily and effectively have want you want but it is all server side driven.


    Michael
     
  3. Mike,


    Thanks. Actually, I was trying to run the code on the server side. I had not realized the IE Treeview control had built in properties that can target a frame and a URL automatically when the selected node changes. I thought I had to write code to accomplish this. I set the properties instead and itis workingfine. Thanks again.


    Ken McLean
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page