Infopath validation using XMLformview control - InfoPath Dev
in

InfoPath Dev

Infopath validation using XMLformview control

Last post 01-07-2008 09:17 AM by davidair. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-04-2008 04:58 AM

    Infopath validation using XMLformview control

    Hi

    I am new to infopath. I have created a simple template using infopath 2007 and integrated it with web form (aspx page) using XMLformview control. While creating the template i have added the validations and the validation messages to few controls (like numeric for age, and telephone) etc. My problem is when i embed this template in the web page using xmlformview, when the aspx page is submitted i need to display the validation error messages on aspx page. So could you please help me out how to bubble the validation messages from infopath to aspx page using xmlform view control.

     Thanks

    Sachin
  • 01-07-2008 07:46 AM In reply to

    Re: Infopath validation using XMLformview control

    Hi Sachin and welcome to the forums!

    I don't have a whole lot of experience making browser-enabled forms, but I believe this is one of the things that you lose when you choose to make your form browser-enabled.  I looked through the documentation for XmlFormView and didn't see anything obvious. 

    Sorry, and please let us know if you figure something out!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-07-2008 09:17 AM In reply to

    Re: Infopath validation using XMLformview control

    Hey sachin,

    you can achieve what you are trying to do by inspecting the errors collection of the XmlForm object. For example, if your control is called XmlFormView1, you can do the following in your code-behind:

    this.XmlFormView1.DataBind(); // or else XmlForm will be null
    XmlForm xmlForm = this.XmlFormView1.XmlForm;

    And then you can party on xmlForm all you want.

    However there is one problem: you can only do this when the form posts back to the server. You can either achieve it by having a button doing a postback (saying "display errors") or by setting all the controls to always send data to server when modified. The later is not advised because of bad performance and user experience.

    Hope that helps,

    David.

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.