Main Site Documentation

Value from URL ! NULL!


#1

Hi,
how can I manage the non-passage of a data / value from URL?

code:

void ethernetForMountaineerEth_NetworkUp(GTM.Module.NetworkModule sender,
            GTM.Module.NetworkModule.NetworkState state)
        {
            var ledEvent = WebServer.SetupWebEvent("Shift_Register");
            ledEvent.WebEventReceived += new WebEvent.ReceivedWebEventHandler(ledEvent_WebEventReceived);
            WebServer.StartLocalServer(ethernetForMountaineerEth.NetworkSettings.IPAddress, 80);
        }

        void ledEvent_WebEventReceived(string path, WebServer.HttpMethod method, Responder responder)
        {
            string ins_dato = responder.GetParameterValueFromURL("ins_num_dati").ToLower();
            int valore  = Int32.Parse(ins_dato);
            Debug.Print("Ins Dato: "+ins_dato);
            if (ins_dato != null)           // -----------------------------does not find anything
            {
                while (valore != 0)
                {
                    Rclk.Write(false);
                    Thread.Sleep(1);
                    Rclk.Write(true);
                    a += 1;
                    impulso();
                    valore -= 1;

                    Double part = Partition.ReadVoltage();
                    Debug.Print("Tesione del partitore: " + part.ToString("N2") + " Volt");
                    Debug.Print("Dato inserito ON");
                    responder.Respond("Dati Inseriti nello Shift Register " + ins_dato + " \n\nTesione del partitore: " + part.ToString("N2") + " Volt");
                }
                Mainboard.SetDebugLED(true);
                responder.Respond(" 0 dati inseriti\n\n led blue acceso");
            }
            else
            {

                responder.Respond("Inserisci almeno un dato.....");
            }
        } 

#2

you should check out a lot of posts from workhard10 that talk about this. Goes into a lot of detail that you need - better than having everyone re-teach it !

edit: here’s some of the threads…
http://www.ghielectronics.com/community/forum/topic?id=10411
http://www.ghielectronics.com/community/forum/topic?id=11156


#3

debug into the code a look at the responder object
depending on the http methode you get
responder.Body.Text or responder.GetParameterValueFromURL