Feed Icon  

Contact

  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics

Tags

Open Source Projects

Archives

Ads

Sending Mail in ASP.Net 2.0

Posted in ASP.Net/Web Services at Wednesday, December 21, 2005 8:56 AM Pacific Standard Time

I hit an issue with the retrieve password control today when I tried to retrieve my password from my site. It threw an exception about the from address not being specified. After a quick google I came across this link that explains how to configure as well as send mail in ASP.Net 2.0.

System.Net.Mail reads SMTP configuration data out of the standard .NET configuration system (so for ASP.NET applications you’d configure this in your application’s web.config file).

Nice and easy! Thanks!

__pendingCallbacks[...].async is null or not an object

Posted in ASP.Net/Web Services at Tuesday, December 20, 2005 1:57 AM Pacific Standard Time

I ran into this issue today while working on my personal ASP.Net 2.0 project. I was getting the error when my callback function (client side) was running one of my custom javascript methods. I did a little googling and came across this post which didn't tell me about my problem specifically, but there were lots of comments about it:

And... does someone after this change gets som kind of bug , when calling method from server and gets "PendingCallbacks[...].async is empty or it is not an object" error on JavaScript Side?

My App still works, but i can not track this bug. Can anyone help?

It turns out that the issue is related to variable scoping in the ASP.Net client side functions:

Actually, if MS replaced the following script code WebForm_CallbackComplete:

for (i = 0; i < __pendingCallbacks.length; i++) {...}

with:
for (var i = 0; i < __pendingCallbacks.length; i++) {...}

("i" is now locally declared instead of the global scope)

.. that would solve most of our problems, I think.

Sure enough, this solved my problem. In my custom javascript method I had a for loop using a variable named “i“ so I was changing the value in the “i“ of Microsoft's code and causing the exception. So if you hit this issue, make sure you don't use “i“ and/or make sure your variables are properly scoped.

 

 

CreateUserWizard.SendingMail Event

Posted in ASP.Net/Web Services at Wednesday, December 14, 2005 7:00 AM Pacific Standard Time

This example code from this MSDN page had me stumped for awhile today:

void Createuserwizard1_SendingMail(object sender, MailMessageEventArgs e)
  {
    // Set MailMessage fields.
    e.Message.IsBodyHtml = false;
    e.Message.Subject = "New user on Web site.";
    // Replace placeholder text in message body with information
    // provided by the user.
    e.Message.Body.Replace("<%PasswordQuestion%>", Createuserwizard1.Question);
    e.Message.Body.Replace("<%PasswordAnswer%>",   Createuserwizard1.Answer);
  }

Everytime I signed up a new user it was have <%PasswordQuestion%> and <%PasswordAnswer%> in the body of the message. This totally frustrated me until I that e.Message.Body is just a string and there the Replace method is the standard replace method. Now do you see why it didn't work?

 

Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

Posted in ASP.Net/Web Services at Wednesday, December 14, 2005 2:26 AM Pacific Standard Time

I ran into this issue today when working on a personal site that I'm developing with ASP.Net 2.0. The error is not very descriptive and it took a little hunting to find this explanation by sholder:

I hit the same issue just now...and you are the only one I could find
who was having the same problem. The good news is I figured it out...I
thought it might have to do with the name of the page (based on the
error we were both receiving). I renamed my page from Login.aspx to
MemberLogin.aspx. I recompiled and deployed. Everything worked!!!!

So it seems the issue is with the fact that both types are Login so ASP.Net fails when it tries to run it. However, instead of renaming my login page I was able to get around the error by unchecking “Allow this precompiled site to be updatable”. So I'm guessing the issue (which apparently didn't exist in beta 2) is do to some of the magic that allows you to update your DLL files without updating your aspx files.

WindowBlinds 5 and Aero Glass

Posted in General at Thursday, December 1, 2005 3:31 AM Pacific Standard Time

From Sam Gentile:

Photos: View images of WindowBlinds 5

Look at the photos and you judge! I've got it installed and I have the full Beta 2 Glass title bars, alpha blended windows, new Start menu, etc. Check out this theme I have installed. Full Glass effects and lots of other stuff! Its freaking unbelievable!!

I used to use WindowBlinds when it first came out, but I haven't tried it for some time. Sam's post inspired me to give it a try and I must say it has gotten much better. So good that I went ahead and bought it just so I could use that same theme he is using. However, it took me awhile to figure out where to get it. So if you're looking for it here it is.