Block all user input on postback?

  • Thread starter Thread starter Steven Spits
  • Start date Start date
S

Steven Spits

Hi group,

We've developed a rather large ASP.NET WebApp with *A LOT* of input-fiels.
Many of these fields have AutoPostBack set to true.

I want to block all user input when the form is submitting on an
autopostback. We happens frequently is that the user is already typing the
next field when the forms comes back and shows an empty field again. This is
really frustating.

I tried several solutions, but none satisfies me completely. There's always
a "but"...

Anyone wants to share their way of working?

Steven Spits
Servico Computer Systems

- - -
 
Jon said:
Could you not "lock" all fields until the parent field is populated?

No, the fields don't have a parent/child relationship between them.

Steven

- --
 
Steven,

I solved this problem just the other day....
Spacer.gif is a 1x1 gif file which is transparent. 32x32Hourglass.gif
is a funky hourglass image I use to make it look friendly.

This works by intercepting the Postback and essentially dropping a
pane of glass on the page so you can see but not touch.

It's not 100% perfect, but it works. I've one issue with the glass div
size but as of now it ain't breaking anything...

NB - this only works for Severside Postback's...

Tig

=====================
Stylesheet Segment:
=====================

/* Use the Simon Coggins 'Negative Margin' trick to center the div to
the page (http://www.bluerobot.com/web/css/center2.html) */
..LoadingMessageDiv
{
border-right: silver 4px outset;
padding-right: 15px;
border-top: silver 4px outset;
margin-top: -20px;
padding-left: 15px;
font-weight: bold;
font-size: 8pt;
z-index: 1000;
filter: progid:DXImageTransform.Microsoft.Shadow(color= 'gray' ,
Direction=135, Strength=4);
left: 50%;
visibility: hidden;
padding-bottom: 15px;
margin-left: -200px;
vertical-align: baseline;
border-left: silver 4px outset;
width: 400px;
color: yellow;
padding-top: 15px;
border-bottom: silver 4px outset;
font-family: Verdana, Helvetica, sans-serif;
position: absolute;
top: 50%;
height: 40px;
background-color: royalblue;
text-align: center;
}

..GlassDiv
{
padding-right: 0px;
padding-left: 0px;
z-index: 1000;
left: 0px;
background-image: url(images/spacer.gif);
padding-bottom: 0px;
margin: 0px;
width: 0px;
cursor: wait;
padding-top: 0px;
background-repeat: repeat;
position: absolute;
top: 0px;
height: 0px;
}

=====================
Page segment:
=====================

<div id="AGlassDiv" class="GlassDiv">&nbsp;</div>
<div id="LoadingDiv" class="LoadingMessageDiv"><img id="HourglassImg"
align="absmiddle" src="images/32x32Hourglass.gif">&nbsp;&nbsp;Processing
Request. Please wait...</div>
<link href="portal.css" type="text/css" rel="stylesheet">
</HEAD>
<body leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0"
marginheight="0" marginwidth="0">
<script type="text/javascript">

var __DotNet__doPostBack
function window.onload()
{
var i = document.getElementById('LoadingDiv');
i.style.visibility='hidden';
i = document.getElementById('AGlassDiv');
i.style.visibility='hidden';
__DotNet__doPostBack = __doPostBack;
__doPostBack = __Fudge__doPostBack;
}
function __Fudge__doPostBack(Param1, Param2)
{
var i = document.getElementById('LoadingDiv');
i.style.visibility='visible';
i = document.getElementById('AGlassDiv');
i.style.visibility='visible';
i.style.zIndex=1000;
i.style.width = screen.width;
i.style.height = screen.height;
__DotNet__doPostBack(Param1, Param2);
}
 
Tig said:
I solved this problem just the other day....
Spacer.gif is a 1x1 gif file which is transparent. 32x32Hourglass.gif
is a funky hourglass image I use to make it look friendly.

<snip>

This is exactly what I was looking for!

I have a similar solution, but I never found out how to extend the
_doPostBack function since it doesn't fire an onSubmit event. Never thought
of replacing it and call it in the new function. Clean & secure solution,
just what I need!

Thank you very much! Don't ya just love usenet?

Steven

- - -
 
Back
Top