Design and CSS styles
Version 3.x > Design and CSS styles > File Download Registration Form? View modes: 
User avatar
Member
Member
danielrichard-oaot - 1/26/2009 8:31:47 AM
   
File Download Registration Form?
I'm investigating BizForms to do this, but I wanted to see if anyone else has done something similar and if this is the right approach:

We have a certain PDF that we would like people (public) to fill out a simple form, providing company info, before downloading. We don't really require accounts to be created or anything... we just want to capture some information when anyone wants to download the file.

In addition, this same form would be used as a "Contact Us" form, not relating to any file downloads.

So, in theory, the user would click the PDF link, the form would come up, they submit the form, the file downloads for them, the page is redirected back to the intial page where they clicked the PDF link.

The data should be emailed to a recipient in the company as well as stored in a database.

Any ideas or examples of this with a BizForm or some other method?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/27/2009 2:49:29 AM
   
RE:File Download Registration Form?
Hi,

You will need to customize the bizform web part - http://www.kentico.com/docs/devguide/modifying_the_design_of_standa.htm.

Here is the idea:

You will have a PDF link, but this link will be to a page with the bizform and you will pass some ID of the PDF document in the query string. The user will fill the form and hit "Send" button. In the code behind of the bizform web part you will handle this event - for example OnBeforeSave or OnAfterSave and here, in this event you will get the quesry string paramater so the file download begins and also the redirection to the initial page.
The data will be stored in DB and you can use the notification message setting for the bizform to send the data - http://www.kentico.com/docs/devguide/sending_e_mails.htm.

I hope it makes sense.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
danielrichard-oaot - 1/27/2009 9:45:33 AM
   
RE:File Download Registration Form?
I'm struggling trying to get a BizForm on my page. I've tried copy/pasting the example in CorporateSiteASPX (modifying to fit my templates). I'm not referencing my custom web part just in case that's a source of the problem. I just keep getting a Runtime Error whenever I put a BizForm on my page (An error occured processing your request at URL /CMSTemplates/OAOT/OAOTInteriorBizForm.aspx.).

I tested the CorporateSiteASPX and it worked fine, so it must be how I'm implementing it for my site.

Here's the template page I'm using:
<%@ Page Language="C#" MasterPageFile="~/CMSTemplates/OAOT/OAOT.master" AutoEventWireup="true" CodeFile="OAOTInteriorBizForm.aspx.cs" Inherits="CMSTemplates_OAOT_BizForm" ValidateRequest="false" %>
<%@ Register Src="~/CMSWebParts/BizForms/BizForm.ascx" TagName="BizForm" TagPrefix="uc1" %>

<asp:Content ID="cntMain" ContentPlaceHolderID="plcMain" Runat="Server">
<!-- Left column -->
<div class="zoneLeft">
</div>

<!-- Center column -->
<div class="zoneCenter">
<cms:WebPartContainer ID="wpcpageplaceholder" runat="server" ContainerName="Padding.Content">
<uc1:BizForm runat="server" ID="BizForm" BizFormName="ContactUs" />
</cms:WebPartContainer>
</div>
</asp:Content>


My Code-Behind is basically empty:
using System;
using System.Web;

public partial class CMSTemplates_OAOT_BizForm : TemplatePage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/27/2009 11:10:57 AM
   
RE:File Download Registration Form?
Hi,

Just to be sure, have you created a Bizform with code name "ContactUs" in your web site (http://www.kentico.com/docs/devguide/creating_bizform_control.htm)?

Best Regards,
Juraj Ondrus

User avatar
Member
Member
danielrichard-oaot - 1/27/2009 11:30:20 AM
   
RE:File Download Registration Form?
That's correct. Under my site's Tools -> BizForms I have a form with Code Name and Table Name of "ContactUs". Form display name is "Contact Us".

I created 17 fields, 2 of which are SQL Queries for the State and Country tables:

select StateDisplayName + ';' + StateName from CMS_State

select CountryDisplayName + ';' + CountryName from CMS_Country

User avatar
Member
Member
danielrichard-oaot - 1/27/2009 11:35:58 AM
   
RE:File Download Registration Form?
As I typed that last response, I figured those SQL statements could be the issue. I removed them and put in hardcoded "test;test" and it displayed the form for me.

I tried changing the SQL to:

select StateDisplayName from CMS_State
select CountryDisplayName from CMS_Country

And those resulted in an error as well.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/28/2009 5:16:57 AM
   
RE:File Download Registration Form?
Hi,

You need to use one SQL query which will return two values from two columns. One valu is the name and the other is the value.

Best Regards,
Juraj Ondrus