What you have to understand is that each time you refresh the page, a new instance of that page is instantiated. Now, you may be wondering how items that have been changed in the page are set to their changed value.
To understand this (in classic ASP.NET), it's important to be aware of two things; the first is that ViewState is used to store changed values, and the second thing is to be aware that these values are used to repopulate the relevant sources (this is a high-faluting way of saying that you don't need to rebind most datasources because the bound data has been written to the ViewState for you automatically).
So, what does this really mean for you? Well, this means that you can store the value you want in the ViewState, and repopulate it when the ViewState is repopulating your page; or you could use the Session context to store the value, but considering that it's only relevant on this one page, that would be overkill.
Basically, you could simply do this in your code:
If ViewState["EditNum"] Is Nothing Then
flg_edit = 1
Else
flg_edit = CType(ViewState["EditName"], Int32)
End If
And you save your ViewState like this:
ViewState["EditNum"] = flg_edit