customvalidator on a user control UC1 when the user clicks a button located on a different user control UC2 on the page


Hi,

I am maintaining page where a user control is initialized  dynamically.

The user control UC1 has a customvalidator using server side validation. When the postback is caused by a button inside the user control UC1 causes the postback, the customvalidator works fine and I get my validation results displayed. However, If I click a button located on a second user control UC2 on the main aspx page, the validation doesn t execute and I get no result validation error displayed.

My question,
how can I make the validation execute on the user control  UC1 when the postback is caused by a button located in another user control UC2 on the main  page? and how can I get the user control UC1 display the validation error message?

p.s: Notice that I am using customvalidator on server side, not on client side


Thanks a lot, I appreciate your taking the time to help me.
0
tutus
9/23/2008 2:47:21 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
993 Views

Similar Articles

[PageSpeed] 2

hi,

Try to set the ValidationGroup property of all your validators to the same value. Do the same for the submit button
(same property, same value).

This should make it work.

Regards,


Please mark the reply as the answer if it helped you.

Samir Bellouti
Senior .NET Architect
sbellouti@gmail.com
http://bellouti.wordpress.com
0
sbellouti
9/23/2008 7:01:06 AM
Reply:

Similar Artilces:

Single page with multiple user web controls VS Multiple page with specific user web controls
I have a question regarding single page with multiple user web controls vs multiple page with specific user web controls   Option 1: I am of the opinion to have multiple pages with specific user web controls and use an object to store all the information as the user navigates through the application. And finally at the end, read this object and save all the information to the backend database.   Option 2: My respected team member suggests that we have only one page, with all the specific user web controls and not use an object, instead show/hide the user web controls based ...

Web User Control to Web User Control...
Hi, I have 2 User controls on a page and want Control1 to call a method of Control2. Is this Possible? Example: Con1 = Datalist showing products, each with a Quantity Box and a Button. Con2 = Repeater showing Cart Preview (name, Price) in page.aspx. When I click on the button on the DataList in Con1 it adds the item into the Session based Cart. However it does not update the Cart Preview. I need to call BindPreview() in Con2 in order to update the Cart Preview... Does that make sense? argh! any help much appreciated! PeteWeb Design Nottingham, UK Well I can call BindPreview() from m...

Add user control from user control to web page
Hi there, I have a user control, that is inside another user control on a web page. From this user contfol, I need to add something to a place holder on the parent web page. I am having troubles referencing the placeholder correclty. I can get it fine as build time, but on runtime it kicks up the "Object reference not set to an instance of an object" error. Any ideas would be greatly appreciated. -------------------------------------------------------------- protected Civil_and_Corporate.candcadmin._default _default; ------------------------- Control objControl...

access controls on web user control x from web user control Y
I have 2 web users controls in a page and I would like to get or set the selected values of a few dropdown boxes on web user control X from web user control Y and I also would like to know how to access functions that are on a web user control X from a web user control Y, is this possible? How can I do it? User can access and set the values of the User Control from .aspx page through properties,using javascript and in code-behind of aspx page.The details of it are shown below Using PropertiesIf the Sample.ascx control has two textboxes and submit button.You can access the valu...

Call function of 1 user control from a different user control on same page.
Hi, Is it possible to call a public function of 1 user control from another user control on the same page? if so, how would i go about doing so. I will provide any other info you require. Thanks for your time Lee Have you tried calling usercontrolA.publicFunction?  That will not work. The code behind of UsercontrolA does not recogise the code behind of UsercontrolB. The page both of these controls are on WILL recognise both of the controls functions, but the user control does not know what page it is on until it runs. Why dont you create a class with this functio...

User Controls in User Controls?
I have the follow set up and it is throwing an error "Unhandled error loading module" ... is there some trick to this that I don't know?I have a project A that uses controls from project B (project B is just a project with all my user controls used through out other modules).  project A uses user control 1 from project B with out any issues at all - great.  But then I wanted to add user control 2 to user control 1 and that is when I get my error.  In fact I don't even have the user control 2 in user control 1, just when I put the register part into user control 1 is when it al...

User Control in a User Control
I have a first user control that contain a second user control. If I cahe the first user control can I still dynamically control the second one or it is cached with the first one therefore can not control it anymore? Thanks When your first control is cached, its rendered out and its output is stored in the cache. On every request to the page containing your control that can satisfy it from cache, the output will just simply be inserted - your first control will never be instantiated or run in that case, so the second one wont be either. Hope this helps,Mike VolodarskyProgram Manager...

user control to user control
I have an aspx page that have a "Register" directive to two usercontrol called rptMaster.ascx and rptDetail.ascx. I'm trying to set up a Master-Detail relationship and wish for the rptMaster.ascx to trigger and event from a dropdownlist and for the rptDetail to be listening for DropDownList event. I believe I have gotten the events part okay with help from this articel http://codeproject.com/aspnet/Page_UserControl.asp but my declaration for a private statement to my rptMaster class is producing an error. I'm using beta 2 of asp.net and I 'm having trouble getting a reference TO ...

User control in a user control
Hello all, I have created a user control with some checkboxes, and public properties to get the values of these checkboxes. I have also created a second user control using the first user control; this second control also access the public properties of the first one. My problem is when I implement the second control in an aspx page, if I click at runtime the checkboxes in the first control, I am able to access its public properties from the methods of the second control but the values of these properties are wrong. while at design time, I do not have this problem. Than...

Pass values from one user control to a user control on a different aspx page
Hello, I have an aspx page titled Search.aspx. Within this page, I have a user control titled Search.ascx. I want a user to input search terms, then on the click of a button, I want to pass the values to another page (SearchResults.aspx)....which will then display the results in a user control. Can someone please give me some suggestions on how to do this? Thanks a lot! Hello, what you can do is: inside ur usercontrol, create a method that returns a dataset or datareader. that is, since u are searching using the usercontrol, then the result of ur search will be return...

To access a control placed in a web user control which is loaded during page load in button click event
How can I access a control in a web user control in a button click event , the user control is loaded in page load.Thanks & Regards,Abhiram Reddy Mekha. Try checking this... http://microsoft.apress.com/asptodayarchive/73869/event-handling-between-custom-user-controls-that-are-loaded-at-run-time http://aspalliance.com/565_Dynamic_Loading_of_ASPNET_User_Controls http://www.beansoftware.com/ASP.NET-Tutorials/Controls-Run-Time.aspx http://stackoverflow.com/questions/92792/user-control-created-dynamically-not-able-to-handle-events-on-postback http://www.codersource.net/asp_net_user_c...

Problem in accessing web form data in user controls when create user control dynamically
HI. I have a problem using web user control. I designed a user control named NewsForm. This user control contains some web form elements like <asp:textbox>. When I add it in an .ASPX page, all things may be true. I can know which user filles in textbox (for example and other controls) <%@ Register TagPrefix="uc1" TagName="NewsForm" Src="NewsForm.ascx" %> and <UC1:NewsForm id="newsForm" runat="server"></UC1:NewsForm> But when i create it in code behined dynamically, however user control has web form controls but their value are blank for example //aspx co...

Make panel in parent user control visible from child user control button click
I have a user control (parent) that have another user control (child) in itself. I also have an invisible panel in the parent. when I click a button in the child user control, I want the child to turn invisible and the panel in the parent user control to be visible. Because the Page_load is activated before Sub Button_Clicked I don't know how to handle this. I use properties to communcate between the controls. My last try: Public Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Click.Click 'Hide this child...

User Controlers: Changin a string value according to which button is clicked in Header user control
I'm using Visual Studio 2003 and I figured out how to pass strings between usercontrols and the page. But now I have a new problem.There are couple of Buttons in usercontroler which i named as Header1. When each Button is clicked I have  to pass a different string to the main page (ex: string temp changes when button1 is clicked and when button2 is clicked temp changes again). Therefor string depends on which button is clicked. Using my main webform i send this string from Header1 and give it to the second usercontrol Side Menu.  Problem is : How to change the value in that strin...

Web resources about - customvalidator on a user control UC1 when the user clicks a button located on a different user control UC2 on the page - asp.net.web-forms

Member Registration - Peoplebank Australia - IT Jobs and IT Recruitment
Peoplebank are Australias leading IT Recruitment Company Peoplebank have a focus on Temporary IT Recruitment Contract IT Recruitment Executive ...

Contact Us - WPVI
Login Sign Up! Home Channels My Gallery Recently Added Highest Rated Most Viewed See it? Shoot it! Send it! Your Ugly Holiday Sweaters Weather ...

Contact Us - WABC
Login Sign Up! Home Channels My Gallery Recently Added Highest Rated Most Viewed Breaking News Weather Photos and Videos Fleet Week 2012 News ...

Contact Us - KFSN
Login Sign Up! Home Channels My Gallery Recently Added Highest Rated Most Viewed News Weather Sports Valley Life ABC30 in Action Vacation / Travel ...

Contact Us - WLS
Login Sign Up! Home Channels My Gallery Recently Added Highest Rated Most Viewed ABC7 Weather images Marilyn Monroe Statue NATO 2012 Chicago ...

Dinner by Design. Created in our kitchen to be cooked in yours. Simple. Smart. Delicious.
Please enter your Email Address or Username : Please enter your Password : Forgot Password?

Member Registration - Diverse City Careers
DCC is a niche job site- we only advertise roles at Australia’s top companies which are all committed to creating ideal workplaces for women ...

Airline Schedule - International Flight Schedules - Etihad Airways
International airline flight schedules - check and download Etihad Airways current flight schedule to your pc or mobile device

Hallab
... New customers can create an account so that you can shop faster in the future and keep track of orders you have made in the past. CustomValidator ...

CustomValidator Control
The CustomValidator control allows you to create a validation control with customized validation logic. For example, you can create a validation ...

Resources last updated: 1/20/2016 1:07:03 AM