Hi,
I declared public variables in my aspx.vb.
then in my GridView1_RowCommand Sub, i set values from aspx. Everything works fine so far.
But when i try to use those variables in another Sub;it says they are NULL???
I declared public variables in my aspx.vb.
VB.NET:
Partial Class PendingApproval
Inherits System.Web.UI.Page
Public formType As Integer
Public taskID As String
Public check As Integer = 0
Public creator As String
Public formID As String
then in my GridView1_RowCommand Sub, i set values from aspx. Everything works fine so far.
VB.NET:
Dim rowIndex As Int32 = Convert.ToInt32(e.CommandArgument.ToString())
formID = GridView1.DataKeys(rowIndex).Values("EformID").ToString()
formType = Convert.ToInt32(GridView1.DataKeys(rowIndex).Values("EformType").ToString())
taskID = GridView1.DataKeys(rowIndex).Values("TaskID").ToString()
check = 1
But when i try to use those variables in another Sub;it says they are NULL???
VB.NET:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim task As New Task
With task
.FormType = formType
End With
End Sub
How can i set value to a variable and then use it from another Sub?
thanks in advance.
Best regards