Results 1 to 3 of 3

Thread: Call a sub routine in other webform

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Location
    Las Vegas, NV
    Posts
    29

    Call a sub routine in other webform

    I have two WebForms that are displayed in a Frame page. WebForm1 has several DropDownList that create a SQL Statement. WebForm2 has the DataGrid that will display the data.

    Is it possible to Call a sub routine from WebForm1 that is on WebForm2 and pass a variable? If not, simply pass a variable to WebForm2.

    I did declare a Public variable in a module “Public SQLText as String”. The variable is functional in both forms but will not carry the string from one form to the other.

    I do have some experience with VB.Net but this is my first attempt with a Web App.

    Thanks for your help

    Chuck from Las Vegas

  2. #2
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671

    Re: Call a sub routine in other webform

    The only way to pass variables between pages is either through the Session Object (probably not appropriate for your situation) or through the Request Object.

    In your case you would probably be better off using javascript to pass the values of the selected listboxes to the second page in the query string (by dynamically changing the frames src attribute). Never pass SQL statements between pages because of the possibility of SQL injection.

    You might also want to consider using AJAX rather than 2 different pages if the table you are writing out is going to be quite simple.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Location
    Las Vegas, NV
    Posts
    29

    Re: Call a sub routine in other webform

    Hi Martin

    I actually have a string variable (SQLText) that I pass the statement to the OleDbDataAdapter for the query.

    What I am trying to accomplish is to have the DataGrid in its own frame so I can scroll it in a sanitary manner. I need to have the DropDownLists visible at top of the page, the datagrid next and then some other info at the bottom all visible at the same time.

    Looks like I will need to learn some Javascript

    Thanks for the help

    Chuck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width