russian women dating romance - Validating in a web user control

The button on the parent page which is supposed to validate the controls is not working after I add the web user control. I tried calling a javascript on button click which calls Page_Client Validate() which doesnt seem to work either. Is there a work-around for this scenario other than manually calling Page.

Is there a work-around for this scenario other than manually calling Page.

validating in a web user control-29validating in a web user control-88validating in a web user control-50

Make sure that you have checked the checkbox which places code in a separate file, the so-called Code Behind file.

You should now have a User Info Box and a User Info Box cs in your project.

A dialog will pop up, and you should select the Web User Control from the list of possible things to add.

Let's call our User Control User Info Box Control, with the filename of User Info Box

If you set the Validation Group property of Text Box1, Required Field Validator1 and Button1 to some string (say VG) and then run the Web Form you will find that upon clicking any of the Submit buttons both the Required Field Validatior controls show the error.

This behavior is undesirable and causes due to the fact that both the instances of the user control use the same Validation Group value.However, with this specific User Control, chances are that you will be receiving the information from an external resource, like a database, and then populating the User Control from there.This usually involves the Code Behind of the page, so how can we do that? In the Code Behind of the page, try something like this: Sometimes you may wish to add User Controls to your page dynamically instead of declaring them. You need an existing control where you can add the User Control to, for instance a Panel. In the previous chapter we created a User Control, and now we will try using it for the first time.Pick a page in your project, or simply create a new one for the purpose, and open it.You will see only one line of code, the User Control declaration.

Comments are closed.