473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Block all user input on postback?

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

- - -
Nov 18 '05 #1
3 2678
"Jon" wrote:
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

- --
Nov 18 '05 #2
Tig
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);
}

"Steven Spits" <st**********@servico.be.net> wrote in message news:<Oy**************@TK2MSFTNGP10.phx.gbl>...
"Jon" wrote:
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

- --

Nov 18 '05 #3
"Tig" wrote:
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

- - -
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
3
by: E | last post by:
I have 2 aspx pages... neither of which do anything out of the ordinary. One of the pages automatically generates this block of code when viewed at the client:...
0
by: sonic_soul | last post by:
basically im using a usercontrol to load other user controls, but cannot read their user input on postback. im using this LoadControls user control in order to load 4 different controls onto my...
3
by: Cathie | last post by:
Hi All, I have a few user controls on a page and I need to determine which control caused the PostBack. Is there anyway to do this? Thanks in advance, Cathie
7
by: moondaddy | last post by:
I have a user control being used instead of a frame page. when the user clicks on a menu item I need to send the ID (integer value) of that menu as a parameter in the postback of the user control...
2
by: Vishwanathan Raman | last post by:
I have two user controls Control1 and Control2 (.ascx) dependent on each others input. When the Web Page containing this control gets posted back I have some logic to determine a value in...
1
by: panche | last post by:
I'm developing a fairly simple user control that has two textboxes for date/time entry (a from date/time and a to date/time). One of my requirements is that there should be no button that sets...
10
by: sqlboy2000 | last post by:
Hello all, I have something very simple going on here and I'm scratching my head as to what the problem is. There are 4 items in my project, 2 webforms, a user control, and a module: ...
4
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.