Close a WebForm? SetFocus in a WebForm?

Discussion in 'ASP .Net Web Controls' started by David Laub, Feb 18, 2004.

  1. David Laub

    David Laub Guest

    is there a way to
    1) programmatically close a Web Form (e.g. the user presses a button, and
    the click event calls some close method I can't find) Yes I can do this in
    JavaScript, but I'd like to NOT do this in JavaScript
    2) programmatically set focus to a specific Web Form Control (e.g. in the
    page load event handler, set focus to a specific Textbox) Yes I can do this
    in JavaScript, but I'd like to NOT do this in JavaScript
     
    David Laub, Feb 18, 2004
    #1
    1. Advertising

  2. David,

    HTTP is connectionless. Therefore, if you are going to do this type of
    thing, you must do it from client-side code.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided as-is with no warranties and confers no rights.

    --------------------
    >Reply-To: "David Laub" <>
    >From: "David Laub" <>
    >Subject: Close a WebForm? SetFocus in a WebForm?
    >Date: Wed, 18 Feb 2004 15:47:52 -0600
    >Lines: 9
    >Organization: Wheels, Inc.
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >NNTP-Posting-Host: int1.wheels.com 199.181.32.204
    >Path:

    cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.
    phx.gbl
    >Xref: cpmsftngxa07.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:18434
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >is there a way to
    >1) programmatically close a Web Form (e.g. the user presses a button, and
    >the click event calls some close method I can't find) Yes I can do this in
    >JavaScript, but I'd like to NOT do this in JavaScript
    >2) programmatically set focus to a specific Web Form Control (e.g. in the
    >page load event handler, set focus to a specific Textbox) Yes I can do

    this
    >in JavaScript, but I'd like to NOT do this in JavaScript
    >
    >
    >
     
    Jim Cheshire [MSFT], Feb 18, 2004
    #2
    1. Advertising

  3. well you can always insert the script into the response object from the
    codebehind
    something like Response.Write("<script>window.close()</script>");
    it is still script but done from the codebehind as opposed to in the page.
    The finally analysis is it must be done thru script either thru streaming
    the script out or writing script on the client page

    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
    "David Laub" <> wrote in message
    news:...
    > is there a way to
    > 1) programmatically close a Web Form (e.g. the user presses a button, and
    > the click event calls some close method I can't find) Yes I can do this

    in
    > JavaScript, but I'd like to NOT do this in JavaScript
    > 2) programmatically set focus to a specific Web Form Control (e.g. in the
    > page load event handler, set focus to a specific Textbox) Yes I can do

    this
    > in JavaScript, but I'd like to NOT do this in JavaScript
    >
    >
     
    Alvin Bruney [MVP], Feb 21, 2004
    #3
    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. Jurjen de Groot

    SetFocus

    Jurjen de Groot, Jun 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    638
    dmedina
    Jun 30, 2003
  2. jamess

    asp setfocus and performance

    jamess, Oct 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    452
    Saravana [MVP]
    Oct 30, 2003
  3. jaffer the but

    setfocus eh ! help

    jaffer the but, Apr 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    570
    Lars Netzel
    Apr 14, 2004
  4. Mad Scientist Jr

    asp.net setfocus after validation not working

    Mad Scientist Jr, Jul 13, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    6,812
    Mad Scientist Jr
    Jul 15, 2004
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    939
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page