Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
I have a problem and it will be nice if someone can help me.

I want from my controller open a poup-up that contains data and ask a question to the user.
According to his answer, I continue or stop treatment.

Function Traitement(model As TraitementViewModel, confirm_value As String) As ActionResult
        Try
            If (ModelState.IsValid) Then
                Dim exception As Exception = Nothing
                Dim mois As Integer = Mid(model.dateTraitement, 4, 2)
                Dim annee As Integer = Right(model.dateTraitement, 4)
                Session("mois") = mois
                Session("annee") = annee
                Dim extract As Extraction = New Extraction()
              
                Dim result As Integer = extract.Recherche(mois, annee).Rows.Count()
                If (result <> 0) Then
                    OPEN POPUP

                       Artciles    Montant
                            1	    100
                            2	    200

                       Do you want continue

                             YES  NO



                      IF(confirm_value = "yes") Then
                       continue...
                      Else
                       Exit Function
                Else
                    continue...
                End If

              
            End If
        
    End Function


Can you help me.
It's very urgent
Thank you very much.

What I have tried:

[Duplicate text removed]
Posted
Updated 19-Apr-17 4:08am
v2

1 solution

You can't. The controller cannot push content to the client, including a dialog. The controller can only respond with data to a client-side request.

You can have a controller action that is called by client-side code and responds with a message that tells the client-side code to display a confirmation dialog and to show the data it returns.
 
Share this answer
 
Comments
Member 11871625 19-Apr-17 18:16pm    
thank you for your reply.
Can you explain with a sample code.
thank you.
Dave Kreskowiak 19-Apr-17 18:23pm    
Nope. You need to learn javascript, jQuery, and how AJAX works. There's plenty of examples and tutorials all over the web.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900