I'm currently in the process of building a forum like site where people can register and login to their own page to post content.
I have built the system to send off a verification link to the registrants email along with a link that contains their user user id which is their email on the URL
http://localhost:50490/ForumTest/ActivateProfile.aspx?Username=jason90#yahoo.co.uk
I need to know how I can get my SQL database table [UserTable] field UserVerified to update to "1", it is currently set to "0" by default.
I just need to know how to write the code behind the ActivateProfile.aspx page to update this data field when the Users hit the Activate button on this page.
Would be awesome if someone can help me with this
I have been trying to find solutions everywhere but its all based on examples that were made using the CREATE USER WIZARD on the Microsoft Visual Studio environment. all my forms and fields have been made manually therefore those example were of no use for me :(.
Hope someone can help me
Thanks a lot in advance
:)
Do you have an existing Database connection? You need to execute some SQL similar to this:
UPDATE UserTable SET UserVerified=1 WHERE Username='jason90#yahoo.co.uk'
Related
I have a website with products part number in it. I want to know if it is possible to search this part number in other website search box. That means to insert the string to the other website search box and execute searching all by code behind?
Admitting you're not the owner of the other website and you don't know how it works :
When you click to the "Search" button of the other website, it triggers a request against the webserver : something like a GET or POST, or maybe the same but through an Ajax request.
It depends of the targeted website, but the best thing to do is probably to get the information about this GET or POST (very easy with Firefox or Google in the Network tab) and to process it yourself from your own application's code using an HttpWebRequest (for example).
This approach is easier and safer than to try to mimic the "Fill the textbox and click on the button and retrieve the response" action, but this is possible too (with web testing frameworks for example : watin, selenium...)
Concretely :
Go to the website you want to dig in
Open "Net" tab of your google chrome / firefox / whatever you want, enable it
Fill the search textbox
Click the search button
Look at the request and response appeared in the browser : you will know how to send a "search" query and the format of the answer returned.
This is general advices, not a definitive answer, because you don't provide enough details to help you more, but I hope this will be helpful !
I m looking for some code to enter data in another website without API,
Front end should be my website and in back end automatically the data enters in the another website and get revert from there and give me the message/proper content in my website..
So is there any type of code is available for that in c#??
Guys please suggest me if there is any way to do this.
I tried some web services but it didn't helped.
Just a suggestion : You can have a single database for both of your web sites. from one site you can insert the data and you can use other website to retrieve it.
I am looking for some open source ASP.net script that basically creates an IIS site automatically. Basically a user will enter the domain name they want (myname.mysite.com [it will always be a subdomain of mysite.com]) they would pick a username and password, and enter some other contact information. I would also add some other options that are specific to our program but these will be coded later and are not important to this question. Once they click submit it would create the Databases, DNS, create default pages, set permissions to those pages, etc.. Has anyone seen anything that can do this or would I need to create something like this from the ground up?
You can use Microsoft.Web.Administration as in this blogpost
Or you can use System.DirectoryServices as shown here
ASP.NET MVC3 newb here.
I am working on a MVC3 intranet application that uses windows authentication. Windows auth is setup and ready to go no problem.
What I need to happen is to capture the username (Domain\first.last) whenever a user accesses the app for the first time and then store that information into a database and associate that name to a another unique identifier (numeric and auto-incremented).
I already found a way to get the username:
string user = WindowsIdentity.GetCurrent().Name;
What I am having an issue with is taking that variable and storing it in my database.
Any suggestions, hints, tips or nudges towards helpful resources are greatly appreciated.
Apologies if this scenario was posted elsewhere, if it was then I was unable to locate it.
Cheers Guys!
Be careful - user names and display names can change. I would avoid storing them in the database.
Instead, look at storing the SID (id of the user). The User property of the WindowsIdentity returns the SID. You can store and update the user name for display purposes but don't rely on it for typing the authenticating user back to the previous user in your DB.
See this SO post as well:
How can I get the SID of the current Windows account?
Persist the SID (along with username for display only) and look up via SID.
I think what you are looking for here is really 'how to store some info in a database'
What database system?
Check out
http://www.datasprings.com/resources/articles-information/a-quick-guide-to-using-entity-framework
You can easily use the entity framework to store that value in the database which is what I think your question was really about. I do agree with Bryanmac though, you should be storing the SID not the login name in case the name changes. If you know it will NEVER change then you could store the name, but since they can technically change in Windows, I'd be aware of this.
If you have a specific question then on how to store that field using the Entity Framework, please post that.
When you create your MVC3 application, there is an option for "Intranet Application" that has all of the Windows Authentication stuff working already, you might want to check that out and pull over pieces of the code for your current project (or migrate what you have depending on how far you are).
It has some special code placed into Web.Config as well as the extra files it creates.
Read more here:
http://weblogs.asp.net/gunnarpeipman/archive/2011/04/14/asp-net-mvc-3-intranet-application-template.aspx
and here:
http://msdn.microsoft.com/en-us/library/gg703322%28VS.98%29.aspx
Also you'll want to use User.Identity.Name to reference the person viewing the website.
I'm using facebook sdk. After the user authenticates to my application, I have his 'Likes' permission.
Can I add "like" to a product page automatically?
I'm not 100% sure on what you're asking, but here is some information which may be relevant.
Requesting a 'user_likes' permission will give you access the items a user has previously liked.
In order to programatically like something, (I believe) that entity has to exist within facebook - taken from http://developers.facebook.com/docs/reference/api/
/OBJECT_ID/likes Like the given object (if it has a /likes connection)
To do this you'll have to request the 'publish_stream' permission and then do something like:
// untested!
var app = new FacebookApp();
app.Post("OBJECT_ID/likes");
Failing that you'll have to add a like button (http://developers.facebook.com/docs/reference/plugins/like/) where the user will have to click themselves
Hope that helps :)
If I understand your question correctly, you want to add like buttons to product pages on your site. You are looking for the open graph api.
http://developers.facebook.com/docs/opengraph/