Customization of LogonForm.ascx.cs

Marc Gervais asked on September 19, 2014 16:01

In order to have customizations made to LogonForm.ascx.cs available to the site, must I load the entire Kentico application into Visual Studio and rebuild it, then publish it?

Recent Answers


Brenden Kehren answered on September 19, 2014 16:28 (last edited on September 19, 2014 16:28)

It depends on how your website was setup. If you're using a web site vs. a web project all you should need to do is clone the web part in the user interface and it should copy the files for you. The open the file(s) in your favorite text editor and make your changes.

If you have a web project, you will have to recompile it and deploy it, which for a small change like this isn't ideal which is why Kentico recommends a web site.

0 votesVote for this answer Mark as a Correct answer

Marc Gervais answered on September 19, 2014 16:37

Thanks for the response, however, I have inherited this project and do not know whether it was setup as a Web Site or a Web Project. Is there a quick and dirty way of determining this?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 19, 2014 16:43

Is there an App_Code directory? Do you see any .cs or ascx.cs or aspx.cs files? If so then you have a web site and not a web project.

More of a concern to me is you plan to make modifications to a user control although unsure how to tell if it's a web site or web project. I mean no disrespect what-so-ever, just be careful of what you edit so you don't break the site and cause more problems.

0 votesVote for this answer Mark as a Correct answer

Marc Gervais answered on September 19, 2014 16:51

No disrespect applied at all - I am greener than green when it comes to Kentico and am trying to find my way around it.

So, I do have an App_Code folder and there are .cs files strewn about. Ok, now that I know I have myself a Web Site - what is the recommended method of making changes to the LogonForm? My predecessor made changes to the file located at ~/CMSWebParts/Membership/Logon/LogonForm.ascx.cs and the alterations I have made to the same file are not being recognized when running the site. I assume I have missed something or things were done incorrectly originally.

Any assistance would be greatly appreciated.

0 votesVote for this answer Mark as a Correct answer

Richard Sustek answered on September 22, 2014 10:31

Hi Marc,

Thank you for your message.

If you are using Kentico as a web site then all changes should be applied right after you modify the files. I have customized the LogonForm.ascx.cs file many times in Web site project.

Could you please make sure that you are using the LogonForm webpart? Can you try making some more visible changes? Maybe try adding some static html to the LogonForm.ascx file so that you can be sure you are using the right webpart.

Let me know if you have further questions.

Kind regards,

Richard Sustek

0 votesVote for this answer Mark as a Correct answer

Marc Gervais answered on September 24, 2014 15:21

Richard:

Thank you for the response.

We are using Kentico as a web site and most changes are visible immediately; however, changes made to LogonForm.* are not and I cannot seem to figure out why.

We are using the LogonForm webpart and I have made some visible changes that are not visible. Is there a quick way of determining whether someone has replaced the default LogonForm webpart with another? Perhaps I am making changes to something that is no longer used.

Thank you.

Marc.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 24, 2014 23:49

You might look in the webpart definition and see if the file path/name is the same one you are editing. It could also be that there is an error causing it to not load the most current version but its loading the last known working version. Check the Kentico event logs to see if there are errors.

0 votesVote for this answer Mark as a Correct answer

Richard Sustek answered on October 2, 2014 14:54

Hi Marc,

This definitely sounds like you are using a different webpart. Most probably the guys before you had cloned the logon webpart and then used this instead of the default one. Try adding these webparts and see which one of you is the one you are looking for or try comparing their names with the ones which you can find in Web parts application.

Kind regards,

Richard Sustek

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.