ScriptManager.SetFocus Metod

Definition

Anger webbläsarens fokus till den angivna kontrollen.

Överlagringar

Name Description
SetFocus(String)

Anger webbläsarens fokus till den kontroll som anges av ID.

SetFocus(Control)

Anger webbläsarens fokus till den angivna kontrollen.

SetFocus(String)

Anger webbläsarens fokus till den kontroll som anges av ID.

public:
 void SetFocus(System::String ^ clientID);
public void SetFocus(string clientID);
member this.SetFocus : string -> unit
Public Sub SetFocus (clientID As String)

Parametrar

clientID
String

ID:t för kontrollen som ska få fokus.

Kommentarer

Metoden SetFocus fungerar som SetFocus -metoden för Page klassen. Båda metoderna gör kontrollen med det angivna ID:t till den aktiva kontrollen på webbsidan. Metoden SetFocus för ScriptManager klassen används för att ange fokus under en asynkron postback. Under postbacks och när sidan först återges SetFocus anropar SetFocus metoden klassens Page metod.

Om det finns flera anrop till SetFocus metoden får kontrollen i det senaste anropet fokus.

Se även

Gäller för

SetFocus(Control)

Anger webbläsarens fokus till den angivna kontrollen.

public:
 void SetFocus(System::Web::UI::Control ^ control);
public void SetFocus(System.Web.UI.Control control);
member this.SetFocus : System.Web.UI.Control -> unit
Public Sub SetFocus (control As Control)

Parametrar

control
Control

Kontrollen för att ta emot fokus.

Kommentarer

Metoden SetFocus fungerar som SetFocus -metoden för Page klassen. Båda metoderna gör den angivna kontrollen till den aktiva kontrollen på webbsidan. Metoden SetFocus för ScriptManager klassen används för att ange fokus under en asynkron postback. Under postbacks och när sidan först återges SetFocus anropar SetFocus metoden klassens Page metod.

Om det finns flera anrop till SetFocus metoden får kontrollen som angavs i det senaste anropet fokus.

Se även

Gäller för