Click here to Skip to main content
15,881,898 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionneed help to add paging in datalist access db with vb code Pin
Member 1148584027-Feb-15 8:46
Member 1148584027-Feb-15 8:46 
SuggestionRe: need help to add paging in datalist access db with vb code Pin
Richard Deeming27-Feb-15 10:31
mveRichard Deeming27-Feb-15 10:31 
Questionvb function / sub call using javascript . Pin
Member 815140727-Feb-15 8:13
Member 815140727-Feb-15 8:13 
AnswerRe: vb function / sub call using javascript . Pin
ZurdoDev27-Feb-15 9:35
professionalZurdoDev27-Feb-15 9:35 
Question"End of statement Expected" error Pin
samflex27-Feb-15 5:11
samflex27-Feb-15 5:11 
AnswerRe: "End of statement Expected" error Pin
PIEBALDconsult27-Feb-15 5:25
mvePIEBALDconsult27-Feb-15 5:25 
AnswerRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 6:28
mveRichard Deeming27-Feb-15 6:28 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 6:40
samflex27-Feb-15 6:40 
Hi Richard, *always* fantastic to hear from you.

That ValidateDuration sub is actually yours you helped me out with sometime last year.

Just a refresher, here it is again:


PHP
 Protected Sub ValidateDuration(ByVal sender As Object, ByVal args As ServerValidateEventArgs)
    Dim validator As Control = DirectCast(sender, Control)
    Dim row As Control = validator.NamingContainer
   Dim startHour As Integer = Integer.Parse(DirectCast(row.FindControl("startHour"), DropDownList).SelectedValue)
    Dim startMinutes As Integer = Integer.Parse(DirectCast(row.FindControl("startMinutes"), DropDownList).SelectedValue)
    Dim startAmPm As String = DirectCast(row.FindControl("startAmPm"), DropDownList).SelectedValue

    Select Case startAmPm
        Case "AM"
            If True Then
                If startHour = 12 Then
                    startHour = 0
                End If
                Exit Select
            End If
        Case "PM"
            If True Then
                If startHour <> 12 Then
                    startHour += 12
                End If
                Exit Select
            End If
        Case Else
            If True Then
                args.IsValid = True
                Return
            End If
    End Select

    Dim endHour As Integer = Integer.Parse(DirectCast(row.FindControl("endHour"), DropDownList).SelectedValue)
    Dim endMinutes As Integer = Integer.Parse(DirectCast(row.FindControl("endMinutes"), DropDownList).SelectedValue)
    Dim endAmPm As String = DirectCast(row.FindControl("endAmPm"), DropDownList).SelectedValue

    Select Case endAmPm
        Case "AM"
            If True Then
                If endHour = 12 Then
                    endHour = 0
                End If
                Exit Select
            End If
        Case "PM"
            If True Then
                If endHour <> 12 Then
                    endHour += 12
                End If
                Exit Select
            End If
        Case Else
            If True Then
                args.IsValid = True
                Return
            End If
    End Select

    hourDiff = endHour - startHour
    If endMinutes < startMinutes Then
        hourDiff -= 1
    End If
    'Response.Write(hourDiff)
    'Response.End()
    args.IsValid = hourDiff >= 4
End Sub


I moved hourDiff definiation at class level outside the sub so I can append the value of it to hyperlink control id of hpReserve.

Just having a couple of problems doing so.

One, as you can see, the hourDiff is not a database field. So, I can't use eval(...).

So, it is giving an error that hourDiff is unaccessible.

Second, I keep getting ValidateDuration is undefined when using it to ensure that a minimum of 4 hours is selected.

Any thoughts?
GeneralRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 8:04
mveRichard Deeming27-Feb-15 8:04 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 9:03
samflex27-Feb-15 9:03 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 10:29
mveRichard Deeming27-Feb-15 10:29 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 10:44
samflex27-Feb-15 10:44 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming2-Mar-15 1:43
mveRichard Deeming2-Mar-15 1:43 
GeneralRe: "End of statement Expected" error Pin
samflex2-Mar-15 4:04
samflex2-Mar-15 4:04 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming2-Mar-15 7:10
mveRichard Deeming2-Mar-15 7:10 
GeneralRe: "End of statement Expected" error Pin
samflex2-Mar-15 14:55
samflex2-Mar-15 14:55 
QuestionJSON Hijacking and ASP.Net MVC Pin
Tridip Bhattacharjee27-Feb-15 1:55
professionalTridip Bhattacharjee27-Feb-15 1:55 
AnswerRe: JSON Hijacking and ASP.Net MVC Pin
Richard MacCutchan27-Feb-15 3:00
mveRichard MacCutchan27-Feb-15 3:00 
QuestionWeb site various attack and security Pin
Tridip Bhattacharjee26-Feb-15 23:55
professionalTridip Bhattacharjee26-Feb-15 23:55 
AnswerRe: Web site various attack and security Pin
Richard Deeming27-Feb-15 1:26
mveRichard Deeming27-Feb-15 1:26 
QuestionRe: Access from data from Ms access Pin
Praveen Kandari26-Feb-15 1:16
Praveen Kandari26-Feb-15 1:16 
AnswerRe: Access from data from Ms access Pin
Richard MacCutchan26-Feb-15 2:00
mveRichard MacCutchan26-Feb-15 2:00 
GeneralRe: Access from data from Ms access Pin
Praveen Kandari26-Feb-15 17:04
Praveen Kandari26-Feb-15 17:04 
Questionaccess data from ms access with date Pin
Praveen Kandari26-Feb-15 1:13
Praveen Kandari26-Feb-15 1:13 
SuggestionRe: access data from ms access with date Pin
ZurdoDev26-Feb-15 4:16
professionalZurdoDev26-Feb-15 4:16 

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.