Ask a Question related to ASP.NET, Design and Development.

  1. #1

    Default Web Form

    How can I close a web form from code-behind code, insteal of client script
    i.e javascript:window.close();

    craig


    Craig Pearson Guest

  2. Similar Questions and Discussions

    1. Autopopulated form not displaying data in pdfunless the form field is clicked
      Within my online application, I have a pdf form that is auto generated and displayed to the user in the browser. My problem is that the populated...
    2. authenticate win32 form client with form based authentication web services
      (Type your message here) -------------------------------- From: kitchai yong Hi, Can you tell me how i authenticate the win32 form client...
    3. #25676 [Opn->Bgs]: Form hidden input ouput when any form=* is in url_rewriter.tags
      ID: 25676 Updated by: sniper@php.net Reported By: davey@php.net -Status: Open +Status: Bogus Bug...
    4. #25676 [Bgs->Opn]: Form hidden input ouput when any form=* is in url_rewriter.tags
      ID: 25676 Updated by: davey@php.net Reported By: davey@php.net -Status: Bogus +Status: Open Bug...
    5. #25676 [NEW]: Form hidden input ouput when any form=* is in url_rewriter.tags
      From: davey@php.net Operating system: WinXP/FreeBSD PHP version: 4CVS-2003-09-26 (stable) PHP Bug Type: Session related Bug...
  3. #2

    Default Re: Web Form

    Hi Kevin

    I have a server side button which needs to execute some code on the server,
    then close the browser. Are you suggesting in the Page_Load, or prehaps the
    button event (button_OnClick) I incorporate something like:

    private void Page_Load(object sender, EventHandler e) {
    if(IsPostback) {
    // do server stuff, like clean out the session
    // Session["var']=null;

    Page.RegisterStartupScriptBlock("startup", "<script> window.close();
    </script>");
    }
    }

    I was attempting to do some sort of client script callback, whereby the
    server script could call some client script, that way I could keep the
    window.close() script 'pre-rendered' on the client. If you have a sample, I
    would greatly appreciate it.

    Craig




    "Kevin Spencer" <kevin@takempis.com> wrote in message
    news:upn4DuSUDHA.3712@tk2msftngp13.phx.gbl...
    > You can't. You're not trying to close a WebForm; you're trying to close
    the
    > browser. The browser is on the client. All ASP.Net sends to the browser is
    > an HTTP response with HTML in it. You need to add a Startup JavaScript to
    > the page during PostBack that closes the browser window on the client
    side.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of little things.
    >
    > "Craig Pearson" <pearson4@un.org> wrote in message
    > news:%23D6lTYSUDHA.2188@TK2MSFTNGP10.phx.gbl...
    > > How can I close a web form from code-behind code, insteal of client
    script
    > > i.e javascript:window.close();
    > >
    > > craig
    > >
    > >
    >
    >

    Craig Pearson Guest

  4. #3

    Default Re: Web Form

    What you just posted is fine. Since, as you say, you want to execute some
    server-side processing, you would then add the script to the page so that it
    closes when loaded into the browser.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "Craig Pearson" <pearson4@un.org> wrote in message
    news:eFdEiKTUDHA.2036@TK2MSFTNGP10.phx.gbl...
    > Hi Kevin
    >
    > I have a server side button which needs to execute some code on the
    server,
    > then close the browser. Are you suggesting in the Page_Load, or prehaps
    the
    > button event (button_OnClick) I incorporate something like:
    >
    > private void Page_Load(object sender, EventHandler e) {
    > if(IsPostback) {
    > // do server stuff, like clean out the session
    > // Session["var']=null;
    >
    > Page.RegisterStartupScriptBlock("startup", "<script> window.close();
    > </script>");
    > }
    > }
    >
    > I was attempting to do some sort of client script callback, whereby the
    > server script could call some client script, that way I could keep the
    > window.close() script 'pre-rendered' on the client. If you have a sample,
    I
    > would greatly appreciate it.
    >
    > Craig
    >
    >
    >
    >
    > "Kevin Spencer" <kevin@takempis.com> wrote in message
    > news:upn4DuSUDHA.3712@tk2msftngp13.phx.gbl...
    > > You can't. You're not trying to close a WebForm; you're trying to close
    > the
    > > browser. The browser is on the client. All ASP.Net sends to the browser
    is
    > > an HTTP response with HTML in it. You need to add a Startup JavaScript
    to
    > > the page during PostBack that closes the browser window on the client
    > side.
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft MVP
    > > .Net Developer
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up of
    > > lots of little things.
    > >
    > > "Craig Pearson" <pearson4@un.org> wrote in message
    > > news:%23D6lTYSUDHA.2188@TK2MSFTNGP10.phx.gbl...
    > > > How can I close a web form from code-behind code, insteal of client
    > script
    > > > i.e javascript:window.close();
    > > >
    > > > craig
    > > >
    > > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

  5. #4

    Default Web Form

    Hi,

    I'm currently trying to figure out how to create a web form. What I want to
    do is:
    The 1st question will ask to select a year he/she attended a live training.
    The 2nd question will provide the trainings of that specific year that was
    selected in the previous question. I'd like to know how to do that.

    Thank you in advanced for your feedback.

    Thanks!

    Techie Marie Guest

  6. #5

    Default Re: Web Form

    You could do Google search, or quick search through here or anywhere in Adobe website.

    Do you have user manual book that comes with Dreamweaver package?
    Deaf Web Designer Guest

  7. #6

    Default Re: Web Form

    Have a look at [url]www.htmlbasix.com/forms.shtml[/url] You can create a form online at this site, then look at the code and use the bits that you need...

    I found this very helpful.
    heuning Guest

  8. #7

    Default Re: Web Form

    DW's F1 Help?

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "Techie Marie" <webforumsuser@macromedia.com> wrote in message
    news:eh5obv$88q$1@forums.macromedia.com...
    > Hi,
    >
    > I'm currently trying to figure out how to create a web form. What I want
    > to
    > do is:
    > The 1st question will ask to select a year he/she attended a live
    > training.
    > The 2nd question will provide the trainings of that specific year that was
    > selected in the previous question. I'd like to know how to do that.
    >
    > Thank you in advanced for your feedback.
    >
    > Thanks!
    >

    Murray *ACE* Guest

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139