ASPX templates
Version 4.x > ASPX templates > BizForms with user's attached data View modes: 
User avatar
Member
Member
srizzetto-microgate - 3/11/2009 12:02:28 PM
   
BizForms with user's attached data
Ia have a bizform that is destinated on the public website only to authenticated users.

Is it possibile to have automatically the name of the user who have submitted ?

Or alternatively, is possibile to auto-fill some fields like firstname, lastname, email with his data ?

thanks
Sandro

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 3/12/2009 10:52:39 AM
   
RE:BizForms with user's attached data
Hi Sandro,

Please see http://devnet.kentico.com/Knowledge-Base/Web-parts---Controls/Setting-default-values-for-BizForm.aspx for example how to pre-fill values into some fields of BizForm. The only difference in your case is that you will acquire data from CMS.CMSHelper.CMSContext.CurrentUser object instead of query string.

Best Regards,

Martin Dobsicek

User avatar
Member
Member
brian-hedtec - 4/13/2009 12:29:56 PM
   
RE:BizForms with user's attached data
I have tried following the instructions in the link you listed, but I get the following error:


[Error loading the WebPart 'BizForm_1']
d:\web\kentico4.0\CMSWebParts\BizForms\bizformShima.ascx.cs(111): error CS0103: The name 'BizFormNew' does not exist in the current context


line 111 is as follows:

Control ctrl = BizFormNew.BasicForm.FindControl("name");

Any idea what I am missing?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 4/14/2009 4:39:19 AM
   
RE:BizForms with user's attached data
Hello,

This is just an example code. You can't use the exact code in your site, because you don't have a bizform named "BizFormNew". You need to change this to the name of your own bizForm. You can find the code name for every bizForm in CMS Desk-> Tools-> BizForms -> General -> "Form code name".

Best Regards,
Boris Pocatko

User avatar
Member
Member
hmoser-bostwicklaboratories - 4/16/2009 2:26:40 PM
   
RE:BizForms with user's attached data
I updated the code behind with my BizForm form code name and I am still receiving the following message in V4.0

[Error loading the WebPart 'BizFormTest']
c:\Inetpub\wwwroot\KenticoCMS_V3.1a\CMSWebParts\BizForms\bizformtest.ascx.cs(111): error CS0103: The name 'GlobalEmailBilling' does not exist in the current context

I tried restarting the application, do I need to rebuild?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/27/2009 10:58:29 AM
   
RE:BizForms with user's attached data
Hi,

You need to use the ID of the BizForm control which is specified in the ascx file of the web part. I hope it will help.

Best Regards,
Juraj Ondrus