Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames without frames

Status
Not open for further replies.

johnny9864

Programmer
Sep 27, 2013
35
0
0
CA
I want to write an app with a treeview on the left and the corresponding page on the right. Perfect frame scenario. Can I replicate this in asp.net where when i click on the left tree, the right "frame" updates with the content of a page ?
 
Instead of a frame on the right to show your content, use a div. Then use javascript(I suggest using the JQuery library) to set the content of the div then a node is clicked in the treeview
 
That is easy to do yes but thameans I lose the code behind and all other code for the page. Or can I set the code behind within the div. (I don't think so)
 
Not sure what you are asking.
When you click on a treeview node, you can make an AJAX call using JQuery (this will call server code) then get your response and update the div.
 
Ok a better view of I want to do:

Lets say I develop pages to maintain stuff with each their own code behind for example EditEmployess.aspx, AddEmployees.aspx, etc... All these pages of course have no menus or anything, just the Data showing and edit controls.

Then My Default.aspx presents the left and right frames. In the left I have the tree and on the right I show the corresponding aspx page as requested on the tree.

Hope this is clearer

 
The way ASP.NET code behind works is not possible by just loading the HTML (View part) via Ajax.
I'm no ASP.NET expert, but I think the involvement of Ajax and ASP.NET is more complex for that very reason.

Code behind is a bad thing from a certain perspective. That's a more general observation, as that also is true for WPF or any other technology binding view and viewmodel or controller.
Browsers still support frames/iframes and though it may have a smell and is a nogog from some peoples persepcitves, it's a workable solution in regard of ASP.NET pages the way you do them.

There are specific extensions for ASP.NET in conjunction with Ajax, therefore: or
You know the Microsoft motto, don't you? Always making a simple entry point, for the price of making things much more complicated when you want to do non basic stuff, like - for example - printing from a lightswitch application (RIP).

Bye, Olaf.
 
There technically is no need for the code-behind in this scenerio other than maybe binding the treeview control. AJAX and HTML/CSS is all you need from what I can determine from your needs. If I am missing something let me know. We can figure something out
 
I understand it that way: The navigational treeview is introduced to ASP.NET pages previously each having their own code behind. That's making it the problem, if moving them to a DIV only.

Bye, Olaf.
 
Thank you both for your inputs, it seems ,like I originally taught, that it is not possible outside of normal asp.net coding. I will use an HTML frame for now and see in the future if it is possible to recode that starting page. The only solution I came up with is to do all the coding in the starting page and trying to redirect the code behind to that page but it is so outside of the normal way for ASP.NET developers that it would quickly become a nightmare.
 
The treeview is an ASP.NET control but does not affect in any way what I am saying. An onclick just needs to be put on each node that calls javascipt. There is no problem, and the page would only have one code-behind file, no matter how many nodes in the tree.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top