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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -