I have a user control on a ASP.NET page. Inside the user control there is a update panel. The page is a little lengthy and has Validation Summary control at the top.
The Submit button is at the bottom of the page. When I click the submit and when client side validation fails (on requiredfieldvalidators), the page DOES NOT move to the top where the Validation Summary control shows the messages. It just moves till the user control which is in the middle of the page.
I tried settings MaintainScrollPositionOnPostback="true" on the aspx page, but that didn't work.
How can I make it so when client-side validation fails, it moves to the top of the page?
Thanks
If the validation fails try to focus a control that is near the validation summary, maybe that work. ie. txtName.Focus(). If the validation is happening in the client side, try to do some js to detect when the summary appears....
Related
I have created a visual webpart which means it has not form / body element in it. I have three submit buttons on the webpart. At one time, only one of there three button is visible. These button performs validation on multiple controls that are added on the webpart and then call server side methods.
Issue is that it takes time for webpart to submit and during this user can press submit button more than once which result is malfunction of the application.
I have tried jQuery solutions like adding disable attribute to submit button but it stops webpart from submitting as well.
Any help to stop multiple submit.
You can consider using Ajax for posting your form.
And, until some processing is going on server, disable UI & show a Loading Image.
Refer:
jQuery.ajax()
UpdatePanel Control Overview
UpdateProgress Control Overview
I have an ASP.NET web application that is using RegularExpressionValidator controls inside of a user control. The user control is placed inside of a panel with an ajax:modal popup. When I click the link, it will open the popup displaying the user control.
What is happening is when I click the link to open the popup, it is throwing a postback and activating the validators before the user has any opportunity to type anything into the boxes. I need to be able to click the link, open the popup, fill out the text boxes, and submit. The validators should only run when the submit button is clicked. Any ideas?
setting the validators parameters on the load in the code behind of the popupbox might fix your problem
I am using asp.net ValidationSummary. my form is 1.5 of the screen which means user can not see the complete form at a time and s/he has to scroll. The ValidationSummary is located at the bottom of the page. User is at the top of the page and error occurs then s/he won't be able to see the ValidationSummary because neither this control gets focus nor it makes the browser scroll down to show itself. The case is same if user is at the bottom of the page and ValidationSummary is at the top.
Please suggest how to show this ValidationSummary automatically ?
I find the validation summary isn't the most user friendly for long forms especially when scrolling appears.
Why not remove the validation summary and highlight the fields with the errors with a validation errror message beside the control and a visual idicator beside the submit button? This appraoch would be a lot mroe user friendly
Why don't you move the ValidationSummary to the top then?
Or just style the ValidationSummary.
This is a UI problem, not a technical one.
I have a couple of pages with standard asp.net validation controls such as RequiredFieldValidator etc inside my RadAjaxPanel.
As soon as I navigate to another tab in my RadTabStrip the page seems to force validation errors and pretty much "locks" the page even though non of the fields was selected to enter data.
Only once all the required fields was entered the page seems to release the "lock" and only then am I able to navigate to another tab / page without even submitting the page.
Any idea what might be causing the "lock" and forced validation errors on the page?
Thanks
The RequiredFieldValidators are failing as the fields are empty. These validators are fired client side and so they're stopping the postback (which will change your tab) from occurring.
I'm not sure how the tabbing works on a RadTabStrip, but for normal ASP Buttons there's a "CausesValidation" property on the button. If you set it to false, it'll stop any validators from being fired when pressed.
I need to fire certain server side validation for a page when the user is trying move from that page to another..
Even though he is not clicking on any buttons these server side validations have to be fired when he is moving out of this page..
Could you please help me how to handle this.. Required field validations will not happen as the user is entering the page and leaving the page without doing any action in the page..
So you mean he's just changing the URL in the address bar? Or is he clicking something? If it's via clicking anything; you can just make whatever that thing is part of the appropriate validation group, and it will validate.
If he's just changing the URL, then you're going to need to detect leaving of the page (in JavaScript), and do some work. But depending on your scenario, I wouldn't recommend that.