I am Threading to Call a function and assign values to a Textbox in Asp.net. When I debug it is showing value, but in the Form it is not getting reflected.
Below is my code.
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddFile.Click
Dim newthread As New Thread((AddressOf ThreadMethod))
newthread.SetApartmentState(ApartmentState.STA)
newthread.Start()
End Sub
I am calling the ThreadMethod() to assing values to Textbox1. When I debug I see it gets assinged as "test". But at runtime it is showing empty. I tried the same for setting ImageUrl in Image contol and got the same issue.
Protected Sub ThreadMethod()
TextBox1.Text = "test"
End Sub
Please let me know if I have to do anything to make it reflect at runtime in my form