I have the following code to try to use viewstate to save a variable for postback. When post back occurs the SrString value is nothing. I have set the ViewState value at the dropdownlist index chane event and set the variable equal ot ViewState("SrString") at page in the if ispostback block.
Can anyone help?
Thanks
'Page Load
If IsPostBack Then
SrString = ViewState("SrString")
End If
'DropDownList Index change event
Protected Sub ByteDataFile_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ByteDataFile.SelectedIndexChanged
ViewState("SrString") = SrString
End Sub
My web config file is correct, because I have other pages in the web site that works with the viewstate fine.
What am I missing?