Saturday, December 06, 2003

New Category Added

Added a new category for .NET General Tips and Tricks.

http://radio.weblogs.com/0131777/categories/generalNetTipsAndTricks/

http://radio.weblogs.com/0131777/categories/generalNetTipsAndTricks/rss.xml

 


10:27:16 PM    
comment [] trackback []

Showing Client Dialog

When writing an ASP.NET it may come in handy to pop up an alert box. For example, I was completing some code for a customer that was doing a login dialog. One of the requirements was to show an alert dialog when the login failed. This is pretty easy using the following code within an ASP.NET page.

Private Sub btnLoginAccount_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoginAccount.Click

Dim ws As New localhost.SweetsService
Dim ValidUser As Boolean
ValidUser = ws.ValidateUser(EmailID:=TxtUsername.Text, Password:=TxtPassword.Text)

If ValidUser = True Then
CurrentUserEmail = TxtUsername.Text
FormsAuthentication.SetAuthCookie(username:=TxtUsername.Text, createPersistentcookie:=
False)
Else
Response.Write("<script>alert('Invalid username/password')</script>")
End If

TxtUsername.Text = ""
TxtPassword.Text = ""
End Sub


10:08:27 PM    
comment [] trackback []

Let it snow!

The snow is coming down pretty hard. Actually been snowing on and off for most of the day. I hear that we are going to get almost a foot. Well winter is here!

Looking out my window the local complex is pretty well blanketed with heavy snow coming down. According to the car it looks like about eight inches have fallen up to this point. I am believing that we will get more than the foot.


5:25:08 PM    
comment [] trackback []

SMTP Class

Wanted to send email from .NET? Well here is a quick class that you can use to send email with.

Imports System.Web.Mail
Public Class SendMail
Public Function SendPurchaseMessage(ByVal EmailAddress As String)
Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage

Message.To = "Who the email is going to"
Message.From = "Who the email is coming from"
Message.Subject = "Message Subject"
Message.Body = "Body of the message"
SmtpMail.SmtpServer = "Enter your SMTP server"
SmtpMail.Send(Message)

End Function
End
Class


5:20:55 PM    
comment [] trackback []