473,387 Members | 1,481 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,387 software developers and data experts.

client side validation on click of wizard naviagtion buttons

AnuSumesh
Hi,

I am using asp:wizard control in my application to collect data from user.
I want to validate the input data on click of each next button.
I want to use clientside script to avoid the wastage of time (taken in posting data to and from server).

But i am unable to find the control in c# code file.
My code is:
Expand|Select|Wrap|Line Numbers
  1. <StepNavigationTemplate>
  2.    <asp:Button ID="startnext" runat="server" 
  3.               BackColor="White" BorderColor="#507CD1"
  4.               CommandName="MoveNext" CssClass="ButtonOK" 
  5.               Font-Names="Verdana" ForeColor="#284E98"
  6.               Text="Next" />
  7. </StepNavigationTemplate>
  8.  
When i m trying to access "startnext" from my c# code, its not showing anything.

I can add OnClientClick event to the button but then how will i access activeindex for the wizard step in javascript code?

Please help me.
I am using this control first time
I want to use client side validation for each step.
Please suggest me some other alternative for the same.

Thanks in advance.
Regards,
Anu
Jun 12 '09 #1
5 9529
Frinavale
9,735 Expert Mod 8TB
Have you tried using an ASP.NET Validator Control?

After finding an advanced walk-through article on the Wizard Web Server Control I followed a link to a walk-through that explains how to add validation to the page...it became clear to me that each step of the wizard control simply has input controls (like TextBoxes) that require validation....it's easy to link a validator to these controls.
Jun 16 '09 #2
Hi,
Thanks for reply, but ASP.Net validator control are server side validation, not for client side validation.

Anyways , my problem is solved to some extent by using user defined <asp:button> in wizard control.

Is there any way to access the activestepindex property of wizard in javascript so that acc. to the current step i can validate the fields on client side?

Thanks in advance.
Anu
Jun 27 '09 #3
Ajax UpdatePanel...is the key..
Jun 27 '09 #4
Frinavale
9,735 Expert Mod 8TB
@AnuSumesh
ASP.NET Validator controls are Server Controls that have JavaScript client components that validate the data before the content is submitted to the server. I'm glad that you've solved your problem but you should probably give them another look because they could be very useful to you in the future.

@AnuSumesh
The ActiveStepIndex is managed by the server code...I doubt that you can control it using JavaScript.

You should Always validate on the server. Client side validation is nice because it can prevent round trips that aren't necessary; however, client side validation is easy to get around. The whole point of doing data validation is to ensure that a malicious user doesn't damage your site.

-Frinny
Jun 29 '09 #5
Try passing the activestepindex into a hidden field and access it in client side.
P.S: Probably it is too late :) You may have figured out something.
Aug 19 '16 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stephen | last post by:
Hey Everyone, I have a problem with a web application due to the use of both client-side and server side script on the on-click event of a button. The client side script runs first as expected...
1
by: Stephen | last post by:
Hey Everyone, I have a problem with a web application due to the use of both client-side and server side script on the on-click event of a button. The client side script runs first as expected...
1
by: Stephen | last post by:
Hey All, I have a problem with a web application due to the use of both client-side and server side script on the on-click event of a button. The client side script runs first as expected however...
4
by: RA | last post by:
Hi How do I disable it if the user pressed a button: asp:imagebutton id="btnHome" onclick="test()" runat="server" What I want to have is that if someone presses this button then the required...
1
by: XtremeGod | last post by:
Hi All, We have an ASP.NET web app that makes use of client side validation. It has a simple form on it with two buttons. One a clear button the other a submit button. When WebUIValidation.js...
9
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see)...
2
by: Fourge | last post by:
Hi, I have run into a very strange scenario. In developing an ASP.NET application on framework version 1.1, I found that certain client-side validation scripts were not being rendered. The...
1
by: rmgalante | last post by:
I have written an ASP.Net application that uses the standard client-side and server-side validation for various fields on the form. Some of the customers that use the form report symptoms that...
0
by: Anthony W DiGrigoli | last post by:
I have two ASP.NET Server Side buttons that perform action on both the Server and Client side. Here is the break down of code placement: 1. Server-Side Load: Contains an Add Attribute 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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.