Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
I have a button on my site on Login Page "Login with Gmail"

VB
<asp:Button ID="btnLoginToGoogle" runat="server" OnCommand="OpenLogin_Click" ToolTip="Google_Login"
                                                        CssClass="ch_google_button" CommandArgument="https://www.google.com/accounts/o8/id"
                                                        Width="141px" />



C# code is :

C#
protected void OpenLogin_Click(object src, CommandEventArgs e)
    {
        try
        {
            string discoveryUri = e.CommandArgument.ToString();
            var b = new UriBuilder(Request.Url) { Query = "" };
            var req = openid.CreateRequest(discoveryUri, b.Uri, b.Uri);
            var fetchRequest = new FetchRequest();
            fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Email);
            fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.First);
            fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.Last);
            fetchRequest.Attributes.AddRequired(WellKnownAttributes.Person.Gender);
            fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Phone.Mobile);
            fetchRequest.Attributes.AddRequired(WellKnownAttributes.BirthDate.WholeBirthDate);
            req.AddExtension(fetchRequest);
            req.RedirectToProvider();
        }
        catch (Exception ex) { }
    }



Code is working with framework 3.5
But when i convert it to framework 4.0
it's not working......
Please solve the issue....
Thanx

Stack Trace

CSS
((System.Threading.ThreadAbortException)(ex)) {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}

ex.Data Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.HelpLink Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.HResult Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.InnerException Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.Message Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.Source Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.StackTrace Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.TargetSite Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.


For All message is same
Posted
Updated 25-Apr-14 22:39pm
v2
Comments
Sampath Lokuge 26-Apr-14 3:00am    
Are you trying this in local host or where ?
Kishor Khatri 26-Apr-14 3:09am    
on both side (local host and server), it's not working
Sampath Lokuge 26-Apr-14 3:32am    
Are there any errors or run time exception or ?
Kishor Khatri 26-Apr-14 3:33am    
yes
ex = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
Sampath Lokuge 26-Apr-14 3:34am    
Can you put whole stack trace ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900