Autopost Back, FormView, and Textbox Focus

T

TdarTdar

Hello,

I have a formview control set to Insert only, As certian Fields are
entered it does an autopost to run some code (example: Protected Sub
TextBox_TextChanged)
back but when page is rewriten to the screen, the user has to re-select
the next field to work in that is very time consuming for them. Is there a
way to determine focus during autopost back and to set focus to next field
after that process is completed. Thanks...

Tdar
P.S. I am using asp.net 2.0 and formview control( on Insert
 
S

Steven Cheng[MSFT]

Hi Tdar,

Welcome again!
AS for the setting focus during the inner TextBox's autopostback so as to
let page focus on the next input entry after rendered to clientside ,I
think we can use the following means:

First use FormView.Row.FindControl to get the inner textBox(the next input
entry field) we'd like to set focus,

then, use Page.SetFocus(control) function to set the focus for that
control. For example, we have the following InsertTemplate for our
FormView1:

============
.....
<InsertItemTemplate>
CategoryName:
<asp:TextBox ID="CategoryNameTextBox" runat="server"
Text='<%# Bind("CategoryName") %>' AutoPostBack="True"
OnTextChanged="CategoryNameTextBox_TextChanged"></asp:TextBox><br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' AutoPostBack="True"
OnTextChanged="DescriptionTextBox_TextChanged"></asp:TextBox><br />
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate>
.....
============

We have set the two Textbox autopostback to True and provide a TextChanged
event handler in codeFile, and in each textBox's TextChanged event, we use
the above means to setfocus to the other textbox, like;


Protected Sub CategoryNameTextBox_TextChanged(ByVal sender As Object,
ByVal e As System.EventArgs)
Dim txt As TextBox =
CType(FormView1.Row.FindControl("DescriptionTextBox"), TextBox)
Page.SetFocus(txt)

End Sub


Protected Sub DescriptionTextBox_TextChanged(ByVal sender As Object, ByVal
e As System.EventArgs)
Dim txt As TextBox =
CType(FormView1.Row.FindControl("CategoryNameTextBox"), TextBox)
Page.SetFocus(txt)
End Sub

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: Autopost Back, FormView, and Textbox Focus
| thread-index: AcXPUnSEDP40CZrsQf6mGIoCiBBrPQ==
| X-WBNR-Posting-Host: 65.35.95.11
| From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| References: <[email protected]>
| Subject: RE: Autopost Back, FormView, and Textbox Focus
| Date: Wed, 12 Oct 2005 10:29:09 -0700
| Lines: 16
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:30589
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| My prefered language is VB
|
| "TdarTdar" wrote:
|
| > Hello,
| >
| > I have a formview control set to Insert only, As certian Fields are
| > entered it does an autopost to run some code (example: Protected Sub
| > TextBox_TextChanged)
| > back but when page is rewriten to the screen, the user has to re-select
| > the next field to work in that is very time consuming for them. Is
there a
| > way to determine focus during autopost back and to set focus to next
field
| > after that process is completed. Thanks...
| >
| > Tdar
| > P.S. I am using asp.net 2.0 and formview control( on Insert
|
 
T

TdarTdar

HI,
Cool just list VB .......

Question Why does the RangeValidator clear on autopostback and allows
data beyond what is mandated in the RangeValidator Then allow an invalid
number
is there a way to fix this I am sure you have had this issuse at some point/
 
S

Steven Cheng[MSFT]

Thanks for your followup Tdar,

As for the new problem you mentioned, would you provide me a simple page's
code so that I can perform some test on myside ?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Autopost Back, FormView, and Textbox Focus
| thread-index: AcXQd0DcTJt40r3eRnOnubuZjXFyxQ==
| X-WBNR-Posting-Host: 65.35.95.11
| From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: Autopost Back, FormView, and Textbox Focus
| Date: Thu, 13 Oct 2005 21:25:05 -0700
| Lines: 128
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11310
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| HI,
| Cool just list VB .......
|
| Question Why does the RangeValidator clear on autopostback and allows
| data beyond what is mandated in the RangeValidator Then allow an invalid
| number
| is there a way to fix this I am sure you have had this issuse at some
point/
|
|
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Tdar,
| >
| > Welcome again!
| > AS for the setting focus during the inner TextBox's autopostback so as
to
| > let page focus on the next input entry after rendered to clientside ,I
| > think we can use the following means:
| >
| > First use FormView.Row.FindControl to get the inner textBox(the next
input
| > entry field) we'd like to set focus,
| >
| > then, use Page.SetFocus(control) function to set the focus for that
| > control. For example, we have the following InsertTemplate for our
| > FormView1:
| >
| > ============
| > .....
| > <InsertItemTemplate>
| > CategoryName:
| > <asp:TextBox ID="CategoryNameTextBox" runat="server"
| > Text='<%# Bind("CategoryName") %>' AutoPostBack="True"
| > OnTextChanged="CategoryNameTextBox_TextChanged"></asp:TextBox><br />
| > Description:
| > <asp:TextBox ID="DescriptionTextBox" runat="server"
| > Text='<%# Bind("Description") %>' AutoPostBack="True"
| > OnTextChanged="DescriptionTextBox_TextChanged"></asp:TextBox><br />
| > <asp:LinkButton ID="InsertButton" runat="server"
| > CausesValidation="True" CommandName="Insert"
| > Text="Insert">
| > </asp:LinkButton>
| > <asp:LinkButton ID="InsertCancelButton" runat="server"
| > CausesValidation="False" CommandName="Cancel"
| > Text="Cancel">
| > </asp:LinkButton>
| > </InsertItemTemplate>
| > .....
| > ============
| >
| > We have set the two Textbox autopostback to True and provide a
TextChanged
| > event handler in codeFile, and in each textBox's TextChanged event, we
use
| > the above means to setfocus to the other textbox, like;
| >
| >
| > Protected Sub CategoryNameTextBox_TextChanged(ByVal sender As Object,
| > ByVal e As System.EventArgs)
| > Dim txt As TextBox =
| > CType(FormView1.Row.FindControl("DescriptionTextBox"), TextBox)
| > Page.SetFocus(txt)
| >
| > End Sub
| >
| >
| > Protected Sub DescriptionTextBox_TextChanged(ByVal sender As Object,
ByVal
| > e As System.EventArgs)
| > Dim txt As TextBox =
| > CType(FormView1.Row.FindControl("CategoryNameTextBox"), TextBox)
| > Page.SetFocus(txt)
| > End Sub
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | Thread-Topic: Autopost Back, FormView, and Textbox Focus
| > | thread-index: AcXPUnSEDP40CZrsQf6mGIoCiBBrPQ==
| > | X-WBNR-Posting-Host: 65.35.95.11
| > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| > | References: <[email protected]>
| > | Subject: RE: Autopost Back, FormView, and Textbox Focus
| > | Date: Wed, 12 Oct 2005 10:29:09 -0700
| > | Lines: 16
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:30589
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | My prefered language is VB
| > |
| > | "TdarTdar" wrote:
| > |
| > | > Hello,
| > | >
| > | > I have a formview control set to Insert only, As certian Fields
are
| > | > entered it does an autopost to run some code (example: Protected
Sub
| > | > TextBox_TextChanged)
| > | > back but when page is rewriten to the screen, the user has to
re-select
| > | > the next field to work in that is very time consuming for them.
Is
| > there a
| > | > way to determine focus during autopost back and to set focus to
next
| > field
| > | > after that process is completed. Thanks...
| > | >
| > | > Tdar
| > | > P.S. I am using asp.net 2.0 and formview control( on Insert
| > |
| >
| >
|
 
T

TdarTdar

I dont have the time right now but do want to get that solved. I will send
you and email when i get a sample setup.

Steven Cheng said:
Thanks for your followup Tdar,

As for the new problem you mentioned, would you provide me a simple page's
code so that I can perform some test on myside ?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Autopost Back, FormView, and Textbox Focus
| thread-index: AcXQd0DcTJt40r3eRnOnubuZjXFyxQ==
| X-WBNR-Posting-Host: 65.35.95.11
| From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: Autopost Back, FormView, and Textbox Focus
| Date: Thu, 13 Oct 2005 21:25:05 -0700
| Lines: 128
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11310
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| HI,
| Cool just list VB .......
|
| Question Why does the RangeValidator clear on autopostback and allows
| data beyond what is mandated in the RangeValidator Then allow an invalid
| number
| is there a way to fix this I am sure you have had this issuse at some
point/
|
|
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Tdar,
| >
| > Welcome again!
| > AS for the setting focus during the inner TextBox's autopostback so as
to
| > let page focus on the next input entry after rendered to clientside ,I
| > think we can use the following means:
| >
| > First use FormView.Row.FindControl to get the inner textBox(the next
input
| > entry field) we'd like to set focus,
| >
| > then, use Page.SetFocus(control) function to set the focus for that
| > control. For example, we have the following InsertTemplate for our
| > FormView1:
| >
| > ============
| > .....
| > <InsertItemTemplate>
| > CategoryName:
| > <asp:TextBox ID="CategoryNameTextBox" runat="server"
| > Text='<%# Bind("CategoryName") %>' AutoPostBack="True"
| > OnTextChanged="CategoryNameTextBox_TextChanged"></asp:TextBox><br />
| > Description:
| > <asp:TextBox ID="DescriptionTextBox" runat="server"
| > Text='<%# Bind("Description") %>' AutoPostBack="True"
| > OnTextChanged="DescriptionTextBox_TextChanged"></asp:TextBox><br />
| > <asp:LinkButton ID="InsertButton" runat="server"
| > CausesValidation="True" CommandName="Insert"
| > Text="Insert">
| > </asp:LinkButton>
| > <asp:LinkButton ID="InsertCancelButton" runat="server"
| > CausesValidation="False" CommandName="Cancel"
| > Text="Cancel">
| > </asp:LinkButton>
| > </InsertItemTemplate>
| > .....
| > ============
| >
| > We have set the two Textbox autopostback to True and provide a
TextChanged
| > event handler in codeFile, and in each textBox's TextChanged event, we
use
| > the above means to setfocus to the other textbox, like;
| >
| >
| > Protected Sub CategoryNameTextBox_TextChanged(ByVal sender As Object,
| > ByVal e As System.EventArgs)
| > Dim txt As TextBox =
| > CType(FormView1.Row.FindControl("DescriptionTextBox"), TextBox)
| > Page.SetFocus(txt)
| >
| > End Sub
| >
| >
| > Protected Sub DescriptionTextBox_TextChanged(ByVal sender As Object,
ByVal
| > e As System.EventArgs)
| > Dim txt As TextBox =
| > CType(FormView1.Row.FindControl("CategoryNameTextBox"), TextBox)
| > Page.SetFocus(txt)
| > End Sub
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | Thread-Topic: Autopost Back, FormView, and Textbox Focus
| > | thread-index: AcXPUnSEDP40CZrsQf6mGIoCiBBrPQ==
| > | X-WBNR-Posting-Host: 65.35.95.11
| > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| > | References: <[email protected]>
| > | Subject: RE: Autopost Back, FormView, and Textbox Focus
| > | Date: Wed, 12 Oct 2005 10:29:09 -0700
| > | Lines: 16
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:30589
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | My prefered language is VB
| > |
| > | "TdarTdar" wrote:
| > |
| > | > Hello,
| > | >
| > | > I have a formview control set to Insert only, As certian Fields
are
| > | > entered it does an autopost to run some code (example: Protected
Sub
| > | > TextBox_TextChanged)
| > | > back but when page is rewriten to the screen, the user has to
re-select
| > | > the next field to work in that is very time consuming for them.
Is
| > there a
| > | > way to determine focus during autopost back and to set focus to
next
| > field
| > | > after that process is completed. Thanks...
| > | >
| > | > Tdar
| > | > P.S. I am using asp.net 2.0 and formview control( on Insert
| > |
| >
| >
|
 
S

Steven Cheng[MSFT]

Thanks for your followup Tdar,

Please feel free to post here when you need any further assistance.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Autopost Back, FormView, and Textbox Focus
| thread-index: AcXi64XwlY3HXfUaRTCKObie8KRACQ==
| X-WBNR-Posting-Host: 65.35.95.187
| From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: Autopost Back, FormView, and Textbox Focus
| Date: Sun, 6 Nov 2005 08:02:44 -0800
| Lines: 188
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11721
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I dont have the time right now but do want to get that solved. I will
send
| you and email when i get a sample setup.
|
| "Steven Cheng[MSFT]" wrote:
|
| > Thanks for your followup Tdar,
| >
| > As for the new problem you mentioned, would you provide me a simple
page's
| > code so that I can perform some test on myside ?
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | Thread-Topic: Autopost Back, FormView, and Textbox Focus
| > | thread-index: AcXQd0DcTJt40r3eRnOnubuZjXFyxQ==
| > | X-WBNR-Posting-Host: 65.35.95.11
| > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | Subject: RE: Autopost Back, FormView, and Textbox Focus
| > | Date: Thu, 13 Oct 2005 21:25:05 -0700
| > | Lines: 128
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:11310
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | HI,
| > | Cool just list VB .......
| > |
| > | Question Why does the RangeValidator clear on autopostback and allows
| > | data beyond what is mandated in the RangeValidator Then allow an
invalid
| > | number
| > | is there a way to fix this I am sure you have had this issuse at some
| > point/
| > |
| > |
| > |
| > |
| > | "Steven Cheng[MSFT]" wrote:
| > |
| > | > Hi Tdar,
| > | >
| > | > Welcome again!
| > | > AS for the setting focus during the inner TextBox's autopostback so
as
| > to
| > | > let page focus on the next input entry after rendered to clientside
,I
| > | > think we can use the following means:
| > | >
| > | > First use FormView.Row.FindControl to get the inner textBox(the
next
| > input
| > | > entry field) we'd like to set focus,
| > | >
| > | > then, use Page.SetFocus(control) function to set the focus for that
| > | > control. For example, we have the following InsertTemplate for our
| > | > FormView1:
| > | >
| > | > ============
| > | > .....
| > | > <InsertItemTemplate>
| > | > CategoryName:
| > | > <asp:TextBox ID="CategoryNameTextBox"
runat="server"
| > | > Text='<%# Bind("CategoryName") %>' AutoPostBack="True"
| > | > OnTextChanged="CategoryNameTextBox_TextChanged"></asp:TextBox><br />
| > | > Description:
| > | > <asp:TextBox ID="DescriptionTextBox" runat="server"
| > | > Text='<%# Bind("Description") %>' AutoPostBack="True"
| > | > OnTextChanged="DescriptionTextBox_TextChanged"></asp:TextBox><br />
| > | > <asp:LinkButton ID="InsertButton" runat="server"
| > | > CausesValidation="True" CommandName="Insert"
| > | > Text="Insert">
| > | > </asp:LinkButton>
| > | > <asp:LinkButton ID="InsertCancelButton" runat="server"
| > | > CausesValidation="False" CommandName="Cancel"
| > | > Text="Cancel">
| > | > </asp:LinkButton>
| > | > </InsertItemTemplate>
| > | > .....
| > | > ============
| > | >
| > | > We have set the two Textbox autopostback to True and provide a
| > TextChanged
| > | > event handler in codeFile, and in each textBox's TextChanged event,
we
| > use
| > | > the above means to setfocus to the other textbox, like;
| > | >
| > | >
| > | > Protected Sub CategoryNameTextBox_TextChanged(ByVal sender As
Object,
| > | > ByVal e As System.EventArgs)
| > | > Dim txt As TextBox =
| > | > CType(FormView1.Row.FindControl("DescriptionTextBox"), TextBox)
| > | > Page.SetFocus(txt)
| > | >
| > | > End Sub
| > | >
| > | >
| > | > Protected Sub DescriptionTextBox_TextChanged(ByVal sender As
Object,
| > ByVal
| > | > e As System.EventArgs)
| > | > Dim txt As TextBox =
| > | > CType(FormView1.Row.FindControl("CategoryNameTextBox"), TextBox)
| > | > Page.SetFocus(txt)
| > | > End Sub
| > | >
| > | > Hope helps. Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | > --------------------
| > | > | Thread-Topic: Autopost Back, FormView, and Textbox Focus
| > | > | thread-index: AcXPUnSEDP40CZrsQf6mGIoCiBBrPQ==
| > | > | X-WBNR-Posting-Host: 65.35.95.11
| > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <[email protected]>
| > | > | References: <[email protected]>
| > | > | Subject: RE: Autopost Back, FormView, and Textbox Focus
| > | > | Date: Wed, 12 Oct 2005 10:29:09 -0700
| > | > | Lines: 16
| > | > | Message-ID: <[email protected]>
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain;
| > | > | charset="Utf-8"
| > | > | Content-Transfer-Encoding: 7bit
| > | > | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | Content-Class: urn:content-classes:message
| > | > | Importance: normal
| > | > | Priority: normal
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet.webcontrols:30589
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | > |
| > | > | My prefered language is VB
| > | > |
| > | > | "TdarTdar" wrote:
| > | > |
| > | > | > Hello,
| > | > | >
| > | > | > I have a formview control set to Insert only, As certian
Fields
| > are
| > | > | > entered it does an autopost to run some code (example:
Protected
| > Sub
| > | > | > TextBox_TextChanged)
| > | > | > back but when page is rewriten to the screen, the user has to
| > re-select
| > | > | > the next field to work in that is very time consuming for them.

| > Is
| > | > there a
| > | > | > way to determine focus during autopost back and to set focus to
| > next
| > | > field
| > | > | > after that process is completed. Thanks...
| > | > | >
| > | > | > Tdar
| > | > | > P.S. I am using asp.net 2.0 and formview control( on Insert
| > | > |
| > | >
| > | >
| > |
| >
| >
|
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top