here's the code I've come-up with so far:
protected void Page_Load(object sender, EventArgs e)
{
try {
serialPort1.PortName = "COM4";
serialPort1.BaudRate = 9600;
serialPort1.Open();
this.serialPort1.DataReceived += new
System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
Label1.Text = "Connected";
UpdatePanel1.Update();
}
catch (Exception ex) {
}
}
string x = "";
private void serialPort1_DataReceived(object sender,
System.IO.Ports.SerialDataReceivedEventArgs e){
x = serialPort1.ReadExisting();
TextBox1.Text = x;
UpdatePanel1.Update();
}
the problem is after the code runs the text box remains empty... (Im using AJAX update panel to refresh the textbox text) the thing is when I set breakpoints during debug, the data received from the serial port is in the variable and is set as the new textbox text but when the code finishes nothing is displayed.... I'm pretty sure the updatepanel works because I've tested it.
PS The serialport is connected to an rfid reader and im trying to read tags. I have successfully coded a windows form app to do what I want but I need to migrate it to ASP.NET