Hi all,

I'm using RFID Reader to read the data from RFID Card.

The code using as below





vb Code:
  1. Dim WithEvents serialPort As New IO.Ports.SerialPort
  2.     Public Event onComm(ByVal sender As Object, ByVal e As System.EventArgs)
  3.     Private psInput As String
  4.  
  5.  
  6.  Private Sub DataReceived( _
  7.    ByVal sender As Object, _
  8.    ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _
  9.    Handles serialPort.DataReceived
  10.         Dim strv As String
  11.         strv = serialPort.ReadExisting
  12.         If strv <> "" Then
  13.             psInput = strv
  14.             Session("InputRFID") = psInput
  15.            
  16.         End If
  17.     End Sub
  18.  
  19. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  20.  
  21.         If Me.IsPostBack = False Then
  22.             With serialPort
  23.                 .PortName = "COM" & "4"
  24.                 .BaudRate = 9600
  25.                 .Parity = IO.Ports.Parity.None
  26.                 .DataBits = 8
  27.                 .StopBits = IO.Ports.StopBits.One
  28.                 .ReceivedBytesThreshold = 11
  29.                 Try
  30.                     If .IsOpen = False Then .Open()
  31.                 Catch ex As Exception
  32.  
  33.                 End Try
  34.  
  35.  
  36.             End With
  37.         End If
  38.  
  39.     End Sub

Now My Problem is when the card was scanned, It will firing DataReceived event. I successfully get the data and try to display data on a textbox.

The page do not postback after DataReceived event so the textbox cannot display.

How do I accomplish it ?

Thanks in advance