.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

1 page, 2 validationgroups and 2 validation summary issues

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net

Hi all,

I have one page, on which I have a part with controls and one validationgroup, with the respective validation summary.

I have another part on the same page with another validation group, and another validation summary.

The thing is that, when I press btnGo or btnGo2, both validationsummaries trigger, and both show all validation messages. For other words, it seems that the validationgroups are not working.

My html:

<!--Group 1-->
<tr style="padding-top:3px;">
    <td class="mgmCell">
    <td style="padding-left:5px;">
        <asp:TextBox ID="txtName" runat="server" ValidationGroup="Group1"/>
        <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="Name" Text="*" ValidationGroup="Group1" ControlToValidate="txtName" />
    <td colspan="2">
        <asp:Button ID="btnGo" runat="server" Text="Go" ValidationGroup="Group1" OnClick="ClickEvent" />
        <asp:ValidationSummary ID="vs1" runat="server" ShowSummary="fal

View Complete Post

More Related Resource Links

Validation summary not showing in master page

Hi, I am using User controls in my web page. I have validation controls in my user control and the validation summary control is placed in the master page. Problem is I am not getting the errors displayed when I am running my application. Any help is appreciated.   Thanks.

Multiple forms on the same page MVC2: how to handle (including validation from model)



It should be simple; although I'm having a hard time to figure out the best way to do it. I've MVC2 pages with multiple forms on the same page having different functionalities.

What's the best way to handle this; including the MVC2 way of validation from the model?


Validation Summary in MVC

Like Validation Summary in popup in Asp.Net , i  need in MVC. I searched some url i got some idea about validation summary. but i don't know how to display validation messsages in popup window. How to show alert message box in Asp.net  MVC applications on button submit?

How to hide the summary page of Web Services?

Hi there, a while ago I came across a way to hide the summary page of Web Services. I think it's an attribute that I can set for the entire web service interface, but I couldn't find it anymore. Does anyone know how it's done? For example, if I implemented a web service interface at using foobar.asmx, if I access foobar.asmx directly, I will see a summary page that tells me about all the webmethods available, etc. How do I prevent that page from being displayed? Thanks,- K. 

Adding ListViewWebPart to a page - how do you set its view to

If you add a ListViewWebPart to a wiki/web part page (such as the Links list), it will default to the <summary View>.  If you add it using code, it will default to the default view.  How can I set it to use the <Summary View>? I tried setting node.Attributes["BaseViewID"].Value = "0" in the web part view xml, but that didn't do anything. Any thoughts? ListViewWebPart wpLinks = new ListViewWebPart(); SPList listLinks = site.Lists["Links"]; wpLinks.ListName = listLinks.ID.ToString("B").ToUpper(); wpLinks.ViewGuid = listLinks.DefaultView.ID.ToString("B").ToUpper(); AddToolBar(wpLinks, "Add new link"); private void AddToolBar(System.Web.UI.WebControls.WebParts.WebPart wp, string label) { // Get the view used in the web part by using reflection PropertyInfo viewProp = wp.GetType().GetProperty("View", BindingFlags.NonPublic | BindingFlags.Instance); SPView webPartView = viewProp.GetValue(wp, null) as SPView; // This is necessary after the infrastructure update, without it you can't get to the XML of the view webPartView.GetType().InvokeMember("EnsureFullBlownXmlDocument", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, webPartView, null, System.Globalization.CultureInfo.Current

Page Validation

I'm using the validation to validate textboxes. I have a Cancel button. I would like to be able to cancel the page if the user wish, but something has to be in the textbox for it to work. How can I get around that problem. If the user opens the page then wish to cancel it before entering any data??? 

Page.IsValid cannot be called before validation has taken place

This is my first asp.net application and it looks like I am in a rock and a hard place.  I have a multi page formview and I want to allow the user to page back with causing validation, but if I don't cause validation on the page back button, I get an error  Page.IsValid cannot be called before validation has taken place. It should be queried in the event handler for a control that has CausesValidation=True and initiated the postback, or after a call to Page.Validate.Source Error:  Line 41: Line 42:     Protected Sub FormView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs) Handles FormView1.PageIndexChangingLine 43:         FormView1.UpdateItem(True)Line 44:         If FormView1.PageIndex < 1 ThenLine 45:             FormView1.FindControl("ImpactsTextBox").Focus() Line 43 in the vb file allows me to update an item.   How do I get around this problem?  Is this where I need a "if not postback"?  Any examples would be appreciated.  

validation control increase page size

Hi all,In my web page I have lot of validation controls. These controls emit some script block to the page, that increase my page size Is there any way to put that script in to separate js fileneed client validation also.

ASP.Net Page Validation and Window Unload

I am getting some weird issue on my asp.net page.Here is the scenario:I have a asp.net page with a textbox (ctrl#1) and a dropdown control (ctrl#2). Each control have their CausesValidation and AutoPostBack set to true. I have another dropdown control (ctrl#3) on the same page which allows the user to navigate to some other page. I have added an alert message for the user (on window.onbeforeunload event) to warn the user of any unsaved changes on the page. User can choose to stay on the current page by clicking Cancel.So far so good... All works fine when the data is changed on the page  and user tries to navigate away from the current page using the above dropdown control (ctrl#3). The window.onbeforeunload fires and user gets the alert message. Happy user.Now comes the issue....When there is any invalid data on the page and the asp.net validation has fired, now, when the user tries to navigate away from the current page, he does not get any alert. It seems as if the window.onbeforeunload does not fire in this case when there is invalid data on page. I am not sure why this is happening!Can someone please share some thoughts and/or suggest a solution please?

Survey summary and redirection to diffrent page

Hi I'm using standard survey list to gather some opinion around diffrent stuff from the users. Few days ago someone from the bussiness came to me and ask if this is possible to redirect user to some page once he submit his vote, so he will not be redirected to default "overview" page. I was trying to use "?Source={URL}" parameter to achive that but this seems to not work. Does anyone has some idea how to overcome this ? thanks in advance Mariusz Gorzoch Blog : http://mariusz.gorzoch.pl Twitter : http://twitter.com/MariuszGorzoch Facebook: http://www.facebook.com/mariusz.gorzoch

Adding New Error Message to Validation Summary Control



 In the code behind based on a condition i want to add a error message to the Validation Control.

 I tried the below.

 'Call function to add error message.
protected void AddErrorToValidationSummary(string errorMessage)
 CustomValidator custVal = new CustomValidator();   
 custVal.IsValid = false;   
 custVal.ErrorMessage = errorMessage;  
 custVal.EnableClientScript = false;   
 custVal.Display = ValidatorDisplay.None;        



Validation Summary with regular Expression validator


I have a page that im using Validation Summary on. I have 5 out of 8 fields that im validating. All 5 have required validators and 1 of the 5 also has regularexpressionvalidator with it.

When the page load and i click the submit, all the fields show my red * next to them and the individual messages down in the summary. Thats find, but im having issues with checking the field with the regex validation when you submit the form again. At the moment, i had added a if condition on the button event and it is preventing the form from submitting and the field is showing the red * next to it, but my message from the regex validator does not display in the summary. Actually the summary doesnt even show up. The regex validator works when you tab out of the field by placing the red *, but the actual error message doesnt display in the summary, so you wouldnt know why there is an issue.


I have the following as a test, def isnt correct, but was trying to show the summary with the value from my regex validator:

        protected void btnInfo_Click(object sender, EventArgs e)
            if (!Page.IsValid)
                vsSumm.ShowSummary = true;

SharePoint 201 VS 2010 WF: PersistenceException: The security validation for this page is invalid


Setup: Visual studio 2010 SharePoint 2010 Workflow with custom infopath task edit form, with file attachment control. If I attach a file to the infopath task edit form, I got the following error message, though the attachment is saved, but the next task is not created and the current task is not marked as completed either.

09/27/2010 15:34:31.18     w3wp.exe (0x2B88)                           0x2844    SharePoint Foundation             Workflow Infrastructure           88xr    Unexpected    WinWF Internal Error, terminating workflow Id# 04621f32-17d4-439a-883a-7566b96481bb     
09/27/2010 15:34:31.18     w3wp.exe (0x2B88)                           0x2844    SharePoint Foundation             Workflow Infrastructure           98d4    Unexpected    System.Workflow.Runtime.Hosting.Pers

Page render issues everywhere


Sites appear to have no theme/master page applied at all when viewed on client PCs.  When viewed on the server, IE throws "Object expected" script errors on nearly every page, usually referring to an .aspx file.  This applies to Central Admin pages as well.

Central Admin renders fine on client PC's, but it actually occasionally loses its theme as well.  Even if it does render properly, some pages (so far just the Create Site Collection page, but I haven't browsed through all admin pages yet) throws a similar script error for an .aspx file.

I'm not sure where to begin!  Any guidance would be appreciated.

(P.S. Please don't forget to mark this post as an answer if it has helped you)
Eric Legault: MVP (Outlook), MCTS (SharePoint)
Owner: Collaborative Innovations
Twitter: elegault
Blog: Eric Legault My Eggo

Problem with Jquery windows modal + Validation Summary


Hi all, 

I have a jquery windows modal with some textboxes and a OK button, i have placed some field validators to 
respective textboxes with ValidationGroup. 

When the windows modal opens, the required field validator are  working when clicking on 

OK button but i cannot to visualize the error summary. 

how can i do to visualize the summary? 

thx in advance!

jquery validation in ascx page


Following on from my post about using ascx pages for the content of the jquery tab panels.


Can I use jquery validation on each ascx page before submitting to move to the next tab panel?

I've been trying the following way, but when I click the submit button I get the error 'Object doesn't support this property or method'.


<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    <div id="tabs">
            <li><a href="#tab1">Your Details</a></li>
            <li><a href="#tab2">Course Details</a></li>
            <li><a href="#tab3">Education & Employment</a></li>
            <li><a href="#tab4">References</a></li>
            <li><a href="#tab5">Submit Application</a></li>
        <div id="tab1">
            <asp:PlaceHolder ID="plhApp" runat="server"></asp:PlaceHolder>

How do I adjust the # of posts visible on the main page of a blog? Summary view?


So while I love the basic summary view used by the blog, I would like to limit the main page to showing just the 5 most recent updates.  Most views this is easy to edit by adjusting the item limit on the list, but since the Summary view of the posts list doesn't show up anywhere I am unsure where I can set the limit.

I have looked at the editable views in designer but again I do not see the Summary view listed anywnere.  Help

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend