Showing posts with label postback. Show all posts
Showing posts with label postback. Show all posts

Saturday, March 24, 2012

Set Focus and post back on Dropdown List

I have a dropdown list that hides certain rows in a datagrid.

The focus remains on the dropdown list after the postback and I am trying to get it away from it because the user may and does want to use the mouse wheel to scroll down, but since the focus is on the ddl, they may not see it and it will resort.

Here is my set focus code which works fine on page load event...


Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control)
Dim s As String = "<SCRIPT language='javascript'>document.getElementById('" & ctrl.ID & "').focus() </SCRIPT>"
RegisterStartupScript("focus", s)
End Sub

And this code is for the page load event...


If Not IsPostBack Then
Me.SetFocus(Me.txtSearch)
End If

I have been trying to place the Me.SetFocus(Me.txtSearch) where the postback of the ddl occurs in the code, such as the reBind() or the ddlTypes_SelectedIndexChanged() and the dgServer_ItemDataBound() which has the ddl code.
None seem to work, but it works on page load event.

Suggestions?

Thanks all,

Zath
This should work fine from your ddlTypes_SelectedIndexChanged() event handler. Are calling this method only if the IsPostBack property is false? If so, that could be your problem.

Have you tried putting the SetFocus in the Page_PreRender? This runs after the event code.


Private Sub Page_PreRender(ByVal sender AS Object,VyVal e AS System.EventArgs) Handles MyBase.PreRender
If ispostback=true then
Me.SetFocus(Me.txtSearch)
End if
End Sub

You can use
If Not ispostback
if necessary.
check out my component here :view post 821121

regards

set focus after postback

How can I set the focus to a control after postback?I have some javascript function to set the focus in onload event,but it looks like the onload event is not trigger after postback.ThanksThis will do what you want:
-- focus and select in a textbox
Dim sb As New System.Text.StringBuilder

sb.Append("<script language=javascript>")
sb.Append("document.forms.myForm.txtMyBox.focus();")
sb.Append("document.forms.myForm.txtMyBox.select();")
sb.Append("</script>")

If Not IsStartupScriptRegistered("MyBoxSelect") Then
RegisterStartupScript("MyBoxSelect", sb.ToString())
End If


Also, you might have a look @.view post 821121

regards

set focus on postback/textchanged

I'm setting focus depenting upon which field has changed value. I'm doing
this with the following: Page.RegisterStartupScript("SetFocus", "<script
language=""Jscript"" > document.getElementById(""txtCity"").focus();
</Script>"). This is being called on the textChanged event for textboxes. fo
r
city it goes to state for state it goes to zip, ...
It works, but is this the correct way to do this or should this be a seties
of if then else's in he page load? if so, how can i isolate the textbox that
caused the event?
thanks
kesYou can change the javascript you have below to generate the name of the
control that caused the event:
Page.RegisterStartupScript("SetFocus", "<script language='Jscript'>
document.getElementById(" + controlName + ").focus(); </Script>").
in the "Changed" event of the control just set the "controlName" variable to
the required javascript id for the control:
i.e. for the txtCity changed event:
controlName = "txtCity";
I'm assuming that you are calling the Page.RegisterStartupScript() function
in the "Render" event of the page - you'll need to remember that because the
"Render" is called after the "Changed" event and thats what you want, if you
put the Page.RegisterStartupScript() in the Page_Load() by mistake, then the
"controlName" variable will not be assigned a value yet.
"Kurt Schroeder" wrote:

> I'm setting focus depenting upon which field has changed value. I'm doing
> this with the following: Page.RegisterStartupScript("SetFocus", "<script
> language=""Jscript"" > document.getElementById(""txtCity"").focus();
> </Script>"). This is being called on the textChanged event for textboxes.
for
> city it goes to state for state it goes to zip, ...
> It works, but is this the correct way to do this or should this be a setie
s
> of if then else's in he page load? if so, how can i isolate the textbox th
at
> caused the event?
> thanks
> kes
Thank you for replying!
i have the function call in each of the respective controls' changed event
:
Example:
Private Sub txtbAdr1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtbAdr1.TextChanged
If chkShipSame.Checked Then
txtSadr1.Text = txtbAdr1.Text
Page.RegisterStartupScript("SetFocus", "<script
language=""Javascript"" > document.getElementById(""txtbadr2"").focus();
</Script>")
End If
End Sub
In vS.net i could not find the Render event under page, but i'm still
learning this. as well as JavaScript. I see PreRender, but not render.
1. My guess is the funtion calls are not in the right place, but should only
be one function call in the Render event?
2. where can i find Render?
3. the controlname variable is this a simple .net string variable or a
javascript variable?
Thanks
kes
"Jorge L Matos [MCSD.NET]" wrote:
> You can change the javascript you have below to generate the name of the
> control that caused the event:
> Page.RegisterStartupScript("SetFocus", "<script language='Jscript'>
> document.getElementById(" + controlName + ").focus(); </Script>").
> in the "Changed" event of the control just set the "controlName" variable
to
> the required javascript id for the control:
> i.e. for the txtCity changed event:
> controlName = "txtCity";
> I'm assuming that you are calling the Page.RegisterStartupScript() functio
n
> in the "Render" event of the page - you'll need to remember that because t
he
> "Render" is called after the "Changed" event and thats what you want, if y
ou
> put the Page.RegisterStartupScript() in the Page_Load() by mistake, then t
he
> "controlName" variable will not be assigned a value yet.
> "Kurt Schroeder" wrote:
>
Sorry, I meant the "PreRender" event, not the "Render".
Answers:
1. Yes, but use "PreRender" not "Render"
2. Don't worry about Render
3. The controlName variable is a field of the "Page" class that you create
and all the "Change" events can set it to the javascript ID of the control.
The page events are typically executed in the following order:
a) Init
b) Load
c) Change Events
d) Click Events
e) PreRender
f) Render
REF:
http://msdn.microsoft.com/library/d...onlifecycle.asp
ASP.NET 2.0 will have an enhanced page event life cycle with more events
that you can hook into.
"Kurt Schroeder" wrote:
> Thank you for replying!
> i have the function call in each of the respective controls' changed eve
nt:
> Example:
> Private Sub txtbAdr1_TextChanged(ByVal sender As System.Object, ByVal
e
> As System.EventArgs) Handles txtbAdr1.TextChanged
> If chkShipSame.Checked Then
> txtSadr1.Text = txtbAdr1.Text
> Page.RegisterStartupScript("SetFocus", "<script
> language=""Javascript"" > document.getElementById(""txtbadr2"").focus();
> </Script>")
> End If
> End Sub
> In vS.net i could not find the Render event under page, but i'm still
> learning this. as well as JavaScript. I see PreRender, but not render.
> 1. My guess is the funtion calls are not in the right place, but should on
ly
> be one function call in the Render event?
> 2. where can i find Render?
> 3. the controlname variable is this a simple .net string variable or a
> javascript variable?
> Thanks
> kes
> "Jorge L Matos [MCSD.NET]" wrote:
>

set focus on postback/textchanged

I'm setting focus depenting upon which field has changed value. I'm doing
this with the following: Page.RegisterStartupScript("SetFocus", "<script
language=""Jscript"" > document.getElementById(""txtCity"").focus();
</Script>"). This is being called on the textChanged event for textboxes. for
city it goes to state for state it goes to zip, ...
It works, but is this the correct way to do this or should this be a seties
of if then else's in he page load? if so, how can i isolate the textbox that
caused the event?

thanks
kesYou can change the javascript you have below to generate the name of the
control that caused the event:

Page.RegisterStartupScript("SetFocus", "<script language='Jscript'>
document.getElementById(" + controlName + ").focus(); </Script>").

in the "Changed" event of the control just set the "controlName" variable to
the required javascript id for the control:

i.e. for the txtCity changed event:

controlName = "txtCity";

I'm assuming that you are calling the Page.RegisterStartupScript() function
in the "Render" event of the page - you'll need to remember that because the
"Render" is called after the "Changed" event and thats what you want, if you
put the Page.RegisterStartupScript() in the Page_Load() by mistake, then the
"controlName" variable will not be assigned a value yet.

"Kurt Schroeder" wrote:

> I'm setting focus depenting upon which field has changed value. I'm doing
> this with the following: Page.RegisterStartupScript("SetFocus", "<script
> language=""Jscript"" > document.getElementById(""txtCity"").focus();
> </Script>"). This is being called on the textChanged event for textboxes. for
> city it goes to state for state it goes to zip, ...
> It works, but is this the correct way to do this or should this be a seties
> of if then else's in he page load? if so, how can i isolate the textbox that
> caused the event?
> thanks
> kes
Thank you for replying!

i have the function call in each of the respective controls' changed event:
Example:
Private Sub txtbAdr1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtbAdr1.TextChanged
If chkShipSame.Checked Then
txtSadr1.Text = txtbAdr1.Text
Page.RegisterStartupScript("SetFocus", "<script
language=""Javascript"" > document.getElementById(""txtbadr2"").focus();
</Script>")
End If
End Sub

In vS.net i could not find the Render event under page, but i'm still
learning this. as well as JavaScript. I see PreRender, but not render.
1. My guess is the funtion calls are not in the right place, but should only
be one function call in the Render event?
2. where can i find Render?
3. the controlname variable is this a simple .net string variable or a
javascript variable?
Thanks
kes

"Jorge L Matos [MCSD.NET]" wrote:

> You can change the javascript you have below to generate the name of the
> control that caused the event:
> Page.RegisterStartupScript("SetFocus", "<script language='Jscript'>
> document.getElementById(" + controlName + ").focus(); </Script>").
> in the "Changed" event of the control just set the "controlName" variable to
> the required javascript id for the control:
> i.e. for the txtCity changed event:
> controlName = "txtCity";
> I'm assuming that you are calling the Page.RegisterStartupScript() function
> in the "Render" event of the page - you'll need to remember that because the
> "Render" is called after the "Changed" event and thats what you want, if you
> put the Page.RegisterStartupScript() in the Page_Load() by mistake, then the
> "controlName" variable will not be assigned a value yet.
> "Kurt Schroeder" wrote:
> > I'm setting focus depenting upon which field has changed value. I'm doing
> > this with the following: Page.RegisterStartupScript("SetFocus", "<script
> > language=""Jscript"" > document.getElementById(""txtCity"").focus();
> > </Script>"). This is being called on the textChanged event for textboxes. for
> > city it goes to state for state it goes to zip, ...
> > It works, but is this the correct way to do this or should this be a seties
> > of if then else's in he page load? if so, how can i isolate the textbox that
> > caused the event?
> > thanks
> > kes
Sorry, I meant the "PreRender" event, not the "Render".

Answers:
1. Yes, but use "PreRender" not "Render"
2. Don't worry about Render
3. The controlName variable is a field of the "Page" class that you create
and all the "Change" events can set it to the javascript ID of the control.

The page events are typically executed in the following order:
a) Init
b) Load
c) Change Events
d) Click Events
e) PreRender
f) Render

REF:
http://msdn.microsoft.com/library/d...onlifecycle.asp

ASP.NET 2.0 will have an enhanced page event life cycle with more events
that you can hook into.

"Kurt Schroeder" wrote:

> Thank you for replying!
> i have the function call in each of the respective controls' changed event:
> Example:
> Private Sub txtbAdr1_TextChanged(ByVal sender As System.Object, ByVal e
> As System.EventArgs) Handles txtbAdr1.TextChanged
> If chkShipSame.Checked Then
> txtSadr1.Text = txtbAdr1.Text
> Page.RegisterStartupScript("SetFocus", "<script
> language=""Javascript"" > document.getElementById(""txtbadr2"").focus();
> </Script>")
> End If
> End Sub
> In vS.net i could not find the Render event under page, but i'm still
> learning this. as well as JavaScript. I see PreRender, but not render.
> 1. My guess is the funtion calls are not in the right place, but should only
> be one function call in the Render event?
> 2. where can i find Render?
> 3. the controlname variable is this a simple .net string variable or a
> javascript variable?
> Thanks
> kes
> "Jorge L Matos [MCSD.NET]" wrote:
> > You can change the javascript you have below to generate the name of the
> > control that caused the event:
> > Page.RegisterStartupScript("SetFocus", "<script language='Jscript'>
> > document.getElementById(" + controlName + ").focus(); </Script>").
> > in the "Changed" event of the control just set the "controlName" variable to
> > the required javascript id for the control:
> > i.e. for the txtCity changed event:
> > controlName = "txtCity";
> > I'm assuming that you are calling the Page.RegisterStartupScript() function
> > in the "Render" event of the page - you'll need to remember that because the
> > "Render" is called after the "Changed" event and thats what you want, if you
> > put the Page.RegisterStartupScript() in the Page_Load() by mistake, then the
> > "controlName" variable will not be assigned a value yet.
> > "Kurt Schroeder" wrote:
> > > I'm setting focus depenting upon which field has changed value. I'm doing
> > > this with the following: Page.RegisterStartupScript("SetFocus", "<script
> > > language=""Jscript"" > document.getElementById(""txtCity"").focus();
> > > </Script>"). This is being called on the textChanged event for textboxes. for
> > > city it goes to state for state it goes to zip, ...
> > > It works, but is this the correct way to do this or should this be a seties
> > > of if then else's in he page load? if so, how can i isolate the textbox that
> > > caused the event?
> > > > thanks
> > > kes

Set focus problem

I have a page with a drop down and several web controls. The drop down
is set to postback and it reloads the textboxes based on the selected
drop down item. I set the focus to the first textbox control on the
client like this:
<script language="vbscript">
Option Explicit
...other code
If Not <%=mbReadOnly%> Then
document.frmDetails.txtName.focus()
End If
...other code
</script>
This works fine on first page load but when I change the drop down it
does reset the focus and you can't even type in the first textbox
until you select another textbox first.
To debug I added a message box right before the set focus to see if it
was even getting to this line of code and it works but I can't leave a
message box here.
Any ideas on what could be the problem?
Thanks in advance for any help,
DeidreHi

setfocus in body onload event,

document.frmDetails.txtName.focus()

HTH
Ravikanth

>--Original Message--
>I have a page with a drop down and several web controls.
The drop down
>is set to postback and it reloads the textboxes based on
the selected
>drop down item. I set the focus to the first textbox
control on the
>client like this:
><script language="vbscript">
>Option Explicit
>...other code
>If Not <%=mbReadOnly%> Then
>document.frmDetails.txtName.focus()
>End If
>...other code
></script>
>This works fine on first page load but when I change the
drop down it
>does reset the focus and you can't even type in the
first textbox
>until you select another textbox first.
>To debug I added a message box right before the set
focus to see if it
>was even getting to this line of code and it works but I
can't leave a
>message box here.
>Any ideas on what could be the problem?
>Thanks in advance for any help,
>Deidre
>.
Thanks for the suggestion but it does the same thing if I put it in a
body onload event.

"Ravikanth[MVP]" <dvravikanth@.hotmail.com> wrote in message news:<0e1c01c34d31$17c134a0$a301280a@.phx.gbl>...
> Hi
> setfocus in body onload event,
> document.frmDetails.txtName.focus()
> HTH
> Ravikanth
I fixed my problem. I needed to move my set focus command to the window_onload sub:
Sub Window_OnLoad()
If Not <%=mbReadOnly%> Then
document.frmDetails.txtName.focus()
End If
End Sub

Deidre

Set focus to a control inside a Updatepanel in Atlas

After a postback, how do I set focus onto a control that is inside an
updatepanel?Hello Ssflynn,

As for the ATLAS updatepanel setfocus function you mentioned, I've
performed some local tests, it seems the Page.SetFocus method or
Page.ClientScript.RegisterXXXX methods will work only if the
"scriptmanager" is configured as "enablepartialrendering=false". However,
in such mode, the whole page will be rerender when we perform postback.

<atlas:Scriptmanager id="ScriptManager" runat="server"
enablepartialrendering="true" />

Currently, I'm doing some further research to see whether we can find a way
to set control focus when use "partialrendering" mode for updatable. I'll
update you as soon as I've got any finding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Hello Ssflynn,

How are you doing on this issue? After further discussion with some
production engineer, so far there is no built-in API or interface that will
control focus in atlas udpatepanel. However, In Atlas 1.0 and future
versions we'll have built-in control focus support (e.g.
ScriptManager.SetFocus(Control), etc.).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
Is there any built-in API or interface that will
control focus in atlas udpatepanel?

Is there any Patch available for ScriptManager.SetFocus(control) , after the Partial Postback is completed?

Thanks in Advance
Hi Venkat,

Thanks for your input.

So far what I've got the from the product team is that the focus control
(ATLAS specific) will be provided in the 1.0 release only).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
I still would like to be able to do this, I've given up on it so far.

Has the Atlas 1.0 been released yet?

"Steven Cheng[MSFT]" <stcheng@.online.microsoft.comwrote in message
news:5M3xoE71GHA.4280@.TK2MSFTNGXA01.phx.gbl...

Quote:

Originally Posted by

Hello Ssflynn,
>
How are you doing on this issue? After further discussion with some
production engineer, so far there is no built-in API or interface that
will
control focus in atlas udpatepanel. However, In Atlas 1.0 and future
versions we'll have built-in control focus support (e.g.
ScriptManager.SetFocus(Control), etc.).
>
Sincerely,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>


Thanks for your followup Ssflynn,

So far the available ATLAS package is still the CTP version. We haven't got
the definite date of the relase of ATLAS 1.0. Anyway, you can keep
monitoring on the www.asp.net ATLAS home on any new update.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Set Focus to control after postback

I am usingVB with .net 1.1 and I wish to set focus to a textbox after the
autopostback event of a dropdownlist. When the user changes the selection of
my dropdownlist an onchange event occurs and the form does autopostback.
After the on change event I need to set focus to the next textbox. How do I
do this>On Oct 29, 1:08 pm, Victorious1
<Victorio...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

I am usingVB with .net 1.1 and I wish to set focus to a textbox after the
autopostback event of a dropdownlist. When the user changes the selection of
my dropdownlist an onchange event occurs and the form does autopostback.
After the on change event I need to set focus to the next textbox. How do I
do this>


This is C# syntax but the idea is the same for VB.

In the page load method have this:
Page.ClientScript.RegisterClientScriptBlock(this.G etType(),
"SomeName", <WebControlName>.focus());

set focus to form after postback

Hi.

I have one datalist and i have done custom paging for it.

I have four link button "First","Previous","Next", "Last" for paging datalist

Now I want to do paging on key press like as Right arrow for Next,Left Arrow for Previous,..........

for that I am calling javascript on onkeypress event of form.

Now Its working fine but problem is that javascript is called only on form key press event.

so that I want to set out focus on form after every post back.

I am calling following line at last but not working.

this.form1.Focus();

plz any one can help me?

best regard

pathan

Try this Just a guess

<formdefaultfocus="form1"id="form1"runat="server">


not helpful

Tuesday, March 13, 2012

Set Postback or Session Timeout

Hi All.
I have a page that users enter information in text boxes...and
sometimes it's a lot of information. There are times that these folks
either take their time entering the info or do other things before they
submit the page. Unfortunately, if they do take their time, there are
times where the session times out and they can no longer submit their
information, resulting in an error and pretty peeved users.
What I'm asking for help on is...can, possibly through a timer or
something either reset the session or do a postback? This would be to
cover in case the user would take too much time to submit the
information....it would happen automatically. I do have a popup box
that warns them they are about to time out, but it might not be seen.
So far, I have tried a timer to redirect the page to itself, try to go
through the page_load and try to set the session.timeout, but none of
it looks to work. I did see some __doPostBack and Page.GetPostBackEvent
articles, but didn't see how to put them to use. They get mentioned,
but I don't see how to make them function on my page. I need some way
to try to keep the session alive and not timeout. Sorry if it's
something that's easy that I don't see. I'm still a bit (ok, well very)
new at this I have searched Google high and low and found nothing that
looks to work.
Thanks for any help you can be!!
kurtYou can:
1. Extend the length of the session timeout.
2. Store your information in ViewState instead.
"kurt" <kbaker@.granitemicrosystems.com> wrote in message
news:1115834747.970410.207850@.o13g2000cwo.googlegroups.com...
> Hi All.
> I have a page that users enter information in text boxes...and
> sometimes it's a lot of information. There are times that these folks
> either take their time entering the info or do other things before they
> submit the page. Unfortunately, if they do take their time, there are
> times where the session times out and they can no longer submit their
> information, resulting in an error and pretty peeved users.
> What I'm asking for help on is...can, possibly through a timer or
> something either reset the session or do a postback? This would be to
> cover in case the user would take too much time to submit the
> information....it would happen automatically. I do have a popup box
> that warns them they are about to time out, but it might not be seen.
> So far, I have tried a timer to redirect the page to itself, try to go
> through the page_load and try to set the session.timeout, but none of
> it looks to work. I did see some __doPostBack and Page.GetPostBackEvent
> articles, but didn't see how to put them to use. They get mentioned,
> but I don't see how to make them function on my page. I need some way
> to try to keep the session alive and not timeout. Sorry if it's
> something that's easy that I don't see. I'm still a bit (ok, well very)
> new at this I have searched Google high and low and found nothing that
> looks to work.
> Thanks for any help you can be!!
> kurt
>
kurt wrote:
> Hi All.
> I have a page that users enter information in text boxes...and
> sometimes it's a lot of information. There are times that these folks
> either take their time entering the info or do other things before
> they submit the page. Unfortunately, if they do take their time,
> there are times where the session times out and they can no longer
> submit their information, resulting in an error and pretty peeved
> users.
> What I'm asking for help on is...can, possibly through a timer or
> something either reset the session or do a postback? This would be to
> cover in case the user would take too much time to submit the
> information....it would happen automatically. I do have a popup box
> that warns them they are about to time out, but it might not be seen.
>
Maybe you can use a (small) iframe that refreshes itself every few minutes,
to keep the session alive but without submitting the entire page
(and losing scroll-position and focus).
Hans Kesting
Sorry I didn't get back sooner, but I was out for a while. I'm not
sure extending the timeout would work. If I set it to 30 minutes,
they'll probably go 31...and so on. I also wasn't sure that the
viewstate would be usable and last either. But, I did try the iframe
and so far it looks to do exactly as I needed. I also have been trying
it out and I don't look to lose focus from the control I'm currently
using when the iframe refreshes. Thanks for all the input!!
Kurt

Set Postback or Session Timeout

Hi All.
I have a page that users enter information in text boxes...and
sometimes it's a lot of information. There are times that these folks
either take their time entering the info or do other things before they
submit the page. Unfortunately, if they do take their time, there are
times where the session times out and they can no longer submit their
information, resulting in an error and pretty peeved users.

What I'm asking for help on is...can, possibly through a timer or
something either reset the session or do a postback? This would be to
cover in case the user would take too much time to submit the
information....it would happen automatically. I do have a popup box
that warns them they are about to time out, but it might not be seen.

So far, I have tried a timer to redirect the page to itself, try to go
through the page_load and try to set the session.timeout, but none of
it looks to work. I did see some __doPostBack and Page.GetPostBackEvent
articles, but didn't see how to put them to use. They get mentioned,
but I don't see how to make them function on my page. I need some way
to try to keep the session alive and not timeout. Sorry if it's
something that's easy that I don't see. I'm still a bit (ok, well very)
new at this I have searched Google high and low and found nothing that
looks to work.

Thanks for any help you can be!!

kurtYou can:
1. Extend the length of the session timeout.
2. Store your information in ViewState instead.

"kurt" <kbaker@.granitemicrosystems.com> wrote in message
news:1115834747.970410.207850@.o13g2000cwo.googlegr oups.com...
> Hi All.
> I have a page that users enter information in text boxes...and
> sometimes it's a lot of information. There are times that these folks
> either take their time entering the info or do other things before they
> submit the page. Unfortunately, if they do take their time, there are
> times where the session times out and they can no longer submit their
> information, resulting in an error and pretty peeved users.
> What I'm asking for help on is...can, possibly through a timer or
> something either reset the session or do a postback? This would be to
> cover in case the user would take too much time to submit the
> information....it would happen automatically. I do have a popup box
> that warns them they are about to time out, but it might not be seen.
> So far, I have tried a timer to redirect the page to itself, try to go
> through the page_load and try to set the session.timeout, but none of
> it looks to work. I did see some __doPostBack and Page.GetPostBackEvent
> articles, but didn't see how to put them to use. They get mentioned,
> but I don't see how to make them function on my page. I need some way
> to try to keep the session alive and not timeout. Sorry if it's
> something that's easy that I don't see. I'm still a bit (ok, well very)
> new at this I have searched Google high and low and found nothing that
> looks to work.
> Thanks for any help you can be!!
> kurt
kurt wrote:
> Hi All.
> I have a page that users enter information in text boxes...and
> sometimes it's a lot of information. There are times that these folks
> either take their time entering the info or do other things before
> they submit the page. Unfortunately, if they do take their time,
> there are times where the session times out and they can no longer
> submit their information, resulting in an error and pretty peeved
> users.
> What I'm asking for help on is...can, possibly through a timer or
> something either reset the session or do a postback? This would be to
> cover in case the user would take too much time to submit the
> information....it would happen automatically. I do have a popup box
> that warns them they are about to time out, but it might not be seen.

Maybe you can use a (small) iframe that refreshes itself every few minutes,
to keep the session alive but without submitting the entire page
(and losing scroll-position and focus).

Hans Kesting
Sorry I didn't get back sooner, but I was out for a while. I'm not
sure extending the timeout would work. If I set it to 30 minutes,
they'll probably go 31...and so on. I also wasn't sure that the
viewstate would be usable and last either. But, I did try the iframe
and so far it looks to do exactly as I needed. I also have been trying
it out and I don't look to lose focus from the control I'm currently
using when the iframe refreshes. Thanks for all the input!!

Kurt