views:

22

answers:

2

I'm having a problem parsing my parameters in ASP.Net

Here's what i'm doing

    Sub ItemCommand(ByVal Sender as Object, ByVal e as RepeaterCommandEventArgs)
    If e.CommandName = "EditDetails" Then

    EditDetails()   <---- This is where it's dying
    Else If e.CommandName = "SubmitDetails" Then 
        SubmitDetails()
    End If

    End Sub

    Sub EditDetails(ByVal Sender as Object, ByVal e as RepeaterCommandEventArgs)

    Dim strPassedItems = e.CommandArgument

    Dim strNumberSlept As String = e.CommandArgument.Split("-"C)(0)
    Dim strPassedBookingRef As String = e.CommandArgument.Split("-"C)(1)

    CType(e.Item.FindControl("ddlEditAdults"), dropdownlist).Visible = True
    CType(e.Item.FindControl("ddlEditChildren"), dropdownlist).Visible = True

    End Sub

Anyone got any ideas?

Thanks

Jamie

A: 

EditDetails - doesn't it require two arguments passing in? Sender and e?

EDIT:

Can't remember in vb - but try EditDetails(sender, e)

adrianos
If I add that in like this `EditDetails(ByVal Sender as Object, ByVal e as RepeaterCommandEventArgs)` Then I get an error `expression expected`??
Jamie Taylor
+1  A: 

If I understand it correctly you are calling EditDetails() without any parameters whereas your method expects two parameters. Does this even compile? if so, you should be calling method like EditDetails(sender,e)

Subhash Dike
That worked - I'm a real newbie to this sorry - I was adding the whole `ByVal Sender` etc didn't realise you only needed to put `sender,e` many thanks
Jamie Taylor