requiredfieldvalidator - required field validator not working row updating gridview -


hi here below code on gridview rowupdating event. why required field validator not working?

if (string.isnullorempty(txtkmstart.text) && string.isnullorempty(txtkmend.text)) {     requiredfieldvalidator rfvs = new requiredfieldvalidator();     rfvs.controltovalidate = txtkmstart.id;     rfvs.errormessage = "km start required!";      requiredfieldvalidator rfve = new requiredfieldvalidator();     rfve.controltovalidate = txtkmend.id;     rfve.errormessage = "km end required!";     validationsummary vs = new validationsummary();     vs.showsummary = false;     vs.showmessagebox = true;       } 

and gridview below

<asp:gridview id="gridview1" runat="server" autogeneratecolumns="false"                              autogenerateeditbutton="true"                               backcolor="white" bordercolor="#336666"                              borderstyle="double" borderwidth="3px"                              cellpadding="4"  gridlines="horizontal" onrowcancelingedit="gridview1_rowcancelingedit"                              onrowdatabound="gridview1_rowdatabound"                              onrowediting="gridview1_rowediting" datakeynames="sno"                              onrowupdating="gridview1_rowupdating" allowpaging="true"                              onpageindexchanging="gridview1_pageindexchanging" pagesize="15"> </asp:gridview> 


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -