Click here to Skip to main content
15,897,968 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAvailablity Calendar Controls Needed Pin
Brendan Vogt15-Jun-07 4:43
Brendan Vogt15-Jun-07 4:43 
AnswerRe: Availablity Calendar Controls Needed Pin
nareshss15-Jun-07 21:04
nareshss15-Jun-07 21:04 
QuestionHELP Please!! Datagrid with update function!!!!! Pin
papy-boom15-Jun-07 4:20
papy-boom15-Jun-07 4:20 
QuestionPage_Load calling Sub [modified] Pin
kallileo15-Jun-07 3:44
kallileo15-Jun-07 3:44 
AnswerRe: Page_Load calling Sub Pin
kubben15-Jun-07 3:49
kubben15-Jun-07 3:49 
GeneralRe: Page_Load calling Sub Pin
kallileo15-Jun-07 4:03
kallileo15-Jun-07 4:03 
GeneralRe: Page_Load calling Sub Pin
kubben15-Jun-07 4:15
kubben15-Jun-07 4:15 
GeneralRe: Page_Load calling Sub Pin
kallileo15-Jun-07 5:15
kallileo15-Jun-07 5:15 
If Not Page.IsPostback has no effect...but I think I found something.


Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

SQLconn.Open()
Dim SelectCmd1 As New SqlCommand("SP1", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Integer
Dim myDataReader1 As SqlDataReader
myDataReader1 = SelectCmd1.ExecuteReader()
myDataReader1.Read()
result1 = myDataReader1.GetInt32(0)
SQLconn.Close()
ChangeButton1(result1)

End Sub

"Handles MyBase.Load" is the key....when I remove this I have the same as in the MyRefresh().

I had to modified it like this:

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Refresh()
End If
End Sub

Sub Refresh()
SQLconn.Open()
Dim SelectCmd1 As New SqlCommand("SP1", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Integer
Dim myDataReader1 As SqlDataReader
myDataReader1 = SelectCmd1.ExecuteReader()
myDataReader1.Read()
result1 = myDataReader1.GetInt32(0)
SQLconn.Close()
ChangeButton1(result1)

End Sub

Why is Handles MyBase.Load so important???
GeneralRe: Page_Load calling Sub Pin
kubben15-Jun-07 5:19
kubben15-Jun-07 5:19 
GeneralRe: Page_Load calling Sub Pin
kallileo15-Jun-07 5:35
kallileo15-Jun-07 5:35 
QuestionHttpContext.Request.Url Problem Pin
Jkirt15-Jun-07 3:40
Jkirt15-Jun-07 3:40 
AnswerRe: HttpContext.Request.Url Problem Pin
kubben15-Jun-07 3:51
kubben15-Jun-07 3:51 
GeneralRe: HttpContext.Request.Url Problem Pin
Jkirt15-Jun-07 4:01
Jkirt15-Jun-07 4:01 
GeneralRe: HttpContext.Request.Url Problem Pin
kubben15-Jun-07 4:12
kubben15-Jun-07 4:12 
GeneralRe: HttpContext.Request.Url Problem Pin
Jkirt15-Jun-07 4:59
Jkirt15-Jun-07 4:59 
GeneralRe: HttpContext.Request.Url Problem Pin
kubben15-Jun-07 5:13
kubben15-Jun-07 5:13 
GeneralRe: HttpContext.Request.Url Problem Pin
Jkirt15-Jun-07 5:52
Jkirt15-Jun-07 5:52 
GeneralRe: HttpContext.Request.Url Problem Pin
kubben15-Jun-07 6:02
kubben15-Jun-07 6:02 
GeneralRe: HttpContext.Request.Url Problem Pin
Jkirt15-Jun-07 6:11
Jkirt15-Jun-07 6:11 
GeneralRe: HttpContext.Request.Url Problem Pin
kubben15-Jun-07 6:03
kubben15-Jun-07 6:03 
GeneralRe: HttpContext.Request.Url Problem Pin
Jkirt15-Jun-07 6:18
Jkirt15-Jun-07 6:18 
AnswerRe: HttpContext.Request.Url Problem Pin
Jkirt15-Jun-07 19:35
Jkirt15-Jun-07 19:35 
QuestionMaintaining log Pin
ShuklaGirish15-Jun-07 2:19
ShuklaGirish15-Jun-07 2:19 
AnswerRe: Maintaining log Pin
N a v a n e e t h15-Jun-07 3:27
N a v a n e e t h15-Jun-07 3:27 
QuestionMetadata file 'dll_name' could not be found Pin
Rip Kirby15-Jun-07 1:59
Rip Kirby15-Jun-07 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.