If your in or around Sydney, we're looking for a talented and versatile senior .NET developer to join our team. You'll be responsible for developing some exciting new features for our current applications and also getting your hands dirty building new web-based products moving forward.
If it sounds like something you'd be interested in we'd love to hear from you.
Implement seven application-level
techniques to safeguard your password-protected ASP.NET apps.
Kevin made a post about ASHX files recently. Like Kevin, I found the documentation on HTTP Handlers very light, in fact I heard about them by attending a talk by Jeff Prosise on Power ASP.NET. Another interesting technique I picked up from Jeff's talk was a method to cache a database table using the built in caching features of ASP.NET.
This involves creating an extended stored procedure which basically touches a file to update the date/time it was last modified. Then you create an Update/Insert/Delete trigger on the table that is in the cache to call the extended stored procedure. Finally, create a file dependency on the cache to update when the file is updated.
Plenty of articles on developing and debugging Web apps, extracting performance data, using page templates, and more
Peter comes up with a solution to a problem I have come across several times before.
I have made a post
over at the asp.net
forums about binding a SqlDataReader to a Repeater control but can't
seem to get a straight answer. OK, I know I should be closing a DataReader when
I'm finished with it, if I don't the connection doesn't get closed properly and
after a while the web site will fall over.
But what about when you are binding a DataReader to a Repeater or DataList
control? The DataReader is never closed, does the Repeater control handle this
for me?
I have looked at 2 sample applications to see how they handle this, IBuySpyStore and the ASP.NET
Forums. IBuySpy passes a SqlDataReader to the Repeater or DataList control,
but the Forums read the data from the SqlDataReader into a collection of
objects, close the DataReader and bind the collection to their control.
Maybe I should be using the second technique, but I really like the simplicity
of just binding a DataReader straight to a Repeater control.
I have started using the TallPDF.NET component to create a dynamic PDF report and bumped into a little problem when I had to specify the background colors for various parts of my report. I could use the VS.NET intellisense to give me a list of all the avalible colors, but who knows what Chartreuse looks like?
So I put together a simple Windows Form that has a comboBox and a panel, and added some code to add all the colors to the comboBox, and on SelectedIndexChanged modify the background color of the panel.
To add the colors to the comboBox:
foreach (string colourName in Enum.GetNames(typeof(KnownColor)))
{
comboBox1.Items.Add(colourName);
}
And then add an SelectedIndexChanged event to the comboBox with the following code:
string cName = (comboBox1.SelectedItem as string);
Color newColour = Color.FromName(cName);
panel1.BackColor = newColour;
Top 10 ADO.NET tips from Visual Studio.NET magazine.
Chad has written about an interesting technique for integrating HTML reports into a WinForms application that was of particular interest to me. I have been working on a WinForms app that required a basic report, and I looked at the option of creating it in HTML but decided not to for a few reasons. Problems with printing was the main issue, such as the inability to display the column headings at the top of each page and the extra header/footer IE puts in by default when printing (page title in header, URL in footer).
In the end we used Crystal Reports.NET, which I had very limited experience in but managed to get things working. There were a few problems we bumped into with CR.NET, such as having to store images as BLOBS if we wanted to pull them out in the report dynamically. There was also no option of printing the report in landscape by default;the user has to manually change the properties in the print dialog.
I was planning on using CR.NET on another project coming up soon which requires a PDF to be created from data sitting on a remote web server, and then upload the file up to the server, which would then be accessed from the web site. But it looks like there might be a much better solution. Scott gave some praise to the Tall PDF.NET component, which would allow me to create the PDF on the server. I just hope they have improved the documentation with Version 2.
More Posts