-
If Not IsPostBack Then
-
-
If Not Session("USERID") Is Nothing Then
-
If String.Compare(Session("ROLE"), "Retailer") = 0 Then
-
strUSERID = Session("USERID")
-
Else
-
Response.Redirect("usercp.aspx")
-
End If
-
Else
-
Response.Redirect("UserLogin.aspx")
-
End If
-
FillBrands()
-
End If
-
the above code works fine page is not expiring until sign out but server side action on page like loading data on dropdownlist not working.
as i am loading brands in one dropdownlist and when we choose any brand from the list it will load product names in another dropdownlist which is not happening if i use above code. but the problem of session expire is not happening with this code. just clarify me that which method is true code to check the login and role should be kept inside if not ispostback then .... end if or outside.
I would check that the user is logged in and within the roles Every page request. This means that I would not put it within the if not IsPostBack.
As for your second DropDownList not filling....please post the method that handles your first DropDownList post back event so that we can have a better look at what's going on.
Also, in the future, could you please post your code within [code] tags.
For example, if I were to post VB.NET code I would type the following:
[code=vbnet]
'My VB.NET Code Pasted Here
[/code]
Thanks
-Frinny