2011-10-18 16:37
Recently I've had more and more pages displaying unexpected behaviour.
I had an UpdatePanel with a button inside it. The button's Click event performed a Response.Redirect(), but nothing happened.
The Javascript error console showed the following error message:
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
After some googling it seems that ASP.Net doesn't quite support Response.Redirect() inside UpdatePanels any more.
The solution was to make sure the button actually performed a full postback of the webpage, and not only a partial postback (as it would do because it was inside an UpdatePanel).
There are two ways of doing this. First the easy way.
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="MyButton" runat="server" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="MyButton" />
</Triggers>
</asp:UpdatePanel>
Here you're basically telling the UpdatePanel that "MyButton" should perform a full postback instead of a partial one.
My problem was a bit more complicated, though, because "MyButton" was inside a GridView. This complicated things a bit, but not too much. Mainly you have to have access to the ScriptManager.
Add the OnRowDataBund event to your GridView. In this event do the following:
protected void MyGridview_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button MyButton = (Button)e.Row.FindControl("MyButton");
ScriptManager1.RegisterPostBackControl(MyButton);
}
}
So instead of telling the UpdatePanel that your button should do a full postback, you're telling the ScriptManager the same thing.
Doing this in code-behind would obviously work for the first example as well.
2011-10-15 13:08
I recently had to reconfigure my linux (Ubuntu 10.04 LTS) servers.
I had previously used
these two howto's to configure my servers.
Suddenly one of them refused to properly connect with various error messages:
# wbinfo -p
Ping to winbindd failed
# wbinfo -u
Error looking up domain users
# wbinfo -t
checking the trust secret via RPC calls failed
Could not check secret
After a week of googling I finally found the following
solution, which did the trick for me.
Stop smbd, nmbd and winbindd (make sure they are really dead using ps. winbindd still lingered after I stopped the service)
Delete the linux computer from the Primary Domain Controller (using the Management Console)
Delete the secrets database (/var/lib/samba/secrets.tdb)
Join the domain again
Start the daemons (smbd, nmbd and winbindd)
Test the winbind commands to see that everything is working
2011-10-15 11:23
Because I'm using
Twitter,
Facebook and
Google+ I haven't really made any good posts to my blog for a while.
I'm trying to remedy this by taking my blog in a new direction.
As a "Technology Enthusiast" I regularly get stuck in various situations where I have to do a lot of googling. Some times I can google for a week and not find a solution.
When I finally do find a solution I've decided I should write about it on my blog so that others can (maybe) find the solution as well.
So don't be surprised when you see lots of technical stuff popping up on this blog instead of the usual ramblings about what happens (or not) in my life.
2011-06-14 08:15

Today is the
World Blood Donor Day. Donating blood is such an easy thing to do, and is also a very easy way to help save lives. You only give about 15-30 minutes of your time, and a pint of blood. Seeing how many lives are saved each year because of blood donors, the choice shouldn't really be that hard to make, but still there is a profound lack of available blood in hospitals around the world.
I am, of course, a donor. Even though I hate syringes and needles, I go through with the donation roughly once every three months. Being such an easy way to help others, I gladly do it. I get a gift from the local hospital every time I do it, but I would continue doing it even if I got nothing at all.
Use today as an incentive to go to your local blood bank and sign up to be a donor! If you're at work, tell your boss you're taking a few moments off work to go register. The boss should welcome this action. If he doesn't, remind him that some day maybe he or his family could be needing blood.
I'm doing my part, are you?
For more information, see the following sites:
American Red Cross, USA
Give Blood, UK
GiBlod.no, Norway
2010-04-28 19:29
I recently had to attend a class in Copenhagen, Denmark, to get to learn the
CMS system we use at the office a little more in detail. I had planned on taking a flight down there on a Wednesday, attending the class Thursday and Friday, then flying back home Friday evening. However, Iceland didn't quite want it to go down like that.
Read more
2009-11-02 18:27
I've now done an extensive cleanup on the site to remove spam comments. I should have been able to filter out and delete only the spam comments, but as always, the human mind is fallible... even mine... so if you're missing a comment you remember having written, I'm sorry, but it's been zapped. You could always write a new one, of course.
In order to try to prevent spam filling up this site in the future I've implemented a new
CAPTCHA from the free (!) service called
reCAPTCHA. I hope this will be good enough to hold the spambots at bay.
If you're one of the people sending spambots to my site, remember the wise words of modern day philosopher geek
Wil Wheaton:
Don't be a dick!
2009-10-21 20:47
I so want to write a serious entry in my blog. But I never find the strength. I have several subjects lined up (my jaw surgery, my couch surfing experience, my trip to TAM London) but I can't work up the strength to actually write about it.
Please, if anybody has any good tips on what I can do to get myself to write about these subjects, please let me know.
Posted in
Life |
1 Comment
2009-08-06 14:54
It seems Twitter is down. Now I'm all lost. I don't know what to do. I keep speaking in sentences of only 140 characters. I keep wondering what Barack Obama is up to. Suddenly I have no funny links to articles on the web or funny videos on YouTube. I can't even tell the world what I'm doing or what I've just seen.
So I've stooped to the level of actually writing on my blog again. That's what happens when the world stops.
So here's a short tweet:
"Watchmen". Very true to the graphic novel. Visually stunning (including Malin Akerman). A bit on the long side. 8/10
2009-07-23 14:45

Last night, just before brushing my teeth before going to bed, I noticed something dark in the corner of my eye. I turned around and saw this monstrosity. Having mild to heavy arachnophobia I actually let out a short scream and suddenly found myself in the adjoining room.
After calming down I got my Nikon and attached the macro lens and snapped a few shots to document the creature. I then brushed it into a bucket (with some toilet paper. Not with my hand. Are you crazy!?) (it actually made quite a thud when it hit the bottom of the bucket) and then emptied the bucket into the toilet.
Now, about the arachnophobia. Me being scientific, and a critical and rational thinker, I know perfectly well that it is an irrational fear to be afraid of spiders. Yet, with this knowledge, I still can't help the small of my back cringing when I see one. Especially when they're that close before I catch sight of them. In a way, it's good to see that my primal instincts still work.
Yes, this makes me a bit of a wuss, but I'll accept that any day. At least I'm not afraid of other kinds of animals, like snakes... or snails.
UPDATE:
After some research it seems that this spider is a
Tegenaria Atrica, a funnel-web spider in the
Agelenidae family.
Read more
Posted in
Life |
1 Comment
2009-05-28 12:24
5 weeks ago today I was scheduled to have jaw surgery because my jaw keeps popping out of its joint (It's very annoying and can hurt pretty bad if it happens and I close my mouth quickly without thinking about wether it popped out or not). I got up very early in the morning, took the train to Oslo and a bus to the hospital. I waited, talked to a doctor, waited, waited some more, a nurse took a few samples of blood, waited again, until finally... I was told to go home since they wouldn't have time to do the surgery on my the next day after all. The person scheduled to have surgery in front of me got a more extensive surgery than planned, so they bumped me off the schedule (Those following me on
Twitter already know all of this, of course).
I was pretty bummed out by this, of course, but there wasn't really anything I could do about it so I took the bus and train back home again.
In one week I'm scheduled to go the hospital again for another shot at the surgery, so to the other person scheduled for surgery the same day (June 5th), please cancel your appointment so that there's no danger of me loosing mine.
Stay tuned because I will try to update my Twitter to keep you up to date on everything regarding the surgery.