Pages by tag

13 pages are tagged with Coding ASP.Net

To check more tags, click here  click to open

Redirected Downloads


We have files for download on a NAS.  We don't want to expose them directly to everyone hitting the site and the idea of just mapping the drives makes people go nutty so, got a fast idea?  We know that by this time it's got to be so simple that we're missing the obvious but we're going in circles and a vendor wants too much money for a bridge product.

Huh.  Does the file server run IIS or Apache/Mono?

It's a Windows server so IIS is ok but we don't want to expose it to the internet.

You don't have to, if it's on your company network just expose it internally so the web servers can hit it.  That possible?

The answer is going to slay you... open up notepad and copy this in:

Regex Ajax Jquery UserControl


This universe is fun.  Last week I was having a conversation with a budd about a validation regex and just a few days later I had the need to dig it out for myself ... lucky I put it on the sitelett (thanks Universe!).

In my case I needed to make a double listbox picker for Keywords.  Over the years I've just used Telerik controls but this is a lean webapp and I didn't want the extra baggage so I rolled my own.  ASCX with serverside needs plus Jquery/JS Ajax hitting an ASMX web service for adding new keywords on the fly without page reloads.

Demo here.  Code and some notes ...[more]

Simple person name regex


"Do you have a good regex to test a person name part entry?"

Yep.  ^[A-Za-z]+((-[A-Za-z]+)|('[A-Za-z]+)|(\040[A-Za-z]+))*$

Hack the Profile Provider


So you don't want to reinvent the wheel on an ASP.Net profile system but you need to support some perfectly understandable business rules for the profile data that the precooked Profile Provider doesn't handle well?

You just create a custom Profile Provider to hold your props in a custom table instead of that silly serial format, right? 

Yeah... but what if one of those rules requires a lookup validation and message to the user?  Your custom implemented Save() has to return void,  a status code won't work and a custom exception from SetPropertyValues will choke your web site.

Well, there's a hack for that.

Webforms Inherited Panel control


Wasn't going to post this because some magic made the original problem go away, but just in case it comes back... my sitelett search makes it easier to find stuff than searching for commented out code :-).

Needed a container control for a Repeater's ItemTemplate so users could get the info from any collection of display controls (labels, images, whatever) and just click anywhere in the set for a serverside event instead of putting a button into the mix.

Easy enough, added an inherited Panel.  Worked fine as a drop-in on test pages but when added to the Repeater and was inline bound the doPostback javascript errored out on registration.  It was being rendered correctly in the html but when used in an ItemTemplate it didn't want to even get past page_load.

So I hand-wired the Render method to use the settimeout style and poof, it worked as a list item container.

ASP.Net limited textarea for Ajax


Huh?  What?

Oh sorry, been heads down the past few ... months?  Sheesh.

Ok.  There is one thing I did the other day that I'll forget if I don't put it here.  I'm working on a few new sites and all of them at one place or another need a textarea with a character limit.

I know, we've all done these since before the beginning in one way or another.  It's no big deal to just check the length  in the postback or add a key event javascript method with an alert or whatever, and these days even adding a countdown span means just grabbing someone's freebie jquery sample. 

Those all work fine mostly.  But for this project there was a twist that threw me a fail...

WROX Professional ASP.Net MVC3 review


Wow.  If this is what a "Professional" is now expected to know, I'm sad for .Net.


ASP.Net Oracle Padding Patch


Last month an alert went out from Microsoft about a severe vulnerability in ASP.Net.  A quick workaround was stepped through but the kernal of the issue remained.

I just got this email blast from the DotNetNuke folks (very very nice of them even as I am no longer a Nuke user) about the official patch now being available as direct download AND NOW Windows Update.

No matter your OS, if you run ASP.Net you should get the updates.  If money is on the line then of course you have to check the fine print and scan the comments of Scott Guthrie's blog post and do extra testing ASAP in case you are doing some off-kilter code that hits a boundary of the patch. 

ELMAH... another vote for it


Just got an e about ELMAH.  Yes, I think its pretty fine.  Saves a lot of time, does fine with vs2010 asp.net4 for us so far... but let me tell you why we took the plunge.

Sessvars is a great tool


Need to reduce those one-off cookies, session vars or visible query strings?  This is a library that I trust (and I trust very very few these days)

<< 1 2 >> 
who is smith     contact smith     rss feed
Since 1997 a place for my stuff, and it if helps you too then all the better