Custom Validator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Serdar Kalaycý

    #1

    Custom Validator

    I added a custom validator and added some code to its ServerValidate event
    but when a data which is not accepted is entered, it gives the warning as it
    should do, but doesn't stop the execution of Click event of my submit
    button. RequiredFieldVa lidator for example, gives the error when the field
    is empty and does not let the code continue execution. So do I miss
    something in definition of CustomValidator ?

    Serdar KALAYCI

    --



  • Serdar Kalaycý

    #2
    Re: Custom Validator

    Ok, I understand that I have to use client side validation with server side
    validation. But I cannot access server side components in my client side
    script (eg. TextBox1.Text) and because my validation relies on more than one
    component, it's also impossible to get the values from parameters. What must
    I do?

    Serdar Kalayci
    "Teemu Keiski" <joteke@aspalli ance.com> wrote in message
    news:u4ZBKgIRDH A.2320@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hi,
    >
    > take a look at this article:
    >
    > ASP.NET Validation In Depth
    >[/color]
    http://msdn.microsoft.com/library/de...us/dnaspp/html
    /aspplusvalid.as p[color=blue]
    >
    > It will explain you all the details about validation, including
    > CustomValidator .
    >
    > --
    > Teemu Keiski
    > MCP,Designer/Developer
    > Mansoft tietotekniikka Oy
    > http://www.mansoft.fi
    >
    > ASP.NET Forums Moderator, www.asp.net
    > AspAlliance Columnist, www.aspalliance.com
    >
    > Email:
    > joteke@aspallia nce.com
    >
    >
    > "Serdar Kalaycý" <serdarkalayci@ unisec.com.tr> kirjoitti viestissä
    > news:e9OiiQIRDH A.3796@tk2msftn gp13.phx.gbl...[color=green]
    > > I added a custom validator and added some code to its ServerValidate[/color][/color]
    event[color=blue][color=green]
    > > but when a data which is not accepted is entered, it gives the warning[/color][/color]
    as[color=blue]
    > it[color=green]
    > > should do, but doesn't stop the execution of Click event of my submit
    > > button. RequiredFieldVa lidator for example, gives the error when the[/color][/color]
    field[color=blue][color=green]
    > > is empty and does not let the code continue execution. So do I miss
    > > something in definition of CustomValidator ?
    > >
    > > Serdar KALAYCI
    > >
    > > --
    > >
    > >
    > >[/color]
    >
    >[/color]


    Comment

    Working...