Results 1 to 3 of 3

Thread: 2 forms in one webform-page

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    Falkenberg, Sweden
    Posts
    76

    2 forms in one webform-page

    I need to have to submit buttons in the same webform-page.

    The first button is used to add data to a database and the second button is used to change the properties of a datagrid.

    The problem is that I use some "Required field Validator"-controls when I add new data and they are beeing used both when I click the "add Data"-button and when I click the "Change Prop."-button.

    ...so now I can't click the "Change prop"-button without filling in the fields used for "add data".

    Any ideas?

    thanks in advance...
    ________________________
    Fredrik Klarqvist

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    you can always check the name of the sender object for the buttons onclick event you specify


    Sub buttonclick(ByVal sender As Object, ByVal e As EventArgs)

    If sender.Name = "somebutton" then
    'do soemthing
    Else
    'do something else
    End If

    sender is always a reference to the the object that called the event.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    Falkenberg, Sweden
    Posts
    76
    Thank you for your answer.
    The problem is that the "Required Field Validators" are "triggered" before I get to the Click_Event (as it is client-based).

    Any ideas how to disable the "Field Validators" if I click the other button?
    ________________________
    Fredrik Klarqvist

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