Click here to Skip to main content
15,945,112 members
Home / Discussions / Web Development
   

Web Development

 
QuestionFullscreen scrolling image and adding more images Pin
Member 157264913-Aug-22 6:33
Member 157264913-Aug-22 6:33 
QuestionHow to get saved data from option select in PHP? Pin
imbruceter1-Aug-22 0:36
imbruceter1-Aug-22 0:36 
AnswerRe: How to get saved data from option select in PHP? Pin
Richard MacCutchan1-Aug-22 1:03
mveRichard MacCutchan1-Aug-22 1:03 
GeneralRe: How to get saved data from option select in PHP? Pin
imbruceter1-Aug-22 1:27
imbruceter1-Aug-22 1:27 
GeneralRe: How to get saved data from option select in PHP? Pin
Richard MacCutchan1-Aug-22 1:29
mveRichard MacCutchan1-Aug-22 1:29 
GeneralRe: How to get saved data from option select in PHP? Pin
imbruceter1-Aug-22 1:37
imbruceter1-Aug-22 1:37 
AnswerRe: How to get saved data from option select in PHP? Pin
Sandrahdes1-Sep-22 21:06
Sandrahdes1-Sep-22 21:06 
QuestionASP.Net MVC : Send an array in POST Pin
hageshii26-Jul-22 3:39
hageshii26-Jul-22 3:39 
hello,

On my site in ASP.Net MVC, I try to send the contents of an array in a function using a POST but nothing happens and I don't understand why.

My class :

C#
public class AdresseIP
{
    public int? Idclient { get; set; }
    public int? ip1 { get; set; }
    public int? ip2 { get; set; }
    public int? ip3 { get; set; }
    public int? ip4 { get; set; }
    public int? idplan { get; set; }
}


My function (empty for the moment):

C#
[HttpPost]
    public ActionResult MAJIP(IEnumerable<AdresseIP> lst)

    {


        return View(1);
    }



The method I use to send the array from my page:

JavaScript
function Valider(tableID) {
    console.log("test " + tableID);
    var IPs = new Array();
    $("#" + tableID + " TBODY TR").each(function () {
        var row = $(this);
        var IP = {};
        IP.Idclient = row.find("TD").eq(0).text();
        IP.idplan = row.find("TD").eq(1).text();
        IP.ip1 = row.find("TD").eq(2).text();
        IP.ip2 = row.find("TD").eq(3).text();
        IP.ip3 = row.find("TD").eq(4).text();
        IP.ip4 = row.find("TD").eq(5).text();
        IPs.push(IP);

    });


console.log(JSON.parse(JSON.stringify(IPs)));
        IPs2 = JSON.parse(JSON.stringify(IPs));
        console.log(IPs2);


        $.ajax({
            type: "POST",
            url: "/IP/MAJIP/",
            data: IPs2,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (r) {
                alert(r);
                if (r == 1) {
                    console.log('test1 ' + r)
                } else {
                    console.log('test2 ' + r);
                }

            }
        });
}


The console.log(IPs); displays the contents of the array correctly.

There may be better methods, but I don't know of any.

When I validate, my function receives a Null. Yet all my console.log(IPs); return the expected value.

So here I don't know.

Any idea please?
QuestionSelf Signed Cert Questions Pin
Kevin Marois23-Jul-22 19:03
professionalKevin Marois23-Jul-22 19:03 
AnswerRe: Self Signed Cert Questions Pin
Richard Deeming24-Jul-22 21:30
mveRichard Deeming24-Jul-22 21:30 
GeneralRe: Self Signed Cert Questions Pin
Kevin Marois25-Jul-22 9:11
professionalKevin Marois25-Jul-22 9:11 
GeneralRe: Self Signed Cert Questions Pin
Richard Deeming25-Jul-22 21:17
mveRichard Deeming25-Jul-22 21:17 
GeneralRe: Self Signed Cert Questions Pin
Kevin Marois27-Jul-22 6:45
professionalKevin Marois27-Jul-22 6:45 
GeneralRe: Self Signed Cert Questions Pin
Richard Deeming27-Jul-22 22:01
mveRichard Deeming27-Jul-22 22:01 
GeneralRe: Self Signed Cert Questions Pin
Kevin Marois28-Jul-22 5:51
professionalKevin Marois28-Jul-22 5:51 
GeneralRe: Self Signed Cert Questions Pin
Richard Deeming28-Jul-22 6:46
mveRichard Deeming28-Jul-22 6:46 
GeneralRe: Self Signed Cert Questions Pin
Kevin Marois28-Jul-22 8:07
professionalKevin Marois28-Jul-22 8:07 
GeneralRe: Self Signed Cert Questions Pin
Richard Deeming1-Aug-22 0:16
mveRichard Deeming1-Aug-22 0:16 
GeneralRe: Self Signed Cert Questions Pin
jsc4228-Jul-22 22:27
professionaljsc4228-Jul-22 22:27 
GeneralRe: Self Signed Cert Questions Pin
Richard Deeming1-Aug-22 0:17
mveRichard Deeming1-Aug-22 0:17 
GeneralRe: Self Signed Cert Questions Pin
Kevin Marois1-Aug-22 10:40
professionalKevin Marois1-Aug-22 10:40 
GeneralRe: Self Signed Cert Questions Pin
Richard Deeming1-Aug-22 21:34
mveRichard Deeming1-Aug-22 21:34 
GeneralRe: Self Signed Cert Questions Pin
Kevin Marois9-Aug-22 7:14
professionalKevin Marois9-Aug-22 7:14 
GeneralRe: Self Signed Cert Questions Pin
Richard Deeming9-Aug-22 7:29
mveRichard Deeming9-Aug-22 7:29 
GeneralRe: Self Signed Cert Questions Pin
Kevin Marois9-Aug-22 12:12
professionalKevin Marois9-Aug-22 12:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.