Archives
-
Putting Messages Into a ValidationSummary Control...From Code
I love the asp.net validation controls. They're chick and really useful. We sometimes have to show some messages that are not the ErrorMessages of validators. An approach to do this could be to
-
Getting the URI in Silverlight
We may need the uri of the silverlight app in various circumstances (like if we move the app around in the solution, or are dealing with images and other resources located in a folder on the web site that's not part of the silverlight project). We can get the path easily with:
-
How to Read the HTML of a Web Page Programmatically
We might need to read the contents of some page (local or remote) by code. This is quite simple in .net.
-
ACT: CollapsiblePanelExtender - How to Collapse / Expand Programmatically
The CollapsiblePanelExtender is a cool way to convert simple panels to collapsible ones. It usually has a target panel, a control which can make it collapse, another (or the same) control to make it expand etc. Clicking the said controls will trigger the collapse/open behaviour.
-
LINQ to SQL dbml - More than just for accessing a db
Hi guys...I've been gone nearly a month now. I've finished the last of my classes of my last year of my BSc degree (final exams are in January) and we were having all sorts of grad parties. Add to that finishing off a freelance project and my new role as one of the moderators of http://forums.asp.net, blogging had to take a back seat. Anyway, I'm back :)
-
Assigning Port Numbers for the Dev Server
A lot of times, specially when using web services, we want the dev server to use a specific port. Suppose you have a web service and a website which consumes it. You put them in two separate projects. You’d want the web service to always use the same port. One option is to set it up in IIS. But what if you don’t want to use IIS? What if your putting together a simple test and wish to use the dev server? How do we do that?
-
WCF .svc Gives HTTP 404 on Host, Works Perfectly on Local
I was recently working on a project that used WCF web services extensively. Everything was ready for deployment, I deployed to the remote host, and voila – nothing works (nothing WCF related). After a LOT of frustration, I managed to make it work. I found two areas which were causing the problem:
-
Setting Timeouts for Session and Authentication
Setting the timeouts for Session and Authentication can be a bit tricky. If not set properly, your user may be logged in when the Session expires. If you’re app depends on Session specific to the logged in user, you’ll have problems. By default, the Authentication timeout is 30 minutes while for that of Session is 20 minutes. Here’s how you can change that on a site wise basis:
-
JQuery is now 1st Party for Asp.net - Kinda
Wow...AMAZING…Hurray…I mean, like, WOW man…
-
LiveWriter Test
Checking out the new wave 3 beta of Windows Live. Love the new messenger(v9) so far…now testing LiveWriter. Looking good.
-
Disable Caching in an HttpHandler
I was generating some custom reports in Word 2007 format today. The reports were being served by an HttpHandler and various params are passed to it (mostly by query string). One report needed a list of ids to be passed and the query string wasn't an option there, so I put that in Session. [My other post today shows how]. The trouble was that the urls were identical and someone clever (the browser or the server) was caching the report. So, changing the parameter that was made up of ids resulted in no change of the report. Now, output caching is pretty simple to eliminate on pages, and for asmx web services for that matter, but I found that doing so for a handler is slightly tricky. Here's what I did:
-
How to use Session values in an HttpHandler
When writing a custom HttpHandler, by default you have no access to the Session object. Doing something like HttpContext.Current.Session also returns null. The workaround is quite simple:
-
FTP Woes and....FireFTP to the Rescue!!
I'm running Vista x64 sp1. I've had IE 7 and then IE 8 (b2) installed. I tried uploading via ftp from a)Windows Explorer, b)Visual Studio ftp, c)FireZilla, d)SmartFTP. Small files uploaded perfectly but even 150KB files kept timing out and retrying. Active/passive didn't help. Nothing helped. I tried for 28 hours to upload a 340KB file. It was infuriating. I tried from another ISP's connection. I tried from XP. Nothing worked. God knows why. I contacted tech support, they said it was a problem on my ISP and that my connection was poor. While I agree a 100kbps upload isn't good at all, I do expect to upload 100KB in a few minutes and not failing for hours. I can't be too sure about their response as people using my ISP DO upload via ftp. I sent my files to a friend in the US and he graciously uploaded for me. He mentioned it was slow. And then I needed changes on my site. Enter frustration.
-
HTML Comments, Other Comments and Some VS Tips
-
Memorystream Not Expandable: Invalid Operation Exception
There's a little gotcha with the MemoryStream class that I just found out. It has 7 constructors. The default constructor has the stream set as expandable, with an initial capacity of 0. The ctors that take the capacity set the capacity to the param, but also keeps the stream expandable. If, however, you use a ctor with the byte[] param, it initializes the stream with the contents of the buffer, but the stream becomes non-expandable.
-
.Net 3.5 SP1...finally
Fate has a weird sense of humour. I held out from installing .net 3.5 sp1 all through the CTPs, then beta 1 and beta 2. This is also the first time I restrained myself from installing new stuff (coz simply put, having to uninstall a bunch of betas and patches and what not was getting to me). Well, I couldn't hold out any longer. I downloaded the entire thing. My internet is pretty crap, so I had to download the packages individually, then run a command line switch to download the final files. After that, was a quite long install. It failed. I removed silverlight tools. Tried again. Worked perfectly. I played around for a few hours. Made a few apps. Liked the new stuff quite a bit. And then, at 4 am, I went to bed.
-
Refresh Button and Double Insert / Updates
I saw a few questions on the forums about double posting of data because of users using the refresh buttons in the browser.
-
Top Answerer: Getting Started on www.asp.net
Just made the top answerer for the Getting Started section on the www.asp.net forums :)
-
Silverlight 2b2 Screencasts...somebody went nuts!!
You have GOT to be KIDDING me...after the asp.net guys went crazy and posted a lot of great AJAX control toolkit tutorials, the silverlight guys have posted FIFTY TWO (yes 5 and 2) videos on silverlight 2 beta 2.
-
UrlRewriter.net and Themes
As I mentioned in my last post, I've finally given urlrewriter.net a try - just to get over my php faithful friends who always sneered at us for those .aspx extensions.
-
Kaspersky and ‘Banner’s
What a coincidence...my second post on my blog is also about Kaspersky. Why do I keep running into the weird things? Anyway, this should also hold for many web content filters.
-
Hey Kaspersky, Stop Slowing Down My VS
I'm finally starting off this blog about a month after Joe gave it to me...yay, awesome, yahoo (or should that be MS yahoo?).