Sign In  Sign Up Live-Chat

Clear the data inside the infopath form?

Last post 06-23-2009, 3:25 PM by muhammad.ijaz. 1 replies.
Sort Posts: Previous Next
  •  06-22-2009, 9:08 AM 184876

    Clear the data inside the infopath form?

    I am using infopath form inside asp.net page, I wonder how can I clear all the data inside the infopath form? The situation is : when I return to the previous infopath form page,  all the previous data remain.

    Thanks.
     
  •  06-23-2009, 3:25 PM 185166 in reply to 184876

    Re: Clear the data inside the infopath form?

    Dear Jack,

    You can store the XmlDataString of empty form in a global string variable using the code

    protected void Page_Load(object sender, EventArgs e)

    {

        if (!Page.IsPostBack)

        {

            FormControl.XsnLocation = Server.MapPath("Test.xsn");

            emptyFormString = FormControl.XmlDataString;

        }

    }

    and then you can assign this string variable to XmlDataString property where you want to clear the form as you can see in the below code.

    FormControl.XmlDataString = emptyFormString;

    Please feel free to contact us in case you have further comments or questions.

    Best Regards,


    Muhammad Ijaz
    Support Developer,
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher
     
View as RSS news feed in XML