Working with ajax tabContainer and ajax updatepanel.

by Administrator 5. January 2010 11:04

The ajax tabContainer and updatepanels can be a pain to work with in the VS designer.
After several hours found a solution to work with them and think it could be interresting to share it.

In our CMS there is several editpages with a lot of controls.
Some pages is hard to understand so I wanted to use the ajax tabContainer to structure the data.

When I did the setup of the page in the VS designer the problem started.

First the tabContainer did not render at all in the designer, or did render for some time and then stoped.
Most of the time the tabContainer shown the hated "Unknown server tag xxx" gray box.
Ofcourse all controls I put inside the TabPanels did not rendered.

To fix this problem I moved all my editcontrols out of the tabContainer.
Then I can work with them in the designer as usual.
I put PlaceHolder inside the tabContainer and use Server code to dynamicly move the editcontrols inside the correct TabPanels.

I works great as long as you don't try to move an ajax updatepanel...
Then this happends.
"Cannot unregister UpdatePanel with ID 'UpdatePanel1' since it was not registered with the ScriptManager"

Ops. I have one updatepanel inside one of the TabPanels so I need to fix this.
Now I started to feel a little frustrated.

I started to google and found out that the updatepanel have problem with dynamic pages.
It's when you move the updatepanel from one control to another control.
There is a blog about this problem here so I wont go into the details.

In the end it works as I wanted.
I can work in the VS designer with all controls and the updatepanel is working fine inside the tabContainer.

In the exampel code I have some tooltip javescript code and some other stuff that is not relevant for the problem.
What I want to show is the setup of the editpage.
I also want to show how I did it inside nested masterpages.

You can download the sample code here.
Hope you like it.

 

Tags:

Yahoo Site Explorer with uniqe domain in asp.net.

by Administrator 4. January 2010 22:15

Recently I found out about the Site Explorer from Yahoo.
It's great when working with SEO to see all in-links to a webbdomain.
It feels more responsive than Google webmaster and you can check all domains.

But, as always there are things to improve.
Searchengines like Goggle don't give higher ranking if you have many in-links from the same domain, so I wanted to filter the result based on domain.
Searchengines also don't like when we have many domains from the same IP, so I wanted to see the IP of the domains and see the number of domains from same IP.

I started to search the webb and found this page that has some similar .php code.

I also found that the yahoo Api was pretty easy to use, (if I compare to the Google Analytics Api).
Yahoo had some .net code ready for the request call and then I just needed to modify the querystring.

It's interresting that all docs is saying I need a Yahoo application ID. It's used to identify my application.
But when I tried the code It worked fine without the application ID.

One problem with the API is that we can only receive 100 Links back from one request.
The maximum number of links from on domain is 1000.
That means we need to loop the request up to 10 times to get all 1000 Links.
In the code I have a recursive function to fix that.

There is a limits from the API to 1000 links/domain and 5000 requests/day and ip.

Try it out here.
Download the sourcecode here.

Tags:

Vs2008 designer problem with nested masterpages.

by Administrator 2. January 2010 12:57

Yesterday I had this strange problem in Visualstudio 2008.
From one day to another the designer stopped rendering my controls in all my contentpages.
I have two nested masterpages and then contentpages.
The masterpages was working fine in vs designer, but the content was showing a blank page.

After several hour I found that a small update in the master page caused the problem.

I always use <div> insted of <asp:panel>. The problem was that I replaced a <div> with <asp:panel>. When I returned to use <div> everywhere in the masterpage, the vs designer suddenly started to render all contentpages again.
I have no idea why. I thougt <asp:panel> was the same as a <div> ?

Hope this can help someone with the same problem.

Tags:

Welcome

Pixcode is a software consulting company located in Trollhättan, Sweden.
We hope you enjoy our blog.

RecentComments

Comment RSS

Tag cloud