473,581 Members | 6,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ClientSide Validation (solution to bypass "Refresh" in JavaScript)

Hello,

Currently I am using a large input form on a website that is based on
ASP and JavaScript.

Depending on the values that are filled in by the user the forms does a
refresh and makes other input fields available to fill in. I use the
JavaScript OnChange function (=clientside) that creates a querystring
and does a refresh of the page. It works fine.

Some of the users are complaining that on slow connections this refresh
can take very long and other users find this refresh in general not a
friendly solution. And... I agree with them.

Now I am trying to migrate this website to ASP.NET and was looking for
a solution to do what I want to do: Make form fields available/visable
in the same form based on the values filled in in other fields of the
same form without the refresh.

This is want I have found:
http://www.dotnetjunkies.com/quickst...validator2.src

But is this the way to do it? Can it also be ServerSide? I am sure that
I am not the only person in the world trying to do this. Thanks for
your advice. Please note that I am a beginner in ASP.NET.

I can not post the form because it an secured extranet page.

Thanks!

Nov 19 '05 #1
1 3248
When working with an ASP.NET web form, expect that when you submit, it will
post back to the same page. Your page will be structured with some code to
handle various "events". The two most common are:
- Page_Load. This method is used to setup general values on the page. It is
called every time the page is generated. For example, if you fill in a
DropDownList from a database, do it here when the page is first loaded (the
property Page.IsPostBack is false).
- "Post back event handlers" - These are methods you link to buttons and
other controls that submit the page. They fire only on post back after
Page_Load. You put your code that processes the post back. For example, in
the Button, set the Click event to your method. Then use your Click method
to save the page.
Inside the post back event handlers is where Validation goes. First, you add
the various web controls called "Validators " supplied with ASP.NET to the
web form. Attach them to the fields they evaluate. By design, they will
first attempt to validate on the client-side. But not all browsers are
supported or javascript can be disabled. So eventually the page is posted
back and you should assume the page is still not validated. So you test
Page.IsValid is true in that Click post back event method before saving. If
you find it to be false, just exit the Click event method and the same page
will be redraw, but this time, each validator with an error will be
displayed.

I encourage you to read this article: www.aspalliance.com/699 as you learn
about ASP.NET validators.
You should also consider a better validation system since Microsoft's is
very limited and causes you to write much custom code and develop hacks. I
make one called Professional Validation And More
(http://www.peterblum.com/vam/home.aspx).

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"IkBenHet" <ik********@hot mail.com> wrote in message
news:11******** ************@g1 4g2000cwa.googl egroups.com...
Hello,

Currently I am using a large input form on a website that is based on
ASP and JavaScript.

Depending on the values that are filled in by the user the forms does a
refresh and makes other input fields available to fill in. I use the
JavaScript OnChange function (=clientside) that creates a querystring
and does a refresh of the page. It works fine.

Some of the users are complaining that on slow connections this refresh
can take very long and other users find this refresh in general not a
friendly solution. And... I agree with them.

Now I am trying to migrate this website to ASP.NET and was looking for
a solution to do what I want to do: Make form fields available/visable
in the same form based on the values filled in in other fields of the
same form without the refresh.

This is want I have found:
http://www.dotnetjunkies.com/quickst...validator2.src

But is this the way to do it? Can it also be ServerSide? I am sure that
I am not the only person in the world trying to do this. Thanks for
your advice. Please note that I am a beginner in ASP.NET.

I can not post the form because it an secured extranet page.

Thanks!

Nov 19 '05 #2

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

Similar topics

3
4344
by: Marcia Gulesian | last post by:
Is there a way to replace the URL value below, on the fly? <META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">
10
7838
by: Udi Zisser | last post by:
Hello, any idea why this does not work? or how do i get this thing to work? <BASE HREF="http://localhost/thedude/"> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=redirect.html"> I'm adding the <base> tag to the content of an existing html that contains a redirect meta tag.
2
2319
by: John Baker | last post by:
Hi: I have a Pop Up form that involves a main form and sub form. The sub form has the results of a query on the main form. I need to automatically perform exactly he same action that takes place when I manually click "Records/refresh" when I update a field on the main form, but am having trouble making that happen. Me.Refresh does not do...
1
4410
by: David | last post by:
how can I force the "document.execCommand("Refresh");" command to refresh page only one time?
3
2270
by: George Durzi | last post by:
I'm using the following tag to refresh my page every 3 minutes. <meta http-equiv="refresh" content="180; URL=default.aspx"> However, it's bound to happen that a user is working on the page, and it refreshes, so they lose their work. Is there any way to reset the timer when a key is pressed? Thanks
5
2285
by: chortler | last post by:
When I use the meta tag to refreh my asp webpage, it doesn't change Ispostback to false; It always equals true? Any ideas??
4
1287
by: Oren | last post by:
Hi, this is my second try to explain: I need to know how much time has left from this meta: <meta id="ref" http-equiv="refresh" content="300;url="/> I mean: -------- when the page has loaded I have 5 minutes to wait until the page will refresh by himself. Meanwhile I need to know the countdown to 300...
0
3518
by: sagarp86 | last post by:
How to lock / deactivate "Refresh" and "Back" button on browser. Problem is in voting application. Once we click for a vote application goes to next page and increament one vote in the database. But when we click on "Refresh" button on the browser, the query is fired again and again one vote is added un-necessarily..Only one vote should be...
4
2540
by: Simon | last post by:
Dear reader, If I change the content of a field in an event procedure and in the same procedure I do a refresh, the refresh has no effect. The code in the event is as follows:
0
7854
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7783
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8134
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8296
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8157
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3794
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3807
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1394
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.