I'm trying to create a custom datatype which has some buttons. Because these buttons are causing postbacks I would like to place an UpdatePanel around my datatype. How can I do this? I created a datatype as described at Tim's blog (http://www.nibble.be/?p=50) except that I also override the Render of the actual datatype dataeditor. On the OnInit I tried the following, but it did not help:
RenderChildren works better then Render, but other datatypes still refresh when I cause a postback. This is not the case when put all my code in the OnInit. So far that's the best solution.
I've got another problem using the OnInit. On some pages it renders an error because of the html I put in the LiterControl. When I use RenderChildren this problem does not occur, but I still have the ajax problems. It stil makes a complete postback instead of an ajax postback. When I have a page with a scrollbar the page goes to the top because of the postback which is very annoying. There should be a normal way doing an ajax postback without using the OnInit. Hope someone can help.
Custom Datatype with UpdataPanel
Hello,
I'm trying to create a custom datatype which has some buttons. Because these buttons are causing postbacks I would like to place an UpdatePanel around my datatype. How can I do this? I created a datatype as described at Tim's blog (http://www.nibble.be/?p=50) except that I also override the Render of the actual datatype dataeditor. On the OnInit I tried the following, but it did not help:
My render controls looks as following:
Does anyone know how I can solve this?
Comment author was deleted
Hi Jeroen,
This is actually quite simple.
As you can see in my example the editor inherits from UpdatePanel, so all your controls are allready in an updatepanel.
But if I remember correct you will need to set an ID for each control in order to get the behavioir you want
I see you are right :). When I remove the Render method the code works! Now my Onit looks like:
If I use the render method the updatepanel doesn't work. Is there a way I can control my output and use an UpdatePanel. Thanks already!
I now solved it by putting the next code in the OnInit:
It's a bit dirty, but it works.
Comment author was deleted
Hi Jeroen,
I think you'll need to move to RenderChildren instead of Render
RenderChildren works better then Render, but other datatypes still refresh when I cause a postback. This is not the case when put all my code in the OnInit. So far that's the best solution.
I've got another problem using the OnInit. On some pages it renders an error because of the html I put in the LiterControl. When I use RenderChildren this problem does not occur, but I still have the ajax problems. It stil makes a complete postback instead of an ajax postback. When I have a page with a scrollbar the page goes to the top because of the postback which is very annoying. There should be a normal way doing an ajax postback without using the OnInit. Hope someone can help.
is working on a reply...