create Web-Part for Login-Authentication - sandboxed solution [modified]
-
Hello Friends, I am new in Web-part development. I want to create web-part. In that I need to authenticate loginname and password.(it will check it from sql server 2008 database).After successful login, it redirects to another page. how can i do this ?
modified on Thursday, January 20, 2011 5:20 AM
You are talking about Forms-based Authentication. Since you didn't specify what version of SharePoint you are using, look here[^] or here[^]
Prachee G wrote:
pls tell me complete procedure from scratch to end.
Simply, no. 1) There is far too much to teach you here. 2) You need to show some effort on your own 3) I get paid to do it work, not give it away.
I know the language. I've read a book. - _Madmatt
-
Hello Friends, I am new in Web-part development. I want to create web-part. In that I need to authenticate loginname and password.(it will check it from sql server 2008 database).After successful login, it redirects to another page. how can i do this ?
modified on Thursday, January 20, 2011 5:20 AM
I completely agree with Mark as you should try at your end first and then come back to us if you have any questions. There is no one in the code project whos is having time or getting paid for giving you the complete steps from start to end. Sometimes people may feel quite harsh when you ask someone to do so in CP. People are here to help you out but not supposed to do your work. For custom login webpart checkout the following link: http://blogs.msdn.com/b/kaevans/archive/2010/07/09/creating-a-custom-login-page-for-sharepoint-2010.aspx[^] Visual Studio 2010 has a great feature to package the source files into a deployable WSP file. For example, create an Empty SharePoint 2010 Project in Visual Studio 2010 and add a WebPart (for your custom login screen). Once you are done with the coding, then right click on the project and click on Package. A WSP will be automatically generated and stored inside bin/debug or bin/release based on the Visual Studio Solution Configuration. I hope that you have some stuffs to start. All the best. :)
There is no foolish question, there is no final answer...
-
I completely agree with Mark as you should try at your end first and then come back to us if you have any questions. There is no one in the code project whos is having time or getting paid for giving you the complete steps from start to end. Sometimes people may feel quite harsh when you ask someone to do so in CP. People are here to help you out but not supposed to do your work. For custom login webpart checkout the following link: http://blogs.msdn.com/b/kaevans/archive/2010/07/09/creating-a-custom-login-page-for-sharepoint-2010.aspx[^] Visual Studio 2010 has a great feature to package the source files into a deployable WSP file. For example, create an Empty SharePoint 2010 Project in Visual Studio 2010 and add a WebPart (for your custom login screen). Once you are done with the coding, then right click on the project and click on Package. A WSP will be automatically generated and stored inside bin/debug or bin/release based on the Visual Studio Solution Configuration. I hope that you have some stuffs to start. All the best. :)
There is no foolish question, there is no final answer...
both mark & saanj people new to this development platform write such queries. its not like they do not try.
-
both mark & saanj people new to this development platform write such queries. its not like they do not try.
Yeah, I agree with you. 5 votes for your comment. Correct me if I am wrong but MugsPat and Prachee G are the same person. So, we are getting a reply from the same person who originally asked the question. As far as our feedback are concerned, people should know what they should do and they should not in CP. That's how a new becomes old. Both Mark and myself shared some links and thoughts to your questions and unfortunately you criticize us by simply voting 1 instead of working on the solutions. Reply back if the links are not useful or if you have any questions. All the best again!
There is no foolish question, there is no final answer...
modified on Tuesday, January 18, 2011 1:53 AM
-
Yeah, I agree with you. 5 votes for your comment. Correct me if I am wrong but MugsPat and Prachee G are the same person. So, we are getting a reply from the same person who originally asked the question. As far as our feedback are concerned, people should know what they should do and they should not in CP. That's how a new becomes old. Both Mark and myself shared some links and thoughts to your questions and unfortunately you criticize us by simply voting 1 instead of working on the solutions. Reply back if the links are not useful or if you have any questions. All the best again!
There is no foolish question, there is no final answer...
modified on Tuesday, January 18, 2011 1:53 AM
May be the way of asking is wrong. I have the same query asked above. Firstly i am using sharepoint 2010 & vs2010. I have to develop sandboxed solution. I have created web part (not visual web part) in it. I am unable to user login control as it is disabled. I have created login control using Microsoft.SharePoint.Utilities & Microsoft.SharePoint.IdentityModel namespaces. I want to know 1. can we use in-built login control in web part? 2. how to use javascript in login control created using above mentioned namespaces? hope i'll get some fruitful replies thnks
-
May be the way of asking is wrong. I have the same query asked above. Firstly i am using sharepoint 2010 & vs2010. I have to develop sandboxed solution. I have created web part (not visual web part) in it. I am unable to user login control as it is disabled. I have created login control using Microsoft.SharePoint.Utilities & Microsoft.SharePoint.IdentityModel namespaces. I want to know 1. can we use in-built login control in web part? 2. how to use javascript in login control created using above mentioned namespaces? hope i'll get some fruitful replies thnks
-
Are you using the standard asp.net login control? Share the code for the login control.
There is no foolish question, there is no final answer...
i was trying to use standard asp.net login control in web page & reference that page in web part so that it becomes reusable and formatting becomes easy ....unfortunately didnt get any useful links. so used utilities & IdentityModel namespaces to create following control // create a login control var loginControl = new Login(); // hide the control if the User is already logged in loginControl.Visible = !this.Page.User.Identity.IsAuthenticated; // add event handlers loginControl.Authenticate += new AuthenticateEventHandler(loginControl_Authenticate); /Controls.Add(loginControl); } void loginControl_Authenticate(object sender, AuthenticateEventArgs e) { // validate credentials var login = (sender as Login); e.Authenticated = SPClaimsUtility.AuthenticateFormsUser( this.Page.Request.Url, login.UserName, login.Password); }
-
i was trying to use standard asp.net login control in web page & reference that page in web part so that it becomes reusable and formatting becomes easy ....unfortunately didnt get any useful links. so used utilities & IdentityModel namespaces to create following control // create a login control var loginControl = new Login(); // hide the control if the User is already logged in loginControl.Visible = !this.Page.User.Identity.IsAuthenticated; // add event handlers loginControl.Authenticate += new AuthenticateEventHandler(loginControl_Authenticate); /Controls.Add(loginControl); } void loginControl_Authenticate(object sender, AuthenticateEventArgs e) { // validate credentials var login = (sender as Login); e.Authenticated = SPClaimsUtility.AuthenticateFormsUser( this.Page.Request.Url, login.UserName, login.Password); }
Prachee, The following code that you are using is actually instantiating the ASP.NET Login controls:
var loginControl = new Login();
You may not have removed the following namespace:
System.Web.UI.WebControls
For an easy solution, you can consider using a Sandboxed Visual Webpart which gives you an ASCX file where you can add an ASP.NET Login Control. Your ASCX file will be auto embeeded with the Visual Web Part. I just added a Login control in my Sandboxed Visual Webpart and it's coming enabled only. I would like to suggest you to try.
There is no foolish question, there is no final answer...
-
both mark & saanj people new to this development platform write such queries. its not like they do not try.
I disagree. Experience here and elsewhere has shown that newbies ask these types of question without looking for the answer themselves. 1) do to a lack knowledge and 2) most likely due to project timing and being over their head.
I know the language. I've read a book. - _Madmatt
-
May be the way of asking is wrong. I have the same query asked above. Firstly i am using sharepoint 2010 & vs2010. I have to develop sandboxed solution. I have created web part (not visual web part) in it. I am unable to user login control as it is disabled. I have created login control using Microsoft.SharePoint.Utilities & Microsoft.SharePoint.IdentityModel namespaces. I want to know 1. can we use in-built login control in web part? 2. how to use javascript in login control created using above mentioned namespaces? hope i'll get some fruitful replies thnks
Is FBA enabled on the site? Have you made the necessary modifications to the web.config for the web application?
I know the language. I've read a book. - _Madmatt
-
I completely agree with Mark as you should try at your end first and then come back to us if you have any questions. There is no one in the code project whos is having time or getting paid for giving you the complete steps from start to end. Sometimes people may feel quite harsh when you ask someone to do so in CP. People are here to help you out but not supposed to do your work. For custom login webpart checkout the following link: http://blogs.msdn.com/b/kaevans/archive/2010/07/09/creating-a-custom-login-page-for-sharepoint-2010.aspx[^] Visual Studio 2010 has a great feature to package the source files into a deployable WSP file. For example, create an Empty SharePoint 2010 Project in Visual Studio 2010 and add a WebPart (for your custom login screen). Once you are done with the coding, then right click on the project and click on Package. A WSP will be automatically generated and stored inside bin/debug or bin/release based on the Visual Studio Solution Configuration. I hope that you have some stuffs to start. All the best. :)
There is no foolish question, there is no final answer...