c# - how to create web server control using asp.net that contain RequiredFieldValidator control that validate textbox value -



c# - how to create web server control using asp.net that contain RequiredFieldValidator control that validate textbox value -

i want web server command using asp.net contain textbox requiredfieldvalidator controls. have tried validation command not work.

please help me in advance.

protected override void rendercontents(htmltextwriter output) { panel mypanel = new panel(); textbox txtname = new textbox(); txtname.id = "txtnameval"; txtname.enableviewstate = true; requiredfieldvalidator myrqv = new requiredfieldvalidator(); myrqv.errormessage = "please come in value"; myrqv.enableviewstate = true; myrqv.enabletheming = true; myrqv.clientidmode = system.web.ui.clientidmode.inherit; myrqv.display = validatordisplay.dynamic; myrqv.validaterequestmode = system.web.ui.validaterequestmode.inherit; myrqv.viewstatemode = system.web.ui.viewstatemode.inherit; myrqv.controltovalidate = txtname.id; //myrqv.text = "*"; txtname.autopostback = false; mypanel.controls.add(txtname); mypanel.controls.add(myrqv); mypanel.rendercontrol(output); output.write("<br/><br/>"); string mytxt = "<br/>"; output.write(mytxt); //output.write(text); }

vilas jadhav

you can seek next solution:

http://www.codeproject.com/articles/2748/building-an-asp-net-custom-web-control-a-textbox-a

c# asp.net

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -