Custom Control post back raises Validation Control's Validate event
-
Hi all, I have developed a custom pager control, which has been inherited from WebControl, IPostBackDataHandler. Function of the control is to render a pager layout ( page numbers, next, prev, buttons ) and raise an event on the server when page change in UI. Problem is what when i place any validator control which are validate on server only are raising validation on custom pager control's post back. code preview
PreRender(){ // Registering client script block that set page index in hidden // and submit the form } Render(){ // Rendering set of links ( ) that will call my javascript function // to set page index in hidden and post back the page } LoadPostData(){ // Check hidden variable and return true to raise event } RaisePostDataChangedEvent(){ // Raising PageIndexChanged event }
if anybody has resolution of this problem, please guide me, i will be very thankful to all of you.
Confidence comes not from always being right, but from not fearing to be wrong. Mihir..
-
Hi all, I have developed a custom pager control, which has been inherited from WebControl, IPostBackDataHandler. Function of the control is to render a pager layout ( page numbers, next, prev, buttons ) and raise an event on the server when page change in UI. Problem is what when i place any validator control which are validate on server only are raising validation on custom pager control's post back. code preview
PreRender(){ // Registering client script block that set page index in hidden // and submit the form } Render(){ // Rendering set of links ( ) that will call my javascript function // to set page index in hidden and post back the page } LoadPostData(){ // Check hidden variable and return true to raise event } RaisePostDataChangedEvent(){ // Raising PageIndexChanged event }
if anybody has resolution of this problem, please guide me, i will be very thankful to all of you.
Confidence comes not from always being right, but from not fearing to be wrong. Mihir..
Do you mean when your custom pager control is working, it causes the validators on the web page to work at the server side? If so, you can try to make your control implement the
IPostBackEventHandler
inferface, and simply leave the implementation of theRaisePostBackEvent
method empty.