Eliminate postback flicker WITHOUT smartnav

  • Thread starter Thread starter ujjc001
  • Start date Start date
U

ujjc001

Can it be done? I'd go to almost any length to implement a solution.
I've tried <meta http-equiv="Page-Enter"
content="blendTrans(Duration=0.01)"> to no avail.

Thanks!

Jeff C.
 
I don't know of any other solution other then smart navigation.

The only other way is to eliminate postbacks altogether. Meaning, that
clicking a button needs to result in client side javascript code, that uses
XMLHTTP or the equivalent to post to some page behind the scenes passing it
information. This will result in no flickering, but of course is a
significant rewrite and doesn't really follow the ASP.NET server side object
model.
 
Jeff,
I concur with the previous response, but wanted to add that there is a
non-smart navigation solution for scroll positioning, perhaps there's
more to there approach:

http://aspnet.4guysfromrolla.com/articles/111704-1.aspx

Also, I use SmartNavigation, and have managed to work around some of
the quirks that are frequently mentioned. The main issue I had was
combining autopostback and smartnav caused some interesting tab
position results. I was able to fix them. Maybe you could post what you
are trying to accomplish, and maybe there's a smart-nav way of doing
it.

Just my two cents.
Jason
 
I dont have any solution/advice I'm afraid, as I'm new to .Net, just
interested to hear why the flicker is such an issue? (Perhaps to avoid
something I might encounter in the future!)
 
The system I am working on developing will be a main application used
in a call center environment. Having to look at this flicker so much
would drive our employees nuts! :o)
I use code for setting my scroll position and for focusing. My main
problems with smartnav were the inability to setfocus, however, now
that you mention it, one problem I was able to overcome was setting the
scroll position w/out smartnav, in the process of that I changed my
setfocus code to have a slight delay. I bet that would work w/smart
nav. That would be nice.
Here's my setfocus code
'---------------------Begin SetFocus-----------------
Public Shared Sub SetFocus(ByVal strControl As String, ByVal frm As
Page)
frm.RegisterStartupScript("focus", "<script
language=""JavaScript"">" & vbCrLf & vbTab &
"window.setTimeout(""document.getElementById('" & strControl &
"').focus()"",10);" & vbCrLf & "<" & "/script>") '
document.getElementById('" & strControl & "')
End Sub
'--------------------End SetFocus-------------------

I'm going to have to try that now. Boy, I'd have to kick myself if it
works.
I'll post again when I find out. Thanks for the help.
Jeff
 
I love how fast google posts replies now, even though I don't like the
format as much. Anyhow, my code for focus still does not work. I need
to have the user be focused on one textbox after info is added into the
first. I just end up staying in the first. Can I see your setfocus
code by change? Perhaps it will help.
Thanks.
 
Woo Hoo! I just changed my timeout from 10 milseconds to 50. It
works! (still interested in your examples thought, thanks)
Jeff
 
Jeff,
Here's what I've got:

The code looks more convoluted now then when I worte it, but I seem to
remember spending some time on this. So all of this must be for good
reason. If you are able to trim it up, write back. :)

Jason

Private Sub fixFocus(ByVal controlToFocus As WebControl, ByVal
firstControl As WebControl)
'due to autopostback and smartnavigation being turned on,
we must run through this
' to fix the focus when we return.
Dim focusScript As String = "if (var1 == 1){var1 = 0;
document.getElementById('" + controlToFocus.ClientID + "').focus()};"
firstControl.Attributes.Add("onfocus", focusScript)
RegisterStartupScript("focusstartup", "<script
language=Javascript>var1=1;</script>")

End Sub
 
Back
Top