Form in a form - possible ?

Discussion in 'ASP .Net' started by Adam Benson, Jul 22, 2003.

  1. Adam Benson

    Adam Benson Guest

    Hi,

    I have a really simple web page with c# code behind it. It displays news
    headlines with related text. Click on the headline and you get the text that
    goes with it.
    I need to implement a search facility that will go through the entire
    database and present the user with all the hits. When they click on a hit
    the main page displays headline and text.
    i.e.
    ********************** *******************************************

    * * * *

    * Search text * * *

    * * * Headline *

    * Result 1 * * *

    * Result 2 * * Story *

    * etc * * *

    * etc * * Other details *

    * * * *

    * (Clicking on a * * (This works as always, *

    * result here * * clicking on a result alters what's *

    * alters what's * * displayed here. *

    * displayed in * * But clicking within this window *

    * the right hand * * works just the same as if the *

    * form. * * search window wasn't there.) *

    * When the user's * * *

    * done with the * * *

    * search they click * * *

    * on X and this * * *

    * disappears.) * * *

    * * * *

    ********************** *******************************************

    Most of the time the search window won't be there. I'd like it to appear
    when the user clicks on a search button on the main page, and disappear when
    the user's done with it.

    Since the main window is already working and debugged I'd like to keep the 2
    windows as independent of each other as possible - with the exception that
    clicking on a result in the search window alters what's displayed in the
    main window.



    I'm sure it's possible, but I'm pretty new to aspnet stuff. If someone could
    nudge me in the right direction I'd be very grateful.



    Sorry if this is an issue that's already been dealt with, but to be honest I
    wasn't too sure about what to search on.



    Thank you muchly,



    Adam.


    --
    Adam Benson

    ==================================
    Adam Benson, Jul 22, 2003
    #1
    1. Advertising

  2. Hi,

    you don't have to use two forms in a single page. You could build a user
    control (ASCX) that handles the search stuff and a another control for
    showing the news and use these two on a page inside a single <form
    runat=server...> tag pair. ASP.NET will automatically do the plumbing for
    you so that if you have a search button in the first control and a
    corresponding event, the user's click on that button will result in ASP.NET
    calling your corresponding button event. You then can update the page anyway
    you like and return it to the user.

    Best regards,

    Marc Höppner
    NeoGeo

    "Adam Benson" <> wrote in message
    news:...
    > Hi,
    >
    > I have a really simple web page with c# code behind it. It displays news
    > headlines with related text. Click on the headline and you get the text

    that
    > goes with it.
    > I need to implement a search facility that will go through the entire
    > database and present the user with all the hits. When they click on a hit
    > the main page displays headline and text.
    > i.e.
    > ********************** *******************************************
    >
    > * * * *
    >
    > * Search text * * *
    >
    > * * * Headline *
    >
    > * Result 1 * * *
    >
    > * Result 2 * * Story *
    >
    > * etc * * *
    >
    > * etc * * Other details *
    >
    > * * * *
    >
    > * (Clicking on a * * (This works as always, *
    >
    > * result here * * clicking on a result alters what's *
    >
    > * alters what's * * displayed here. *
    >
    > * displayed in * * But clicking within this window *
    >
    > * the right hand * * works just the same as if the *
    >
    > * form. * * search window wasn't there.) *
    >
    > * When the user's * * *
    >
    > * done with the * * *
    >
    > * search they click * * *
    >
    > * on X and this * * *
    >
    > * disappears.) * * *
    >
    > * * * *
    >
    > ********************** *******************************************
    >
    > Most of the time the search window won't be there. I'd like it to appear
    > when the user clicks on a search button on the main page, and disappear

    when
    > the user's done with it.
    >
    > Since the main window is already working and debugged I'd like to keep the

    2
    > windows as independent of each other as possible - with the exception that
    > clicking on a result in the search window alters what's displayed in the
    > main window.
    >
    >
    >
    > I'm sure it's possible, but I'm pretty new to aspnet stuff. If someone

    could
    > nudge me in the right direction I'd be very grateful.
    >
    >
    >
    > Sorry if this is an issue that's already been dealt with, but to be honest

    I
    > wasn't too sure about what to search on.
    >
    >
    >
    > Thank you muchly,
    >
    >
    >
    > Adam.
    >
    >
    > --
    > Adam Benson
    >
    > ==================================
    >
    >
    Marc Hoeppner, Jul 22, 2003
    #2
    1. Advertising

  3. Adam Benson

    Aemca Guest

    you can't have a form in a form.
    you can have multiple forms in a page ( just not the asp.net kind )


    "Adam Benson" <> wrote in message
    news:...
    > Hi,
    >
    > I have a really simple web page with c# code behind it. It displays news
    > headlines with related text. Click on the headline and you get the text

    that
    > goes with it.
    > I need to implement a search facility that will go through the entire
    > database and present the user with all the hits. When they click on a hit
    > the main page displays headline and text.
    > i.e.
    > ********************** *******************************************
    >
    > * * * *
    >
    > * Search text * * *
    >
    > * * * Headline *
    >
    > * Result 1 * * *
    >
    > * Result 2 * * Story *
    >
    > * etc * * *
    >
    > * etc * * Other details *
    >
    > * * * *
    >
    > * (Clicking on a * * (This works as always, *
    >
    > * result here * * clicking on a result alters what's *
    >
    > * alters what's * * displayed here. *
    >
    > * displayed in * * But clicking within this window *
    >
    > * the right hand * * works just the same as if the *
    >
    > * form. * * search window wasn't there.) *
    >
    > * When the user's * * *
    >
    > * done with the * * *
    >
    > * search they click * * *
    >
    > * on X and this * * *
    >
    > * disappears.) * * *
    >
    > * * * *
    >
    > ********************** *******************************************
    >
    > Most of the time the search window won't be there. I'd like it to appear
    > when the user clicks on a search button on the main page, and disappear

    when
    > the user's done with it.
    >
    > Since the main window is already working and debugged I'd like to keep the

    2
    > windows as independent of each other as possible - with the exception that
    > clicking on a result in the search window alters what's displayed in the
    > main window.
    >
    >
    >
    > I'm sure it's possible, but I'm pretty new to aspnet stuff. If someone

    could
    > nudge me in the right direction I'd be very grateful.
    >
    >
    >
    > Sorry if this is an issue that's already been dealt with, but to be honest

    I
    > wasn't too sure about what to search on.
    >
    >
    >
    > Thank you muchly,
    >
    >
    >
    > Adam.
    >
    >
    > --
    > Adam Benson
    >
    > ==================================
    >
    >
    Aemca, Jul 22, 2003
    #3
  4. Adam Benson

    Adam Benson Guest

    Thanks, Marc and Aemca.

    After going some way down the line suggested by Marc I sent a screen shot to
    the customer and discovered they didn't want it like that. So I've had to
    change it all ....

    That's life ...

    AB


    --
    Adam Benson

    ==================================
    Adam Benson, Jul 29, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Hale
    Replies:
    2
    Views:
    512
    Kevin Spencer
    Oct 28, 2003
  2. Keith Patrick
    Replies:
    2
    Views:
    4,466
    Rype69
    May 23, 2006
  3. Markus
    Replies:
    1
    Views:
    457
    Markus
    Nov 22, 2005
  4. Replies:
    4
    Views:
    281
    Kenny McCormack
    Feb 21, 2006
  5. Replies:
    10
    Views:
    470
    Chris Gonnerman
    Dec 14, 2007
Loading...

Share This Page