sandi sandi
Nuke Active Member Posts:28
|
01/18/2006 8:23 AM |
|
Dear Lee,
Hope you are doing fine. We want to modify the DNN’s register module. With DNN’s basic fields, we want to add few customized fields. Can you please tell me how should we do this.
We have open the DNN source code and now trying to change design of register page from Register.ascx. And also thinking to change the code from Register.ascx.vb. Is it right approach?
An immediate reply would be appreciated.
Thanking you,
Sandi
|
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
sandi sandi
Nuke Active Member Posts:28
|
01/19/2006 10:37 AM |
|
Dear Lee,
Thank you for prompt reply. I already have gone this link before. And basically we cannot afford to buy anything, but want to develop that module. So please suggest where we can get help regarding how to develop/customize Register module.
We have now found that there are two controls ( user/addresses ), which DNN is using into register module. So we are thinking to change these controls.....
Or add our new control (we have created new control but not know how to use it into existing register module..)... Please let us know which option could be better for this..
Please reply as soon as possible.
Thanking you,
Sandip |
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
01/19/2006 11:02 AM |
|
Ok, If you are going to develop your own module then think carefully how you are going to do it.
For instance, I would not alter any of the core tables or procedures for DNN. - The reason for this is because it will cause you a massive headache if you want to upgrade your installation in the future.
If I was programming this I would create a completely separate module which would link to the user account by the User ID - so in your own user table you will have a User ID number which will link to the User ID number in the DNN users table.
From here you can build your module and forms to collect any data that you require.
(This is all theory, I haven't put it into practice)
Within DNN once you have created your separate module you can place the user account module and your module on the same page to collect the data you require. (see this post for how to configure DNN for this)
Or a better method would be to take elements of the account module that you require and create a module that inserts data into the user table and then into your own user table.
To do this you would have to insert data into the DNN user table, collect the userID that has just been created in the DNN user table and then insert that UserID into your personal user table with the additional data that you have collected.
These are my first thoughts and would probably be where I would personally start working. - Other developers may approach this from a completely different angle, so it maybe worth asking for second and third opinions.
I would try the asp.net forums (in the Custom Modules section), especially when you begin developing the module as the developers there will be able to share their experiences and thoughts with you.
The main thing I would say is do not alter any of the core code, tables, procedures etc.
Follow this link for Resources for Developing DNN Modules
Hope this provides you with a starting point, |
|
Lee Sykes Site Administrator Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts
Twitter: www.twitter.com/DNNCreative
|
|
|
sandi sandi
Nuke Active Member Posts:28
|
01/19/2006 11:29 AM |
|
Dear Lee, Thank you again for your quick reply. I am feeling nice that we thinks exactly same. Infact we have already design the database accordingly (for using USERID into our tables). We are doing the same things which you are suggesting...thanks for your suggestions and instructions... we won't change any core code (atleast not major things...).. We are trying to instert data into our tables...but was getting some error and then DNN's registration was abruptly ending without creating new login.. I will re-debug and see how to make it work...will update you again on further developments.. Thank you for your help.
Thanking you, Sandi
|
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
sandi sandi
Nuke Active Member Posts:28
|
01/30/2006 7:43 AM |
|
Dear Lee,
Thanks for your support…
I have completed half of the module. Now, I am able to save/update registration forms from our database. We are storing few fields (username, password and confirm password) into DNN’s database as well as our database. We are taking these information from our own controls and saving into DNN’s (User, profile etc) tables. As we have completed our own registration form; now we want to hide the DNN’s controls (User, Address) so that we can just show our controls. From registration page, when we tried to put those controls into comments, we got JavaScript errors. As some of the validetors are getting called and there is ‘undefined’ value into those validators.
We are thinking to comment that (javascript) code too… with taking care that it should called for rest modules. So are we going right…. or is there any other way to hide the DNN’s control.
Please reply as soon as possible…
Thanking you,
Sandi |
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
01/30/2006 8:00 AM |
|
Hello Sandi,
Glad to hear you are making progress.
If I want to hide asp.net controls then I will control this directly from the asp.net code.
I can't recall the code off the top of my head, but you can set it so that you set the visibility of a control based on what security role a user is assigned to.
So for instance, if you only want the administrators access to view the control, you can set it up so that it queries what security role the user is assigned to and if they are an administrator it will then set the visibility of the control to true.
Does this make sense?
Have you looked at the Seabury videos - I think they cover that. - Otherwise I would have a look at the code for another module where they implement links that are displayed dependant on who is logged in - the forum module or repository module should cover this.
Hope this helps, thanks,
|
|
Lee Sykes Site Administrator Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts
Twitter: www.twitter.com/DNNCreative
|
|
|
sandi sandi
Nuke Active Member Posts:28
|
01/30/2006 8:22 AM |
|
Dear Lee, Thanks for quick response… Yes I know that we can hide the rows or controls from ASP.net code (by setting visibility false)… but when we tried this we were getting errors of javascript… that is some of that validators are not as object or undefined. (Since they are hide..) Another problem in this case is though we hide it, it takes space on the form… so If we hide user control..(which has first name, last name, username, password, confirm, email and website…)… we wont see it on registration page but still there will be space…. In the last we can also remove that space by using some html coding… But our first problem is after hiding or commenting control, there should not be any error comes on page…
Regarding code for role checking… that we can do..but we want only one registration page, which should visible to all, so this is not the issue. We will try to remove/hide control and remove the errors. Please suggest any other source or way to do this… Thanking you, Sandi
|
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
sandi sandi
Nuke Active Member Posts:28
|
01/30/2006 9:46 AM |
|
Dear Lee, We have changed the DNN’s registration page and put our own controls (Customer Control and Contact Control). While doing this we preferred to use DNN’s Registration page, since we want to use rest DNN’s functions. Now we have our controls at registration page and we want to remove ‘User’ and ‘Address’ control. We will try to hide them or remove them with their code and validation java script. We are not able to find, from where it’s validation script is calling. Once we find this we will remove it. So that no call to script will be given. Hope you have cleared what is our problem. So, mean while if you find any help on this please send us. Thanking you, Sandip
|
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
sandi sandi
Nuke Active Member Posts:28
|
01/30/2006 11:27 AM |
|
Dear Lee,
We have commented the code for User control from registration page. Also in User control we have remove the Requiredfieldvalidators. Still we are getting javascript error in function ValidatorOnLoad() {} and one more function. (I have pasted some funcations here from webUIvalidation.js... I copied it where I got error while debug it...)
We have removed validators from User.ascx and code from user.ascx.vb. Also Removed code from Registration page (register.ascx and register.ascx.vb) which is calling User control. And still that script is calling. We don’t why and from where is getting called.
We just want to stop that script to be called. And I think we can’t to that as this file is having path as http://localhost/…WebUIValidation.js . There is no such file exist when I search through my machine.
So this may be the run time generated file. Well, so we need to restrict to get calling this file.
Can you suggest some way , how to do this.
Thanking you,
Sandi
************************************
http://localhost/...webUIvalidations.js
var Page_ValidationVer = "125";
var Page_IsValid = true;
var Page_BlockSubmit = false;
function ValidatorUpdateDisplay(val) {
if (typeof(val.display) == "string") {
if (val.display == "None") {
return;
}
if (val.display == "Dynamic") {
val.style.display = val.isvalid ? "none" : "inline";
return;
}
}
val.style.visibility = val.isvalid ? "hidden" : "visible";
}
function ValidatorUpdateIsValid() {
var i;
for (i = 0; i < Page_Validators.length; i++) {
if (!Page_Validators.isvalid) {
Page_IsValid = false;
return;
}
}
Page_IsValid = true;
}
function Page_ClientValidate() {
var i;
for (i = 0; i < Page_Validators.length; i++) {
ValidatorValidate(Page_Validators);
}
ValidatorUpdateIsValid();
ValidationSummaryOnSubmit();
Page_BlockSubmit = !Page_IsValid;
return Page_IsValid;
}
function ValidatorCommonOnSubmit() {
event.returnValue = !Page_BlockSubmit;
Page_BlockSubmit = false;
}
function ValidatorEnable(val, enable) {
val.enabled = (enable != false);
ValidatorValidate(val);
ValidatorUpdateIsValid();
}
function ValidatorOnChange() {
var vals = event.srcElement.Validators;
var i;
for (i = 0; i < vals.length; i++) {
ValidatorValidate(vals);
}
ValidatorUpdateIsValid();
}
function ValidatorValidate(val) {
val.isvalid = true;
if (val.enabled != false) {
if (typeof(val.evaluationfunction) == "function") {
val.isvalid = val.evaluationfunction(val);
}
}
ValidatorUpdateDisplay(val);
}
function ValidatorOnLoad() {
if (typeof(Page_Validators) == "undefined")
return;
var i, val;
for (i = 0; i < Page_Validators.length; i++) {
val = Page_Validators;
if (typeof(val.evaluationfunction) == "string") {
eval("val.evaluationfunction = " + val.evaluationfunction + ";");
}
if (typeof(val.isvalid) == "string") {
if (val.isvalid == "False") {
val.isvalid = false;
Page_IsValid = false;
}
else {
val.isvalid = true;
}
} else {
val.isvalid = true;
}
if (typeof(val.enabled) == "string") {
val.enabled = (val.enabled != "False");
}
ValidatorHookupControlID(val.controltovalidate, val);
ValidatorHookupControlID(val.controlhookup, val);
}
Page_ValidationActive = true;
} |
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
sandi sandi
Nuke Active Member Posts:28
|
02/03/2006 8:01 AM |
|
Hello Lee, Hope you are doing fine.. I have removed the controls successfully... Glad to let you know that the solution behind it was very simple.... Just remove the register line (on top of the page, which uses to register the control) and controls tag from register.ascx.... thats all and rest is workign fine.. No control ref in register page hence no error.... :-) Thanks, Sandi |
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
Jimmy Singal
Nuker Posts:14
|
02/22/2006 6:42 AM |
|
Hi Sandip and Lee,
I also working on to change the register module. Could you help me also with the step by step and which files that you change?
Please advise... |
|
|
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
Jimmy Singal
Nuker Posts:14
|
02/22/2006 6:56 AM |
|
Hello Lee, Thanks for the fast reply, yes I have been read about this "ucanuse" module but the problem is we are in the early stage of define a portal so I am not sure if the management is willing to buy a 3rd party module.
If Sandi can provide an example it will be great. Also it will be perfect if it's a separate module.
Kind Regards, |
|
|
|
|
sandi sandi
Nuke Active Member Posts:28
|
02/22/2006 7:53 AM |
|
Hi J_Singal,
For changing register module you will have to change core code. So first make sure that you have source copy of DNN.
Then do as per following.
1. Try with one single text box first. Change register control and add simple text box to it. Just to sure for GUI is working.
2. Then try to change code and insert values into your table from your text box.
3. Above both steps are for just getting confidence that things are working. Then you can start with making controls and add bellow to user control (which is in register module).
I am assuming that you have gone through the core code to understand how DNN's register module works.
Let me know if get success in first two..then we will go further..
Sandi |
|
|
|
|