Click here to Skip to main content
13,596,673 members
Rate this:
Please Sign up or sign in to vote.
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
            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
                       Exit Function
                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 18-Apr-17 5:05am
Updated 19-Apr-17 4:08am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.180621.3 | Last Updated 19 Apr 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100