Server side CustomValidator triggers but does not do anything

Discussion in 'ASP .Net' started by Mo, Jan 14, 2005.

  1. Mo

    Mo Guest

    Hi,

    I using server side customvalidator in a FormVIew insert form. It
    triggers and regardless of the fact if args.IsValid is true or false
    the data get inserted. am I missing something?

    Thanks,
    Mo
    Mo, Jan 14, 2005
    #1
    1. Advertising

  2. Mo

    Curt_C [MVP] Guest

    1) are you sure it's firing?
    2) where is the insert/save code firing?
    3) do you have a manual Page.Validate and do you have a if(Page.IsValid)
    check before insert?

    --
    Curt Christianson
    Site & Scripts: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Mo" <> wrote in message
    news:...
    > Hi,
    >
    > I using server side customvalidator in a FormVIew insert form. It
    > triggers and regardless of the fact if args.IsValid is true or false
    > the data get inserted. am I missing something?
    >
    > Thanks,
    > Mo
    >
    Curt_C [MVP], Jan 14, 2005
    #2
    1. Advertising

  3. Mo

    Mo hariri Guest

    Hi,

    Thank you for the reply

    1) are you sure it's firing?
    Yes, I have veried that if goes through "if,then,else"
    2) where is the insert/save code firing?
    I am using ASP.Net 2.0 and assigned the "insert" command to the
    button in the form. It is the standard insert code generated by Visual
    Studio
    3) do you have a manual Page.Validate and do you have a if(Page.IsValid)
    check before insert?
    I do not have this. I am not sure where it goes within the standard
    generated code.

    Any Ideas is greatly appreciated.

    Mo





    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Mo hariri, Jan 15, 2005
    #3
  4. Mo

    Mo hariri Guest

    I have the following code
    void Button2_Click(object sender, EventArgs e)
    {
    if (Page.IsValid)
    {
    SqlDataSource1.Insert();
    Response.Write(" Valid");
    }
    else
    {
    Response.Write(" notValid");
    }
    }
    which does the control and will not insert if value is not valid but if
    it is valid value then insert nulls in the database. Somewhere I am
    missing the binding between the form and the control



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Mo hariri, Jan 15, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FpIFZhamph?=
    Replies:
    5
    Views:
    1,118
    =?Utf-8?B?U2FpIFZhamph?=
    Apr 13, 2007
  2. Next

    CustomValidator server-side

    Next, Jan 6, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    163
  3. Next
    Replies:
    0
    Views:
    161
  4. peshrad
    Replies:
    1
    Views:
    283
    peshrad
    Jul 22, 2004
  5. Mo

    Server side CustomValidator and FormView

    Mo, Mar 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    138
Loading...

Share This Page