.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

MVC Membership with Email Confirmation

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
 
In an MVC application I'd like to use e-mail addresses as user IDs (e.g. "your e-mail is your user id").When a new user registers with the App, I'd like to send an e-mail with a confirmation URL (e.g. "click here to activate your new account") which will direct the user to a page in the app.Any suggestions how to proceed with this?Thanks,Eric


View Complete Post


More Related Resource Links

Updating Email of Membership

  
Hi I have this form to update a users details. This really should work but doesn't seem to want to update the email, isApproved etc. The onload data is within "If not ispostback". I can't see why this won't work. It is attached to an update button btw.Dim UserId As Guid = New Guid(Request.QueryString("UID")) Dim current As MembershipUser = Membership.GetUser(UserId) current.Email = EmailTxt.Text current.Comment = CommentsTxt.Text current.IsApproved = ApprovedChk.Checked Membership.UpdateUser(current)      

Get application URL (for use in confirmation email)

  
Hi,I want to send a link in an email to a user.   (say my route is "Registration/Confirm/{id}")So I need to get the current url (when hosted, I'll know what it is, but now I'm developing on my localhost, in the future it can be on a staging server, later on a live host, and I dont want to need to come back and remember changing things like this).sth likestring link = [my current url] + "Registration/Confirm/" + id.ToString();(The reason I put itl like this is bcause for now I do not send an email, but just display a view with the link on it.  Get it from ViewData (which my controller action populate after determining the url)Anyone?

Can't update the Membership email address

  

In my update Membership account routine, I have the sub:

    Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
        'Update this account in the database
        Membership.GetUser.Email = TextBoxEmail.Text

        Membership.GetUser.ChangePasswordQuestionAndAnswer(HiddenFieldConfirmPassword.Value, TextBoxQuestion.Text, TextBoxAnswer.Text)

        Dim dcMembership As New MembershipDataContext()
        Dim vUserId As Guid = Membership.GetUser.ProviderUserKey
        Dim vMembershipRecord = dcMembership.wmsUsersPlus.SingleOrDefault(Function(x) x.UserID = vUserId)
        If vMembershipRecord IsNot Nothing Then
            vMembershipRecord.FirstName = TextBoxFirstName.Text
            vMembershipRecord.LastName = TextBoxLastName.Text
            dcMembership.SubmitChanges()
        End If
    End Sub

This sub runs successfully and everything is updated, including the membership question and answer, except the membership.getuser.email address which is not updated.

In de-bug mode, TextBoxEmail.text contains the updated email address but the membership record is not updated.

Conversely, I can get the current email address successfully earlier in the code with:

TextBoxEmail.text = Member

GridView Confirmation Box Using JQuery BlockUI in asp.net

  
JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

GridView Confirmation Box Using JQuery BlockUI

  
JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Adding Client-Side Confirmation When Deleting

  
The JavaScript confirm(string) function displays its string input parameter as the text inside a modal dialog box that comes equipped with two buttons - OK and Cancel (see Figure 1). The confirm(string) function returns a Boolean value depending on what button is clicked (true, if the user clicks OK, and false if they click Cancel).

PrintPocketCE Print Pocket Excel, Pocket Word and email files

  
Version 3.560 (May 15, 2009):
bullet

Important bug fix: a slight difference in how some devices create fonts was causing a few devices to have significantly longer print times for large print jobs.
bullet

Adjusted PocketJet printer paper feed commands
bullet

Other minor fixes and enhancements.

Version 3.559 (Mar 5, 2009):
bullet

Added support for Martel MCP78xx printers

Version 3.558 (Aug 20, 2008):
bullet

Added support for Martel MCP78xx printers

Version 3.557 (June 27, 2008):
bullet

Fixed error in Canon printer support
bullet

Fixed COM0 port selection

Version 3.556 (June 15, 2008):
bullet

Added support for Brother MW-260
bullet

Added support for Sato MB400

Version 3.555 (Aug 8, 2007):
bullet

Added support for Pentax RuggedJet 3 and RuggedJet 4 printers
bullet

Changed Epson TM-P60 support to maximum page width of 1200 dots

Version 3.551 (Aug 1, 2006):
bullet

Added Peripheral Nomad printer support

Version 3.550 (Mar 23, 2006):
bullet

Added Panasonic JT-H200PR printer support
bullet

Added Pocket Spectrum printer support
bullet

Fixed problem with WM5.0 "inverted image" problem

Send Email from SQL Server Express Using a CLR Stored Procedure

  
Problem
One of the nice things about SQL Server is the ability to send email using T-SQL. The downside is that this functionality does not exist in SQL Server Express. In this tip I will show you how to build a basic CLR stored procedure to send email messages from SQL Server Express, although this same technique could be used for any version of SQL Server.

Solution
If you have not yet built a CLR stored procedure, please refer to this tip for what needs to be done for the initial setup.

Sending a File Using Email Helper in WebPages/Razor

  

Note: This is particularly with respect to Email Helper in WebPages/Razor. Please don't post links using System.Net.Mail object.

Following this tutorial: http://www.asp.net/webmatrix/tutorials/9-adding-email-to-your-website

Under "Sending a File Using Email" section what exactly is the code trying to do.

1: The SendFile.cshtml does not have any option to select file.

2: ProcessFile.cshtml is running fine. I am getting the email but no attachement.

I tried changing fileAttachment input to type="file" but not file is being sent to my email. I just get the message send in body.

Question: How exactly this file attachment works using Email Helper in WebPages.



Linq - add data to database then email user the details

  

Hi all

I'm not sure how to structure the code for this but what I want to do is be able to add data to a database, and once this has completed successfully, then email the user to say the details have been added successfully to the database.

I need to:

1. Check that the relevant data has been added into the database then

2. Email the details of the relevant data when completed. 

 

Thanks in advance for your help,

Laura

 

 


Multiple membership providers

  

Hello,

In my web.config I have:

   <membership>
      <providers>
        <add name="ADProvider1"
             attributeMapUsername="SAMAccountName"
             enableSearchMethods="true"
             type="System.Web.Security.ActiveDirectoryMembershipProvider"
             connectionStringName="ActiveDirectoryConnection1"
             connectionUsername="Test1"
             connectionPassword="pw1"/>
        <add name="ADProvider2"
             attributeMapUsername="SAMAccountName"
             enableSearchMethods="true"
             type="System.Web.Security.ActiveDirectoryMembershipProvider"
             connectionStringName="ActiveDirectoryConnection2"
             connectionUsername="Test2"
             connectionPassword="pw1"/>
      </providers>
    </membership>


If I just have ADProvider1 it works, when I add ADProvider2, even though for testing I only use ADProvider1 I get an error: "Unable to establish secure connection with the server"

Am I adding the second provider to the membership section incorrectly?

Thanks,

Mark


Replacement options for Membership

  

Hi everyone,
     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenticated, while others properly show me as authenticated. I built a site based on VB.
I was wondering what other people are using ro register users and monitor authentication and also if anyone has had better experiences with other solutions. 

Hi everyone,

     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenti

Using CreateNewUserWizard SendingMail method to email me, not applicatnt.

  

I have staff area of my site I am protecting with forms authentication using c# and .Net 4.0. What I want to do is let the staff members register on the site but instead of the confermation email being sent to them I want it sent to me so I can go in and approve it. I have been trying to use the SendingMail method  but can not figure out how to get it to email me instead of the person that registered. I have searched around this site and find many topics on the SendingMail method but none seem to properly address my issue. Can anyone help me out?


Pass ASP.NET membership identity object across domain?

  

I am trying to figure a way to SSO with ASP.NET membership and role model.

I can implement custom membership provider which consume web services hosting on a server.

With encryption of data. No problem.

But my question is, If I sign on a website with my provider, got my identity object on that application,

could I pass it to another website on another domain which use the same provider and by doing so, do not need to login again?


If this is possible, I am going to implement this solution. Please tell me what's your take on this.


Membership Search user

  

Is there a membership function to search a username Like this:   LIKE '%UserName%' ?


This is not working.

MembershipUser User = Membership.GetUser("%" + TextBox1.Text + "%");


Thank you.



Membership Provider Conn String

  

Hello. I've bee successfully using the Asp.Net Membership Provider in my VB.Net 3.5/SQL 2005 web app for a year now (Site A). However, I've added 2 new sites (B and C) (both with their own DB) and now I see a problem. It looks like users that get created for sites B and C also get created in site A. Roles that I create for B and C only get created in A. I think it is a conn string problem.

When I created A, I adde the conn string to my machine.config (not sure why I did this or if it is even needed)...

MACHINE.CONFIG

<connectionStrings>
         <add name="LocalSqlServer" connectionString="Data Source=VS689\SQLEXPRESS;Initial Catalog=SiteA;USER ID=sa;PASSWORD=123456"/>
</connectionStrings>

In my WEB.CONFIG

<membership>
            <providers>
                <clear/>
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=blahblah" connectionStringName="LocalSqlS

How to send an email with information in query string

  

First I will say I googled (Binged to make Bill happy) for this but could not find anything, perhaps I am not stating what I need correctly;

I have a website that a customer creates orders (for a printing company) and after the order, I would like to email the customer a link to view the status of their order;

I need to send the CustomerID in the link so on the returning page if a CustomerID is detected in the querystring, I "auto login" the client and open the "Dashboard" for the order page for that customer.

Can anyone point me in the right direction as to how to send the link and how to parse the querystring to get the values from the link;

Thank you if you can point me in the right direction.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend