Click here to Skip to main content
Click here to Skip to main content

ASP.NET Ajax Controls to Simulate IFrame

By , 8 Nov 2009
 
APXControl

Introduction

Sometimes we use the <IFrame> tag to design the frame page. However, the data exchange between each page will become very difficult to handle. Or, once the structure of frame changes to a normal page, a lot of work needs to be carried out.

Sure I developed an Ajax control to simulate <IFrame>. It works like the Microsoft MSDN Library site.

Introducing the PartialHyperLink Control

APXExt library includes two Ajax controls:

  • ResizableArea - simulates IFrame
  • Accordion - allows you to provide multiple panes and display them one at a time

APXExt depends on Microsoft System.Web.Externsions.dll and APEnnead.net free version Symber.Web.dll.

If needed, you can download for free:

Using the Code

To use the control, simply reference the "Symber.Web.APX.dll" file into your web project.

Next, register the control on each .ASPX page you want to use it on, by writing the following line at the top of the page:

<%@ Register TagPrefix="apX" Namespace="Symber.Web.APX" Assembly="Symber.Web.APX" %>

Using APXResizableAreaBehavior, you can create the following code:

<asp:Panel ID="ra" runat="server" CssClass="resizableArea">
  <asp:Panel ID="raLeft" runat="server" CssClass="leftSection">
  </asp:Panel>
  <asp:Panel ID="raSplitter" runat="server" CssClass="splitter">
	<div class="grippy"></div></asp:Panel>
  <asp:Panel ID="raRight" runat="server" CssClass="rightSection">
  </asp:Panel>
  <apx:APXResizableAreaBehavior id="raBehavior" runat="server"
    TargetControlID="ra"
    LeftID="raLeft"
    RightID="raRight"
    SplitterID="raSplitter"
    CookiePath="/" />
</asp:Panel>

Using APXAccordionBehavior, you can create the following code:

<apX:APXAccordion ID="accordion" runat="server"
     SelectedIndex="1"
     CookieEnabled="true"
     HeaderCssClass="accordionHeader"
     HeaderSelectedCssClass="accordionHeaderSelected"
     ContentCssClass="accordionContent"
     FadeTransitions="false"
     FramesPerSecond="40" 
     TransitionDuration="250"
     AutoSize="None"
     RequireOpenedPane="false"
     SuppressHeaderPostbacks="true"
     CookiePath="/"
     CookieEnabed="true">
  <Panes>
    <apX:APXAccordionPane ID="accordionPane1" runat="server">
      <Header><div class="inner">
	<a href="" class="accordionLink">Title1</a></div></Header>
      <Content>Content1</Content>
    </apX:APXAccordionPane>
    <apX:APXAccordionPane ID="accordionPane2" runat="server">
      <Header><div class="inner">
	<a href="" class="accordionLink">Title2</a></div></Header>
      <Content>Content2</Content>
    </apX:APXAccordionPane>
  </Panes>
</apX:APXAccordion>

That's all!

I've included a small example project to demonstrate how to use the control.

More

Next, we can use the APEnnead.net virtual_page and page_layout techniques to achieve each page. The following content is all based on APEnnead.net Free Version. About How to create APEnnead.net project, you can read "/Toturials/Create apennead application.htm" in the sample code.

Step 1 - Create Four .ascx Controls

Modules/Feature.ascx
Modules/Msdn.ascx
Modules/Email/Fly.ascx
Modules/Email/Overview.ascx

Step 2 - Add Modules Information into web.config

<APSchema>
  <Modules>
    <add uri="url:~/Modules/Msdn.ascx" name="Msdn Library"/>
    <add uri="url:~/Modules/Feature.ascx" name="Feature Spotlight"/>
    <Page name="email*">
      <add uri="url:~/Modules/Email/Fly.ascx" name="System Requirements"/>
      <add uri="url:~/Modules/Email/Overview.ascx" name="Overview"/>
    </Page>
  </Modules>
</APSchema>

Step 3 - Settings UrlRemapping in web.config.strong

<APSchema>
  <add url="^~/(\w+)/(\w+)/(\w+).aspx?$" 
	mappedUrl="~/Default.aspx?c=$1&f=$2&a=$3" isRegularExpress="true"/>
</APSchema>

Step 4 - Layout Every Page

Run application. Click "login" LinkButton to login application with "designer" user.

And right click on the browser pages, show context menu to layout pages.

APXControl

We show you the layout of the "home page" as follows:

APXControl

And show you the layout of "~/Email/Inbox/Default.aspx" as follows:

APXControl

Notes

I have included my SqlServer .mdf file of this demo in source code. You can use an additional database.

Or you read "/Totutials/Create apennead.net application.htm" to learn How to create and deploy APEnnead.net project.

History

  • 8th November, 2009: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Leo Caan
Engineer APEnnead.net Term
China China
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Generalmsg errormemberswadref15 Jul '10 - 2:11 
bonjour,
j trouve pas le fichier css
il souliger a tout les cssclass
et afficher msg erreur
"Erreur 11 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

merci
GeneralServer Error in '/FlashRotator' Application.memberdiiaoxx26 Jan '10 - 0:33 
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
 

Line 47: SqlDataAdapter adsa = new SqlDataAdapter(sql, con);
Line 48: DataTable AdsTable = new DataTable();
Line 49: adsa.Fill(AdsTable);
Line 50: return AdsTable;
Line 51: }
 
Source File: d:\FlashRotator\Flash.aspx.cs Line: 49
GeneralVery nice control butmembersonyatan11 Nov '09 - 17:19 
It doesn't work with Firefox Frown | :( any thoughts about that? (Firefox 2x)
GeneralRe: Very nice control butmemberLeo Caan12 Nov '09 - 5:32 
Smile | :) Right, the two control not test in firefox. I will try to better.
Thanks very much.
QuestionCompilation Error for Demomemberhobitton9 Nov '09 - 3:37 
Hi,
I tried using your demo, but I get a compilation error related to SQL. What do I need to do to use the MDF file you provided with the download? here is the error message UI get in the file Business.apgen:
 
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
 
Thanks.
 
_______________
hobbiton Smile | :)

AnswerRe: Compilation Error for Demo [modified]memberLeo Caan9 Nov '09 - 4:53 
Oh!
Right, you can exclude "\App_Code\Business.apgen" from project. It is a AutoGen file to compilation business code.
or sets "APLogic\autoSyncDatabase" attribute be "false" in web.config, to close sync DB option.
 
modified on Monday, November 9, 2009 12:27 PM

GeneralRe: Compilation Error for Demomemberhobitton9 Nov '09 - 6:58 
That did it, thanks
 
_______________
hobbiton Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 8 Nov 2009
Article Copyright 2009 by Leo Caan
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid