handling events between webpages..

Discussion in 'ASP .Net' started by Guest, Nov 8, 2005.

  1. Guest

    Guest Guest

    Hi,
    I am working on creating a webapplication and my design calls for creating
    main webform which will have menu bar on left hand side and a IFrame which
    will contain all the forms that are shown when menu items are clicked.Besides
    these i would like to put a custom status bar. Any error message encountered
    in any of the webpage will be displayed in the banner.
    The problem iam encountering is how to access the customer status bar in
    child forms that are displayed in the IFRAME. I cannot use
    HttpApplicationState.Application object as i cannot put custom objects in
    application object. Is that correct? Also, assuming that i can raise events
    from the forms when error is encountered then the question is how do i
    capture that event in my main frame. I don't want to register tons of events
    in my main form for tons of objects that are there in my application. Since i
    cannot attach word document in this post so i will try use following figure
    to demonstrate what i am planning to accomplish:

    Main Webpage(contains IFRAME, MENU BAR, STATUS BAR CONTROL)
    ________|_________
    | |
    Page1 Page 2(contains webcontrols)
    |
    Page1.1(contain webcontrols)

    Assuming that main webpage shows page1 in the iframe which brings up
    page1.1 when some command button is clicked and Page 1.1 contains web user
    control. Now assuming user ecounters some error in the webcontrol. I want
    that error message to be displayed in the status bar control of Main webpage.
    I can raise error event from webcontrol which will be captured by Page 1.1 ,
    the problem that remains is how to propogate that event to Main webpage.
    Any suggestion on this approach or any better approach to handle this. I
    know there is way to move control between webpages but i don't find that very
    elegant solution for my problem.
    Thanks
    Subhash
     
    Guest, Nov 8, 2005
    #1
    1. Advertisements

  2. Guest

    Guest Guest

    Instead of frames, use an HTMLTable to place different user or custom
    controls that implement the various components of your page. If you are
    worried about the performance of having to recreate all components upon
    postback then take advantage of the Page fragment caching feature in ASP.NET
    2.0. http://beta.asp.net/QUICKSTART/aspnet/doc/caching/fragment.aspx

    Are there any particular reasons you want to use frames?
     
    Guest, Nov 8, 2005
    #2
    1. Advertisements

  3. Juan T. Llibre, Nov 8, 2005
    #3
  4. Guest

    Guest Guest

    Thanks Juan.
     
    Guest, Nov 8, 2005
    #4
  5. Guest

    Guest Guest

    How else can i get my webpages to display in particular area of screen? I
    thought frames are the only way to do as they are generic container controls.
    If i use table then how do i display a webpage in particular cell of table.
    --
    Thanks
    SCS


     
    Guest, Nov 8, 2005
    #5
  6. Guest

    Guest Guest

    In the model that you presented, you referred to a "Main Webpage" in which
    you wanted to insert a frame where another "webpage" should be able to
    communicate events to the parent page. You can achieve this goal if you were
    to think of the child page as a control that is positioned on the page (using
    any of the formatting facilities that are available in HTML, not just an
    HTMLTable)

    You asked, "how do I display a web page in a particular cell of table?" The
    answer is: in the same way as you would place a TextBox, a DropDownList or
    any other server control on a webform. You can also using the cssStyle
    attribute for advanced styling effects.
     
    Guest, Nov 8, 2005
    #6
  7. Thanks for Phillip's suggestions.

    Hi SCS,

    Regarding on your scenario, if you're using multiple frames (frame or
    iframe) based page, the communcation between those frames does be a
    problem. The ASP.NET serverside programming model is request/ response
    based, so each time only one page/or handler 's request is under
    processing, the runtime is not aware of another parent or child frame
    because the frames/iframe are all clientside object model which supported
    by client browsers. So generally we would have to use clientside scripts
    for cross browser communation. For example, we can use following script to
    access parent frame window or child frames:

    window.parent
    window.frames

    Also, we can use window.parent.location to reset parent window's url
    address and pass some querystring items to pass information to parent
    window, this is also a certain means used commonly. (for example, the MSDN
    web site
    http://msdn.mcrosoft.com/library/)

    In addition, since your web application want to have a consistent UI style
    for all the pages in it ( have the menu and side navigate bar....), would
    you consider use single page (instead of using iframe) and make UI
    consistency through the ASP.NET 2.0 's Master Page feature? Master Page
    can help us define a template page layout which is common for all the pages
    in the site and we can create concrete pages based on the master page
    template. And whenever we want to change any UI in the template part, just
    modify the master page intead of modifying each concrete pages. Also,
    using master page can avoid using iframe so that we can easlily access each
    control on the page in serverside code.

    Please feel free to let me know your consideration or concerns.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | Thread-Topic: handling events between webpages..
    | thread-index: AcXkuP5gRyRK5GBiTSCKlG+BoiHZxQ==
    | X-WBNR-Posting-Host: 64.253.156.46
    | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    <>
    | References: <>
    <>
    <>
    <>
    <>
    | Subject: Re: handling events between webpages..
    | Date: Tue, 8 Nov 2005 15:06:04 -0800
    | Lines: 122
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 8bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:137094
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    |
    | In the model that you presented, you referred to a "Main Webpage" in
    which
    | you wanted to insert a frame where another "webpage" should be able to
    | communicate events to the parent page. You can achieve this goal if you
    were
    | to think of the child page as a control that is positioned on the page
    (using
    | any of the formatting facilities that are available in HTML, not just an
    | HTMLTable)
    |
    | You asked, "how do I display a web page in a particular cell of table?"
    The
    | answer is: in the same way as you would place a TextBox, a DropDownList
    or
    | any other server control on a webform. You can also using the cssStyle
    | attribute for advanced styling effects.
    |
    | --
    | HTH,
    | Phillip Williams
    | http://www.societopia.net
    | http://www.webswapp.com
    |
    |
    | "scsharma" wrote:
    |
    | > How else can i get my webpages to display in particular area of screen?
    I
    | > thought frames are the only way to do as they are generic container
    controls.
    | > If i use table then how do i display a webpage in particular cell of
    table.
    | > --
    | > Thanks
    | > SCS
    | >
    | >
    | > "Phillip Williams" wrote:
    | >
    | > > Thanks Juan.
    | > >
    | > > --
    | > > Phillip Williams
    | > > http://www.societopia.net
    | > > http://www.webswapp.com
    | > >
    | > >
    | > > "Juan T. Llibre" wrote:
    | > >
    | > > > Hi, Philip.
    | > > >
    | > > > Please make a note of the new address for the 2.0 QuickStart :
    | > > >
    | > > > http://www.asp.net/QUICKSTART/default.aspx
    | > > >
    | > > > That particular page you cited will be at :
    | > > > http://www.asp.net/QUICKSTART/aspnet/doc/caching/fragment.aspx
    | > > >
    | > > > The beta.asp.net site will go down shortly, as the product is not
    in beta any more.
    | > > >
    | > > >
    | > > >
    | > > > Juan T. Llibre, ASP.NET MVP
    | > > > ASP.NET FAQ : http://asp.net.do/faq/
    | > > > ASPNETFAQ.COM : http://www.aspnetfaq.com/
    | > > > Foros de ASP.NET en Español : http://asp.net.do/foros/
    | > > > ======================================
    | > > > | > > > > Instead of frames, use an HTMLTable to place different user or
    custom
    | > > > > controls that implement the various components of your page. If
    you are
    | > > > > worried about the performance of having to recreate all
    components upon
    | > > > > postback then take advantage of the Page fragment caching feature
    in ASP.NET
    | > > > > 2.0.
    http://beta.asp.net/QUICKSTART/aspnet/doc/caching/fragment.aspx
    | > > > >
    | > > > > Are there any particular reasons you want to use frames?
    | > > > > --
    | > > > > HTH,
    | > > > > Phillip Williams
    | > > > > http://www.societopia.net
    | > > > > http://www.webswapp.com
    | > > > >
    | > > > >
    | > > > > "scsharma" wrote:
    | > > > >
    | > > > >> Hi,
    | > > > >> I am working on creating a webapplication and my design calls
    for creating
    | > > > >> main webform which will have menu bar on left hand side and a
    IFrame which
    | > > > >> will contain all the forms that are shown when menu items are
    clicked.Besides
    | > > > >> these i would like to put a custom status bar. Any error message
    encountered
    | > > > >> in any of the webpage will be displayed in the banner.
    | > > > >> The problem iam encountering is how to access the customer
    status bar in
    | > > > >> child forms that are displayed in the IFRAME. I cannot use
    | > > > >> HttpApplicationState.Application object as i cannot put custom
    objects in
    | > > > >> application object. Is that correct? Also, assuming that i can
    raise events
    | > > > >> from the forms when error is encountered then the question is
    how do i
    | > > > >> capture that event in my main frame. I don't want to register
    tons of events
    | > > > >> in my main form for tons of objects that are there in my
    application. Since i
    | > > > >> cannot attach word document in this post so i will try use
    following figure
    | > > > >> to demonstrate what i am planning to accomplish:
    | > > > >>
    | > > > >> Main Webpage(contains IFRAME, MENU BAR, STATUS BAR CONTROL)
    | > > > >> ________|_________
    | > > > >> | |
    | > > > >> Page1 Page 2(contains webcontrols)
    | > > > >> |
    | > > > >> Page1.1(contain webcontrols)
    | > > > >>
    | > > > >> Assuming that main webpage shows page1 in the iframe which
    brings up
    | > > > >> page1.1 when some command button is clicked and Page 1.1
    contains web user
    | > > > >> control. Now assuming user ecounters some error in the
    webcontrol. I want
    | > > > >> that error message to be displayed in the status bar control of
    Main webpage.
    | > > > >> I can raise error event from webcontrol which will be captured
    by Page 1.1 ,
    | > > > >> the problem that remains is how to propogate that event to Main
    webpage.
    | > > > >> Any suggestion on this approach or any better approach to
    handle this. I
    | > > > >> know there is way to move control between webpages but i don't
    find that very
    | > > > >> elegant solution for my problem.
    | > > > >> Thanks
    | > > > >> Subhash
    | > > > >>
    | > > > >>
    | > > > >>
    | > > > >>
    | > > > >> --
    | > > > >> Thanks
    | > > > >> SCS
    | > > >
    | > > >
    | > > >
    |
     
    Steven Cheng[MSFT], Nov 9, 2005
    #7
  8. Guest

    Guest Guest

    Thanks Philips and Steven for your responses. Using .NET 2.0 is not an option
    for current project as thats a company decision and i cannot influence that
    at this point of time.
    Let me tell you my reason for using IFRAME rather than tables. As I
    understand if i have to display a page in say 2nd cell in third row then i
    have to alway write code like:

    TableCell c = new TableCell();
    c.Controls.Add("AspxPage.aspx");
    and add this cell to my table.

    Imagine doing this for every form that needs to be displayed:(. On the
    contrary if i use IFRAME. All i have to do is tell the menu item(which
    happens to be a hyperlink) that the target is IFRAME. After that i don't have
    to worry about anything. Any child webpages that are opened from any of the
    action in my application would be always shown inside the frame. I am not
    sure if i can do that with table.
    Please let me know if this still does not makes sense and i will try to
    explain using some example.
    Once again i thank you for responding to my queries. On side note, If i
    have to draw something using paint and then post it in this form then is that
    possible? I don't see any option to upload attachments.
     
    Guest, Nov 9, 2005
    #8
  9. Guest

    Guest Guest

    Hello SCS,


    You are correct in saying that "if i use IFRAME. All i have to do is tell
    the menu item (which happens to be a hyperlink) that the target is IFRAME."
    But then you lose a requirement that you put forth at the outset of this
    thread; namely to be able to handle events from the child page in the parent
    page. I had to do the same in a previous project (the website of the City of
    North Vancouver, a municipality in the province of British Columbia, Canada
    ). So maybe I should use it here as a case study.

    If you look at the City of North Vancouver ‘s website at http://www.cnv.org,
    you will see that it has thousands of pages (that used to be separate asp
    pages before I redesigned it). Now it is only one web form in asp.net

    The page is divided in separate areas managed by custom server controls; one
    for the top menu (that is dynamically generated out of an oracle database
    updated momentarily as a new page is added to the site), a footer, a side
    menu (that appears a tree with collapsible/expandable items) and a content
    area (which is similar to the child page that you intended to place in a
    frame).

    By using one page, I manage to process events from the content area within
    the parent page. The content area does not only display static HTML content
    but also applications as in this link
    http://www.cnv.org//APPS/PROPERTY_SEARCH/

    In summary if you want to process events, server-side, from the content page
    to the main page then you have no option but to think of the content page as
    a control. Technically any function that you can carry in an aspx page class
    you can convert to an ascx without any loss of functionality. As for the
    display considerations, you can use cascading style sheets to achieve the
    final look and feel of your site in ASP.NET 1.x

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com
     
    Guest, Nov 9, 2005
    #9
  10. Thanks for SCS's respone and Phillip's continue followup,

    So I support Phillip's idea ,however, considering SCS's actual scenario the
    structure may not be changed. Have you already built the main page and
    those sub pages which will be displayed in iframe? Also, if using Philip's
    suggest that use Table to constructure the layout of your main page, you
    can no longer use sub pages, we have to use WebControls or
    Usercontrols(ascx) to construct the UI. Also, if you've decided to use
    Iframe structure, as I've mentioned before, we'll have to utilize
    clientside script to do cross frame communication....

    So what's your project's current status?

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: handling events between webpages..
    | thread-index: AcXlT764H4R7nBmIS+ehXVIa3zhRuA==
    | X-WBNR-Posting-Host: 64.253.156.46
    | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    <>
    | References: <>
    <>
    <>
    <>
    <>
    <>
    <>
    <>
    | Subject: Re: handling events between webpages..
    | Date: Wed, 9 Nov 2005 09:05:11 -0800
    | Lines: 306
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 8bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:356724
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Hello SCS,
    |
    |
    | You are correct in saying that "if i use IFRAME. All i have to do is tell
    | the menu item (which happens to be a hyperlink) that the target is
    IFRAME."
    | But then you lose a requirement that you put forth at the outset of this
    | thread; namely to be able to handle events from the child page in the
    parent
    | page. I had to do the same in a previous project (the website of the City
    of
    | North Vancouver, a municipality in the province of British Columbia,
    Canada
    | ). So maybe I should use it here as a case study.
    |
    | If you look at the City of North Vancouver ‘s website at
    http://www.cnv.org,
    | you will see that it has thousands of pages (that used to be separate asp
    | pages before I redesigned it). Now it is only one web form in asp.net
    |
    | The page is divided in separate areas managed by custom server controls;
    one
    | for the top menu (that is dynamically generated out of an oracle database
    | updated momentarily as a new page is added to the site), a footer, a side
    | menu (that appears a tree with collapsible/expandable items) and a
    content
    | area (which is similar to the child page that you intended to place in a
    | frame).
    |
    | By using one page, I manage to process events from the content area
    within
    | the parent page. The content area does not only display static HTML
    content
    | but also applications as in this link
    | http://www.cnv.org//APPS/PROPERTY_SEARCH/
    |
    | In summary if you want to process events, server-side, from the content
    page
    | to the main page then you have no option but to think of the content page
    as
    | a control. Technically any function that you can carry in an aspx page
    class
    | you can convert to an ascx without any loss of functionality. As for the
    | display considerations, you can use cascading style sheets to achieve the
    | final look and feel of your site in ASP.NET 1.x
    |
    | --
    | HTH,
    | Phillip Williams
    | http://www.societopia.net
    | http://www.webswapp.com
    |
    |
    | "scsharma" wrote:
    |
    | > Thanks Philips and Steven for your responses. Using .NET 2.0 is not an
    option
    | > for current project as thats a company decision and i cannot influence
    that
    | > at this point of time.
    | > Let me tell you my reason for using IFRAME rather than tables. As I
    | > understand if i have to display a page in say 2nd cell in third row
    then i
    | > have to alway write code like:
    | >
    | > TableCell c = new TableCell();
    | > c.Controls.Add("AspxPage.aspx");
    | > and add this cell to my table.
    | >
    | > Imagine doing this for every form that needs to be displayed:(. On the
    | > contrary if i use IFRAME. All i have to do is tell the menu item(which
    | > happens to be a hyperlink) that the target is IFRAME. After that i
    don't have
    | > to worry about anything. Any child webpages that are opened from any of
    the
    | > action in my application would be always shown inside the frame. I am
    not
    | > sure if i can do that with table.
    | > Please let me know if this still does not makes sense and i will try
    to
    | > explain using some example.
    | > Once again i thank you for responding to my queries. On side note, If
    i
    | > have to draw something using paint and then post it in this form then
    is that
    | > possible? I don't see any option to upload attachments.
    | > --
    | > Thanks
    | > SCS
    | >
    | >
    | > "Steven Cheng[MSFT]" wrote:
    | >
    | > > Thanks for Phillip's suggestions.
    | > >
    | > > Hi SCS,
    | > >
    | > > Regarding on your scenario, if you're using multiple frames (frame or
    | > > iframe) based page, the communcation between those frames does be a
    | > > problem. The ASP.NET serverside programming model is request/
    response
    | > > based, so each time only one page/or handler 's request is under
    | > > processing, the runtime is not aware of another parent or child frame
    | > > because the frames/iframe are all clientside object model which
    supported
    | > > by client browsers. So generally we would have to use clientside
    scripts
    | > > for cross browser communation. For example, we can use following
    script to
    | > > access parent frame window or child frames:
    | > >
    | > > window.parent
    | > > window.frames
    | > >
    | > > Also, we can use window.parent.location to reset parent window's url
    | > > address and pass some querystring items to pass information to parent
    | > > window, this is also a certain means used commonly. (for example, the
    MSDN
    | > > web site
    | > > http://msdn.mcrosoft.com/library/)
    | > >
    | > > In addition, since your web application want to have a consistent UI
    style
    | > > for all the pages in it ( have the menu and side navigate bar....),
    would
    | > > you consider use single page (instead of using iframe) and make UI
    | > > consistency through the ASP.NET 2.0 's Master Page feature? Master
    Page
    | > > can help us define a template page layout which is common for all the
    pages
    | > > in the site and we can create concrete pages based on the master page
    | > > template. And whenever we want to change any UI in the template part,
    just
    | > > modify the master page intead of modifying each concrete pages.
    Also,
    | > > using master page can avoid using iframe so that we can easlily
    access each
    | > > control on the page in serverside code.
    | > >
    | > > Please feel free to let me know your consideration or concerns.
    | > >
    | > > Thanks,
    | > >
    | > > Steven Cheng
    | > > Microsoft Online Support
    | > >
    | > > Get Secure! www.microsoft.com/security
    | > > (This posting is provided "AS IS", with no warranties, and confers no
    | > > rights.)
    | > >
    | > > --------------------
    | > > | Thread-Topic: handling events between webpages..
    | > > | thread-index: AcXkuP5gRyRK5GBiTSCKlG+BoiHZxQ==
    | > > | X-WBNR-Posting-Host: 64.253.156.46
    | > > | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    | > > <>
    | > > | References: <>
    | > > <>
    | > > <>
    | > > <>
    | > > <>
    | > > | Subject: Re: handling events between webpages..
    | > > | Date: Tue, 8 Nov 2005 15:06:04 -0800
    | > > | Lines: 122
    | > > | Message-ID: <>
    | > > | MIME-Version: 1.0
    | > > | Content-Type: text/plain;
    | > > | charset="Utf-8"
    | > > | Content-Transfer-Encoding: 8bit
    | > > | X-Newsreader: Microsoft CDO for Windows 2000
    | > > | Content-Class: urn:content-classes:message
    | > > | Importance: normal
    | > > | Priority: normal
    | > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > > | Xref: TK2MSFTNGXA01.phx.gbl
    | > > microsoft.public.dotnet.framework.aspnet:137094
    | > > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > > |
    | > > |
    | > > | In the model that you presented, you referred to a "Main Webpage"
    in
    | > > which
    | > > | you wanted to insert a frame where another "webpage" should be able
    to
    | > > | communicate events to the parent page. You can achieve this goal if
    you
    | > > were
    | > > | to think of the child page as a control that is positioned on the
    page
    | > > (using
    | > > | any of the formatting facilities that are available in HTML, not
    just an
    | > > | HTMLTable)
    | > > |
    | > > | You asked, "how do I display a web page in a particular cell of
    table?"
    | > > The
    | > > | answer is: in the same way as you would place a TextBox, a
    DropDownList
    | > > or
    | > > | any other server control on a webform. You can also using the
    cssStyle
    | > > | attribute for advanced styling effects.
    | > > |
    | > > | --
    | > > | HTH,
    | > > | Phillip Williams
    | > > | http://www.societopia.net
    | > > | http://www.webswapp.com
    | > > |
    | > > |
    | > > | "scsharma" wrote:
    | > > |
    | > > | > How else can i get my webpages to display in particular area of
    screen?
    | > > I
    | > > | > thought frames are the only way to do as they are generic
    container
    | > > controls.
    | > > | > If i use table then how do i display a webpage in particular cell
    of
    | > > table.
    | > > | > --
    | > > | > Thanks
    | > > | > SCS
    | > > | >
    | > > | >
    | > > | > "Phillip Williams" wrote:
    | > > | >
    | > > | > > Thanks Juan.
    | > > | > >
    | > > | > > --
    | > > | > > Phillip Williams
    | > > | > > http://www.societopia.net
    | > > | > > http://www.webswapp.com
    | > > | > >
    | > > | > >
    | > > | > > "Juan T. Llibre" wrote:
    | > > | > >
    | > > | > > > Hi, Philip.
    | > > | > > >
    | > > | > > > Please make a note of the new address for the 2.0 QuickStart :
    | > > | > > >
    | > > | > > > http://www.asp.net/QUICKSTART/default.aspx
    | > > | > > >
    | > > | > > > That particular page you cited will be at :
    | > > | > > > http://www.asp.net/QUICKSTART/aspnet/doc/caching/fragment.aspx
    | > > | > > >
    | > > | > > > The beta.asp.net site will go down shortly, as the product is
    not
    | > > in beta any more.
    | > > | > > >
    | > > | > > >
    | > > | > > >
    | > > | > > > Juan T. Llibre, ASP.NET MVP
    | > > | > > > ASP.NET FAQ : http://asp.net.do/faq/
    | > > | > > > ASPNETFAQ.COM : http://www.aspnetfaq.com/
    | > > | > > > Foros de ASP.NET en Español : http://asp.net.do/foros/
    | > > | > > > ======================================
    message
    | > > | > > > | > > | > > > > Instead of frames, use an HTMLTable to place different user
    or
    | > > custom
    | > > | > > > > controls that implement the various components of your
    page. If
    | > > you are
    | > > | > > > > worried about the performance of having to recreate all
    | > > components upon
    | > > | > > > > postback then take advantage of the Page fragment caching
    feature
    | > > in ASP.NET
    | > > | > > > > 2.0.
    | > > http://beta.asp.net/QUICKSTART/aspnet/doc/caching/fragment.aspx
    | > > | > > > >
    | > > | > > > > Are there any particular reasons you want to use frames?
    | > > | > > > > --
    | > > | > > > > HTH,
    | > > | > > > > Phillip Williams
    | > > | > > > > http://www.societopia.net
    | > > | > > > > http://www.webswapp.com
    | > > | > > > >
    | > > | > > > >
    | > > | > > > > "scsharma" wrote:
    | > > | > > > >
    | > > | > > > >> Hi,
    | > > | > > > >> I am working on creating a webapplication and my design
    calls
    | > > for creating
    | > > | > > > >> main webform which will have menu bar on left hand side
    and a
    | > > IFrame which
    | > > | > > > >> will contain all the forms that are shown when menu items
    are
    | > > clicked.Besides
    | > > | > > > >> these i would like to put a custom status bar. Any error
    message
    | > > encountered
    | > > | > > > >> in any of the webpage will be displayed in the banner.
    | > > | > > > >> The problem iam encountering is how to access the
    customer
    | > > status bar in
    | > > | > > > >> child forms that are displayed in the IFRAME. I cannot use
    | > > | > > > >> HttpApplicationState.Application object as i cannot put
    custom
    | > > objects in
    | > > | > > > >> application object. Is that correct? Also, assuming that i
    can
    | > > raise events
    | > > | > > > >> from the forms when error is encountered then the question
    is
    | > > how do i
    | > > | > > > >> capture that event in my main frame. I don't want to
    register
    | > > tons of events
    | > > | > > > >> in my main form for tons of objects that are there in my
    | > > application. Since i
    | > > | > > > >> cannot attach word document in this post so i will try
    use
    | > > following figure
    | > > | > > > >> to demonstrate what i am planning to accomplish:
    | > > | > > > >>
    | > > | > > > >> Main Webpage(contains IFRAME, MENU BAR, STATUS BAR CONTROL)
    | > > | > > > >> ________|_________
    | > > | > > > >> | |
    | > > | > > > >> Page1 Page 2(contains webcontrols)
    | > > | > > > >> |
    | > > | > > > >> Page1.1(contain webcontrols)
    | > > | > > > >>
    | > > | > > > >> Assuming that main webpage shows page1 in the iframe which
    | > > brings up
    | > > | > > > >> page1.1 when some command button is clicked and Page 1.1
    | > > contains web user
    | > > | > > > >> control. Now assuming user ecounters some error in the
    | > > webcontrol. I want
    | > > | > > > >> that error message to be displayed in the status bar
    control of
    | > > Main webpage.
    | > > | > > > >> I can raise error event from webcontrol which will be
    captured
    | > > by Page 1.1 ,
    | > > | > > > >> the problem that remains is how to propogate that event to
    Main
    | > > webpage.
    | > > | > > > >> Any suggestion on this approach or any better approach to
    | > > handle this. I
    | > > | > > > >> know there is way to move control between webpages but i
    don't
    | > > find that very
    | > > | > > > >> elegant solution for my problem.
    | > > | > > > >> Thanks
    | > > | > > > >> Subhash
    | > > | > > > >>
    | > > | > > > >>
    | > > | > > > >>
    | > > | > > > >>
    | > > | > > > >> --
    | > > | > > > >> Thanks
    | > > | > > > >> SCS
    | > > | > > >
    | > > | > > >
    | > > | > > >
    | > > |
    | > >
    | > >
    |
     
    Steven Cheng[MSFT], Nov 10, 2005
    #10
  11. Guest

    Guest Guest

    Thanks a lot for replies. My project is in middle of development and main
    page is also done. We cannot afford to use user controls as we have lots of
    webpages and converting them into user controls if not difficult then it is
    not something which would be acceptable to people in our development team. We
    have pretty big development team. Also, if I convert webpages to user
    controls then i still have to have to put those controls on my webpage and
    hide and show those controls as need arises. correct?

    --
    Thanks
    SCS


     
    Guest, Nov 10, 2005
    #11
  12. Hi SCS,

    Yes, you need to load different usercontrol into the main page's table
    section when navigating between different concrete pages. Also, you can
    choose to create the main page UI as UserControl so as to include them in
    each of your concrete pages, just something like Master page in 2.0...

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: handling events between webpages..
    | thread-index: AcXmAoslVOcrf04cSb21IZSxjhgNAQ==
    | X-WBNR-Posting-Host: 12.109.44.8
    | From: "=?Utf-8?B?c2NzaGFybWE=?=" <>
    | References: <>
    <>
    <>
    <>
    <>
    <>
    <>
    <>
    <>
    <>
    | Subject: Re: handling events between webpages..
    | Date: Thu, 10 Nov 2005 06:25:04 -0800
    | Lines: 315
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 8bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:357020
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Thanks a lot for replies. My project is in middle of development and main
    | page is also done. We cannot afford to use user controls as we have lots
    of
    | webpages and converting them into user controls if not difficult then it
    is
    | not something which would be acceptable to people in our development
    team. We
    | have pretty big development team. Also, if I convert webpages to user
    | controls then i still have to have to put those controls on my webpage
    and
    | hide and show those controls as need arises. correct?
    |
    | --
    | Thanks
    | SCS
    |
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Thanks for SCS's respone and Phillip's continue followup,
    | >
    | > So I support Phillip's idea ,however, considering SCS's actual scenario
    the
    | > structure may not be changed. Have you already built the main page and
    | > those sub pages which will be displayed in iframe? Also, if using
    Philip's
    | > suggest that use Table to constructure the layout of your main page,
    you
    | > can no longer use sub pages, we have to use WebControls or
    | > Usercontrols(ascx) to construct the UI. Also, if you've decided to
    use
    | > Iframe structure, as I've mentioned before, we'll have to utilize
    | > clientside script to do cross frame communication....
    | >
    | > So what's your project's current status?
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | > --------------------
    | > | Thread-Topic: handling events between webpages..
    | > | thread-index: AcXlT764H4R7nBmIS+ehXVIa3zhRuA==
    | > | X-WBNR-Posting-Host: 64.253.156.46
    | > | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    | > <>
    | > | References: <>
    | > <>
    | > <>
    | > <>
    | > <>
    | > <>
    | > <>
    | > <>
    | > | Subject: Re: handling events between webpages..
    | > | Date: Wed, 9 Nov 2005 09:05:11 -0800
    | > | Lines: 306
    | > | Message-ID: <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | charset="Utf-8"
    | > | Content-Transfer-Encoding: 8bit
    | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | Content-Class: urn:content-classes:message
    | > | Importance: normal
    | > | Priority: normal
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | Xref: TK2MSFTNGXA02.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet:356724
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > |
    | > | Hello SCS,
    | > |
    | > |
    | > | You are correct in saying that "if i use IFRAME. All i have to do is
    tell
    | > | the menu item (which happens to be a hyperlink) that the target is
    | > IFRAME."
    | > | But then you lose a requirement that you put forth at the outset of
    this
    | > | thread; namely to be able to handle events from the child page in the
    | > parent
    | > | page. I had to do the same in a previous project (the website of the
    City
    | > of
    | > | North Vancouver, a municipality in the province of British Columbia,
    | > Canada
    | > | ). So maybe I should use it here as a case study.
    | > |
    | > | If you look at the City of North Vancouver ‘s website at
    | > http://www.cnv.org,
    | > | you will see that it has thousands of pages (that used to be separate
    asp
    | > | pages before I redesigned it). Now it is only one web form in asp.net
    | > |
    | > | The page is divided in separate areas managed by custom server
    controls;
    | > one
    | > | for the top menu (that is dynamically generated out of an oracle
    database
    | > | updated momentarily as a new page is added to the site), a footer, a
    side
    | > | menu (that appears a tree with collapsible/expandable items) and a
    | > content
    | > | area (which is similar to the child page that you intended to place
    in a
    | > | frame).
    | > |
    | > | By using one page, I manage to process events from the content area
    | > within
    | > | the parent page. The content area does not only display static HTML
    | > content
    | > | but also applications as in this link
    | > | http://www.cnv.org//APPS/PROPERTY_SEARCH/
    | > |
    | > | In summary if you want to process events, server-side, from the
    content
    | > page
    | > | to the main page then you have no option but to think of the content
    page
    | > as
    | > | a control. Technically any function that you can carry in an aspx
    page
    | > class
    | > | you can convert to an ascx without any loss of functionality. As for
    the
    | > | display considerations, you can use cascading style sheets to achieve
    the
    | > | final look and feel of your site in ASP.NET 1.x
    | > |
    | > | --
    | > | HTH,
    | > | Phillip Williams
    | > | http://www.societopia.net
    | > | http://www.webswapp.com
    | > |
    | > |
    | > | "scsharma" wrote:
    | > |
    | > | > Thanks Philips and Steven for your responses. Using .NET 2.0 is not
    an
    | > option
    | > | > for current project as thats a company decision and i cannot
    influence
    | > that
    | > | > at this point of time.
    | > | > Let me tell you my reason for using IFRAME rather than tables. As
    I
    | > | > understand if i have to display a page in say 2nd cell in third row
    | > then i
    | > | > have to alway write code like:
    | > | >
    | > | > TableCell c = new TableCell();
    | > | > c.Controls.Add("AspxPage.aspx");
    | > | > and add this cell to my table.
    | > | >
    | > | > Imagine doing this for every form that needs to be displayed:(. On
    the
    | > | > contrary if i use IFRAME. All i have to do is tell the menu
    item(which
    | > | > happens to be a hyperlink) that the target is IFRAME. After that i
    | > don't have
    | > | > to worry about anything. Any child webpages that are opened from
    any of
    | > the
    | > | > action in my application would be always shown inside the frame. I
    am
    | > not
    | > | > sure if i can do that with table.
    | > | > Please let me know if this still does not makes sense and i will
    try
    | > to
    | > | > explain using some example.
    | > | > Once again i thank you for responding to my queries. On side note,
    If
    | > i
    | > | > have to draw something using paint and then post it in this form
    then
    | > is that
    | > | > possible? I don't see any option to upload attachments.
    | > | > --
    | > | > Thanks
    | > | > SCS
    | > | >
    | > | >
    | > | > "Steven Cheng[MSFT]" wrote:
    | > | >
    | > | > > Thanks for Phillip's suggestions.
    | > | > >
    | > | > > Hi SCS,
    | > | > >
    | > | > > Regarding on your scenario, if you're using multiple frames
    (frame or
    | > | > > iframe) based page, the communcation between those frames does be
    a
    | > | > > problem. The ASP.NET serverside programming model is request/
    | > response
    | > | > > based, so each time only one page/or handler 's request is under
    | > | > > processing, the runtime is not aware of another parent or child
    frame
    | > | > > because the frames/iframe are all clientside object model which
    | > supported
    | > | > > by client browsers. So generally we would have to use clientside
    | > scripts
    | > | > > for cross browser communation. For example, we can use following
    | > script to
    | > | > > access parent frame window or child frames:
    | > | > >
    | > | > > window.parent
    | > | > > window.frames
    | > | > >
    | > | > > Also, we can use window.parent.location to reset parent window's
    url
    | > | > > address and pass some querystring items to pass information to
    parent
    | > | > > window, this is also a certain means used commonly. (for example,
    the
    | > MSDN
    | > | > > web site
    | > | > > http://msdn.mcrosoft.com/library/)
    | > | > >
    | > | > > In addition, since your web application want to have a consistent
    UI
    | > style
    | > | > > for all the pages in it ( have the menu and side navigate
    bar....),
    | > would
    | > | > > you consider use single page (instead of using iframe) and make
    UI
    | > | > > consistency through the ASP.NET 2.0 's Master Page feature?
    Master
    | > Page
    | > | > > can help us define a template page layout which is common for all
    the
    | > pages
    | > | > > in the site and we can create concrete pages based on the master
    page
    | > | > > template. And whenever we want to change any UI in the template
    part,
    | > just
    | > | > > modify the master page intead of modifying each concrete pages.
    | > Also,
    | > | > > using master page can avoid using iframe so that we can easlily
    | > access each
    | > | > > control on the page in serverside code.
    | > | > >
    | > | > > Please feel free to let me know your consideration or concerns.
    | > | > >
    | > | > > Thanks,
    | > | > >
    | > | > > Steven Cheng
    | > | > > Microsoft Online Support
    | > | > >
    | > | > > Get Secure! www.microsoft.com/security
    | > | > > (This posting is provided "AS IS", with no warranties, and
    confers no
    | > | > > rights.)
    | > | > >
    | > | > > --------------------
    | > | > > | Thread-Topic: handling events between webpages..
    | > | > > | thread-index: AcXkuP5gRyRK5GBiTSCKlG+BoiHZxQ==
    | > | > > | X-WBNR-Posting-Host: 64.253.156.46
    | > | > > | From: "=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?="
    | > | > > <>
    | > | > > | References:
    <>
    | > | > > <>
    | > | > > <>
    | > | > > <>
    | > | > > <>
    | > | > > | Subject: Re: handling events between webpages..
    | > | > > | Date: Tue, 8 Nov 2005 15:06:04 -0800
    | > | > > | Lines: 122
    | > | > > | Message-ID: <>
    | > | > > | MIME-Version: 1.0
    | > | > > | Content-Type: text/plain;
    | > | > > | charset="Utf-8"
    | > | > > | Content-Transfer-Encoding: 8bit
    | > | > > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | > > | Content-Class: urn:content-classes:message
    | > | > > | Importance: normal
    | > | > > | Priority: normal
    | > | > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | > > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | > > | Xref: TK2MSFTNGXA01.phx.gbl
    | > | > > microsoft.public.dotnet.framework.aspnet:137094
    | > | > > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > | > > |
    | > | > > |
    | > | > > | In the model that you presented, you referred to a "Main
    Webpage"
    | > in
    | > | > > which
    | > | > > | you wanted to insert a frame where another "webpage" should be
    able
    | > to
    | > | > > | communicate events to the parent page. You can achieve this
    goal if
    | > you
    | > | > > were
    | > | > > | to think of the child page as a control that is positioned on
    the
    | > page
    | > | > > (using
    | > | > > | any of the formatting facilities that are available in HTML,
    not
    | > just an
    | > | > > | HTMLTable)
    | > | > > |
    | > | > > | You asked, "how do I display a web page in a particular cell of
    | > table?"
    | > | > > The
    | > | > > | answer is: in the same way as you would place a TextBox, a
    | > DropDownList
    | > | > > or
    | > | > > | any other server control on a webform. You can also using the
    | > cssStyle
    | > | > > | attribute for advanced styling effects.
    | > | > > |
    | > | > > | --
    | > | > > | HTH,
    | > | > > | Phillip Williams
    | > | > > | http://www.societopia.net
    | > | > > | http://www.webswapp.com
    | > | > > |
    | > | > > |
    | > | > > | "scsharma" wrote:
    | > | > > |
    | > | > > | > How else can i get my webpages to display in particular area
    of
    | > screen?
    | > | > > I
    | > | > > | > thought frames are the only way to do as they are generic
    | > container
    | > | > > controls.
    | > | > > | > If i use table then how do i display a webpage in particular
    cell
    | > of
    | > | > > table.
    | > | > > | > --
    | > | > > | > Thanks
    | > | > > | > SCS
    | > | > > | >
    | > | > > | >
    | > | > > | > "Phillip Williams" wrote:
    | > | > > | >
    | > | > > | > > Thanks Juan.
    | > | > > | > >
    | > | > > | > > --
    | > | > > | > > Phillip Williams
    | > | > > | > > http://www.societopia.net
    | > | > > | > > http://www.webswapp.com
    | > | > > | > >
    | > | > > | > >
    | > | > > | > > "Juan T. Llibre" wrote:
    | > | > > | > >
    | > | > > | > > > Hi, Philip.
    | > | > > | > > >
    | > | > > | > > > Please make a note of the new address for the 2.0
    QuickStart :
    |
     
    Steven Cheng[MSFT], Nov 11, 2005
    #12
  13. Guest

    Guest Guest

    One more approach is to implement the main page as a base class to be
    inherited by each of the webforms that the other developers create (or
    already have), e.g.

    Public Class WebForm1
    Inherits MyAppBasePageClass ‘ instead of Inherits System.Web.UI.Page

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


     
    Guest, Nov 11, 2005
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.