Close a WebForm? SetFocus in a WebForm?

D

David Laub

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
 
J

Jim Cheshire [MSFT]

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
(e-mail address removed)

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

--------------------
 
A

Alvin Bruney [MVP]

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top