locked
Capture Submit Events for Microsoft Form in a Blazor Application RRS feed

  • Question

  • I am using `Microsoft Forms` for survey purposes in my Blaozr Application which is created using ASP.NET Core 3.1.302. A screenshot regarding how the `Microsoft Form` is looking is attached below:

        @page "/questionarepoc"
        @using Microsoft.AspNetCore.Hosting
        @inject IWebHostEnvironment HostEnvironment
    
    
        <h3>Questionare POC</h3>
    
        @if (HostEnvironment.EnvironmentName=="Development")
        {
         <iframe width="640px" height="480px" src="https://forms.office.com/Pages/ResponsePage.aspx? 
         id=BiopSuv_ckSNqp3fkzLnW_NGlVhpUkdKjXPYvQce5XRUQzgwTExXOU0wMlFIT0hFWUpIS04zTlhRVi4u&embed=true" 
         frameborder="0" marginwidth="0" marginheight="0" style="border: none; max-width:100%; max- 
         height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe>
        }
    
        @code {
    
        }

    Basically I have just embedded the iframe into razor component which was generated when creating this Microsoft Form.

    What I want to do now, is that capture the submit event for this from but the event should be captured if the form is successfully submitted. So what is the best way of doing this?

    You can see the form below.Also I am pasting the iframe here so that it could become easy if anyone wants to contribute and help me sort out this issue.

    <iframe width="640px" height= "480px" src= "https://forms.office.com/Pages/ResponsePage.aspx?id=BiopSuv_ckSNqp3fkzLnW_NGlVhpUkdKjXPYvQce5XRUQzgwTExXOU0wMlFIT0hFWUpIS04zTlhRVi4u&embed=true" frameborder= "0" marginwidth= "0" marginheight= "0" style= "border: none; max-width:100%; max-height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe>


    The code which is used to show this `Form` in a razor component is mentioned below :

        @using Microsoft.AspNetCore.Hosting

        @inject IWebHostEnvironment HostEnvironment



        <h3>Questionare POC</h3>


        @if (HostEnvironment.EnvironmentName=="Development")

        {

         <iframe width="640px" height="480px" src="https://forms.office.com/Pages/ResponsePage.aspx? 

         id=BiopSuv_ckSNqp3fkzLnW_NGlVhpUkdKjXPYvQce5XRUQzgwTExXOU0wMlFIT0hFWUpIS04zTlhRVi4u&embed=true" 

         frameborder="0" marginwidth="0" marginheight="0" style="border: none; max-width:100%; max- 

         height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe>

        }


        @code {


        }

    The code which is used to show this `Form` in a razor component is mentioned below :

        @using Microsoft.AspNetCore.Hosting

        @inject IWebHostEnvironment HostEnvironment



        <h3>Questionare POC</h3>


        @if (HostEnvironment.EnvironmentName=="Development")

        {

         <iframe width="640px" height="480px" src="https://forms.office.com/Pages/ResponsePage.aspx? 

         id=BiopSuv_ckSNqp3fkzLnW_NGlVhpUkdKjXPYvQce5XRUQzgwTExXOU0wMlFIT0hFWUpIS04zTlhRVi4u&embed=true" 

         frameborder="0" marginwidth="0" marginheight="0" style="border: none; max-width:100%; max- 

         height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe>

        }


        @code {


        }

    Friday, August 28, 2020 9:16 AM