asp.net

Emulate ASP.NET validation groups with jQuery validation validation

ValidationGroups

In WebForms, we have the concept of a ValidationGroup to mitigate the issues that come with wrapping the entire page in a single form element. Whether right or wrong in principle, this scheme does a pretty good job of keeping the ASP.NET Validation controls from getting their wires crossed on More >

Working with GDI+ in ASP.NET

The best way to start is with an example.

Creating graphics on the fly is not rocket science when using ASP.NET. First thing you need to do is add a using directive in the code-behind file:

using System.Drawing; using System.Drawing.Imaging;

Next a new instance of the Bitmap object must be created in the WebForm1 class:

Bitmap Bmp;

We’ll start by creating More >

Sending emails with ASP .NET

I can’t imagine a complete website that hasn’t got a function to email someone, either the user when he registers or the administrator when someone contacts him through the website. No doubt, ASP.NET must have a class that can be used to send emails. Actually, there are two: SmtpMail and MailMessage.

In More >

Skype May Be Shut Down

eBay, the owner of Skype since the 2005 purchase, has recently announced that due to a licensing disagreement with the founders of Skype, it may have no other option than to shut down the application.

Skype was founded by two Danish entrepreneurs, Niklas Zennstrom and Janus Friis, and purchased by eBay More >

ASP.NET 2.0 Script CallBack (Ajax like)

Download this ASP.NET 2.0.50215 (BETA) C# project (can easily be converted to VB.NET)

Download this ASP.NET 2.0.50727 C# project (can easily be converted to VB.NET)

You probably already know what Ajax does, or maybe not, but what’s certain is that you heard about Ajax because much fuss is created around it on the web.

In More >

Create an RSS feed using ASP.NET 2.0

n this tutorial we’re going to create a similar RSS feed, using ASP.NET 2.0.

In the ASP.NET 2.0 project, create a new file which will be the RSS feed. We used “TodaysHeadlines.aspx”.

Now open the markup of the file and replace everything inside it with the following two lines:

Don’t forget to change More >

Connect to Access Database in Visual Studio .NET

ou can use DataSets or DataReaders to read the information from the database. A DataReader is about twice as fast as a DataSet (according to Sams Publication). This tutorial uses DataReaders to read the data from a Microsoft Access Database in Visual Studio .Net 2003. ASP.NET web application is used More >

Accessing the controls and methods of a MasterPage

It won’t take you long to use MasterPages and feel the need to call a method or a property of that MasterPage class from inside a web form. The typical instinct is to use Master.MethodName() inside the ASP.NET web form file. Unfortunately that will not work… fortunately there is a an easy fix. More >

Initiate Download Using ASP.NET and VB.NET

  1. Private Sub FetchFile(ByVal strFromPath As System.String, ByVal strSendWithName As System.String)
  2. Dim strServerAbsPath As String
  3. Dim infFile As System.IO.FileInfo
  4. ‘ Change the relative path to the absolute path
  5. strServerAbsPath = Me.Server.MapPath(strFromPath)
  6. ‘ Will use to check if the file exists
  7. infFile = New System.IO.FileInfo(strServerAbsPath)
  8. ‘ If it does…
  9. If infFile.Exists Then
  10. With Me.Response
  11. ‘ Send headers
  12. .ContentType = “application/octet-stream”
  13. .AddHeader(“Content-Disposition”, “attachment; filename=” & strSendWithName)
  14. .AddHeader(“Content-Length”, infFile.Length.ToString)
  15. ‘ Send the file
  16. .WriteFile(infFile.FullName)
  17. ‘ Send and end the response
  18. .Flush()
  19. .End()
  20. End With
  21. ‘ File does not exist
  22. Else
  23. ThrowError(“IO Error”, “File More >