Link to home
Start Free TrialLog in
Avatar of WEhalt
WEhaltFlag for United States of America

asked on

vb.net - Cursor form objects to set stored procedure parameter values

I would like to cursor through the items in my aspx form and automatically pass the parameter values instead of having to list each one individually.

    Protected Sub SaveDailyClose()

        ...
        Try
            '  Use a script that loops through each field on the form
            '  The object names on the form coincide with the parameter names
            '  create the call for the parameter
            ' move to the next object
     ...

        Catch ex As Exception
            Response.Write(ex.Message)
            oDataAccess.CloseConnection()
            Exit Sub

        End Try
ASKER CERTIFIED SOLUTION
Avatar of rgn2121
rgn2121
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WEhalt

ASKER

I was not clear enough in my original request.  I need to do this in vb - not in java inthe page's script.

Do you have a source for that?
I don't know much javascript, but here are a few I found.  You might also look into using something like jQuery.  From what I have seen and read, might make this task easier...

http://stackoverflow.com/questions/187059/how-to-get-all-the-controls-in-page-using-javascript-in-asp-net-page
http://www.eggheadcafe.com/community/javascript/3/10016212/loop-through-the-controls-in-the-form.aspx
Avatar of WEhalt

ASKER

in vb
        Dim ctrl As Control
        For Each ctrl In Me.Controls

        Next