Steve Kinsey.Com

subscribe to the RSS Feed

Thursday, March 11, 2010

Workaround bug with ASP.Net hyperlink control and Eval function

Posted by Steve Kinsey on February 11, 2010

Came across a little bug today that I thought it was worth mentioning in case it helps anyone else out. Say you have a repeater control and somewhere in there your using eval to populate a control in there. This kind of thing for example:

<asp:label id="label1" runat="server" text='Some Link<%#Eval "Link" %>' />

Works perfect as you would expect it to, however if you tried to do the following:

<asp:hyperlink id="hyperlink1" runat="server" navigateurl='Some Link<%#Eval "Link" %>' >Some Text</asp:hyperlink>

You will find that it doesn’t work, there seems to be a bug that stops it evaluating the eval code. However it is pretty easy to fix, all you need to do is reformat the control as such:

<asp:hyperlink id="hyperlink1" runat="server" navigateurl='<%#"Some Link" & Eval "Link" %>' >Some Text</asp:hyperlink>

Now it works, weird huh.

Bookmark and Share

Exporting Gridviews From Ajax Panels And/Or Master Page

Posted by Steve Kinsey on February 1, 2010

I had a problem recently with being unable to export of gridview into excel when the grid was inside an AJAX update panel, plus the export button was also inside the panel. Took me a while to find the solution so I thought I would share it here.

Firstly lets deal with the problem of a grid being inside an AJAX panel, if your export button is also inside the panel your export function will probably give you the following error:

Sys.WebForms.PageRequestManagerParserErrorException

Or something along those lines. To fix this problem all you need to do is put a trigger inside your panel for a postback event on the button. Just make sure it as a postback event and not an asynchpostback. For example:

<Triggers>
<asp:PostBackTrigger ControlID=”btnExcel” />
</Triggers>

This should fix the problem. However if you are using a master page in your application you may still be getting problems with your export routine. To fix the problem add the following code to your aspx page code behind:

Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
'This code is required to export data from
'within an ajax update panel
End Sub

Dont’ add anything inside the sub, just leave it as it is and this should work. Or if you prefer you can add the following code in your Master page code behind and it will work on any page.

Public Overloads Sub VerifyRenderingInServerForm(ByVal control As Control)
'This code is required to export data from
'within an ajax update panel
End Sub

Hope this is of as much help to you as it was to me, feel free to comment.

Bookmark and Share

Yes I Am Now A Twit Or Is That Tweet?

Posted by Steve Kinsey on March 29, 2009

twitterbird2Yes I have decided to join the world of twitter and tweet along with everyone else. I’ve no idea yet how I might use it or how often I might post twits or tweets (which is it?) but so far I am enjoying following other people, both online business people as well as the odd celebrity here and there.

I took the opportunity to install a Twitter tool for the blog which you can see sitting on the sidebar. It’s called simply Twitter Tools and it seems to do the job it was designed for perfectly well. Was just a simple plugin download and didn’t requite any HTML editing or anything more than activation and installing widget.

I took the opportunity while I was there to clean up the blog a little, I switched from three columns to two as I think it was looking a little cluttered and I took away some things I considered unnecessary like archives. I mean who really uses those archives?

Well I hope you like the changes and if you want to follow my ramblings then my twitter page is: http://twitter.com/stevekinsey

Bookmark and Share

I’m Selling One Of My Sites

Posted by Steve Kinsey on March 25, 2009

I’ve decided to put one of my sites up for sale, I’ve had the site for a while and the domains for even longer so they are nice and mature. I’ve never had the time to focus on it but I do think it could be a good and profitable site for the right owner. The site in question is GetThatBargain, I’ve set it up as a purely affiliate blog showing all different kinds of online deals and bargains, however I think the name could be adapted to suit other things.

Here’s a more detailed list of whats included in the sale:

  • Mature domain names, google likes mature domain
  • gethatbargain.co.uk domain
  • gethatbargain.com domain
  • gethatbargain.net domain
  • gethatbargain.org domain
  • Easy to use and customised blog theme from uniqueblogdesigns.com
  • Site and email hosting for you if you need it, first 12 months hosting included free (subject to traffic levels)
  • Complete site ready to go
  • Over 40 existing posts with comments

The blog theme is a new affiliate focussed one from UniqBlogDesigns and is very easy to use and includes lots of little features for monetising a blog. This site is an ideal startup project for someone moving into affiliate marketing.

If you are interested in purchasing this site, post a comment here or get in touch via the contact form and lets discuss.

Bookmark and Share

Making The Most Of Local Resources

Posted by Steve Kinsey on February 20, 2009

socialnetwork

I was out of the office most of this week attending a free small business course provided by the welsh assembly government. I actually only originally booked to go onto a half day module on the first day. The module was on marketing for business startups, but once I arrived the guy told me that I was welcome to attend the whole three day course if I wanted to.

Overall it was definitely worth taking the time out, although the majority of the course seemed to be focussed on financial management, tax returns etc, there was enough useful information overall to make the three day commitment worthwhile and who can turn down three days of free expertise.

There are other good reasons for taking the time to attend these kind of events, they can be a good way to network with local small business owners and as the attendees are likely to be startups there is also a possibility that some of them will be looking for websites, online setup advice or programmer resources.

If you have any interest in working with local small businesses I recommend that you so some local searches online for government or private sponsored events, training courses, meet ups etc. You never know, not only might you learn something but you make some valuable new contacts.

Bookmark and Share

Believe it or not, I am still around.

Posted by Steve Kinsey on January 23, 2009

Yes I’m still here, I can’t believe it’s been such a long time since my last post. I wanted to mention the two competitions I ran back at the end of last year. They were the Berocca Bloggers Relief Pack competition and the October Goals competition. I’ve been trying to get hold of winners for both of these but have so far failed to get any response. I haven’t forgotten about them though so watch this space.

I’m deciding at the moment whether to set goals for this blog in future or to just relax about it, post when I have something to say and focus instead on goals for my other sites / projects. I do enjoy blogging, which may sound hard to believe given the amount I post. So I think if I put pressure on myself to achieve things with it, I take the fun out of blogging in the first place.

The blog is actually doing pretty well and some of the posts like my recent one concerning Affiliate Window are getting a lot of reads, plus comments in general seem to be increasing nicely. So I think I am probably better off writing when I have something to say, rather than trying to make myself do x posts per month.

So that’s it for today, just a little post to say “Hey I’m still here”.

Bookmark and Share