Category: asp.net 2005

About Asp.net 2005

Use CustomValidator to check textbox depending on Radiobutton

For input validation I often use the Validators provided by Microsoft out of the box: RequiredFieldValidator to check whether user entered some data into the textbox, RangeValidator to check the range of numeric values or dates, RegularExpressionValidator to check the size of user input (and much more of course), CompareValidator to check dates, and today I had to use CustomValidator to check one field depending on another field.
My asp.net application contains a textbox which has to be filled if the user selected ‘Yes’ on a radiobutton. The RequiredFieldValidator does not help because you could not add a condition there. So it has to be done with the CustomValidator. I’ve searched around and finally combined several sources into this solution so here is a complete overview how to set up.

Continue reading

How to call a modal popup from backend

There are several ways to call a modal popup from asp.net. You could code it on your own using JavaScript, or you could use existing frameworks like jQuery or Ajax Control Toolkit. As I use both of them, I decided to check with the Ajax Control Toolkit as this is already implemented and no further module needs to be referenced.
You could call the modal popup from the UI or from Backend. The current posting is just a reminder for me how to use it in backend. Continue reading

Easiest way of asp.net deployment

When it comes to deployment of asp.net projects there are several ways, as described for example on MSDN. Working with ASP.net for several years I’ve found the easiest way of deployment for myself is using zip / rar to pack an archive of updated files. This works very well in both company and personal webserver configuration:

  • In company I’m not allowed to deploy directly to the live server (as this is an admin job)
  • The admin needs to be able to easily deploy the changes to stage server and afterwards to live server.
  • The admin needs to be able to identify the changed files easily.
  • At home I upload the files to my IIS via FTP as that’s easier than connecting to the machine via RDP and starting an update installation.
  • Previously at home with shared hosting I only had access to my webspace via FTP and not via Remote Desktop of course.

Bearing these requests in mind I created a simple batchfile which does this job for me. Continue reading