Slider value sets to 0 after reconnect

Hi this my first time here, i tried to control led brightness by slider, everything is fine except when the esp lost connection and reconect then the slider value sets to zero by itself my sketch is nothin but nodemcu blynk wifi sample, so how to keep the slider value as it was.
Thanks in advance

Search for “Blynk.syncVirtual” and “BLYNK_CONNECTED”


can you give me a live example on my sketch

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "jx-Bb5F9GRGA9MvgUkEk5DrXK6gndjgD";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ASUS";
char pass[] = "11111111";

void setup()
  // Debug console

  //Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  Blynk.begin(auth, ssid, pass, "", 8080);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);


void loop()
} ```

@Zeo please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:



Have you bothered to search as I suggested?
What did you find?


i got it ,thankyou sir