Hi,
I want to fill a dropdownlist and datagrid from a sql datatable in asp.net page. In past i have been doing this in page load method. I just want to know which method is good for retrieving data from sql and assigning to controls. I was revising the page cycle concepts and it seemed that page.load method is called recursively for each control. if that is the case then i think, i am incorrect when i use page load method. Please correct me. Thanx.
Loading
JayPosted Jul 15, 2009, 1:51 AM
You can write your code inside "If Not IsPostBack Then ------End If" In pageload event . coz this will execute the code only when the page is loading first time
Eg:
---
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
' write a code for filling process
End If
End Sub