Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...Database to paragraph form, where to insert C# and HTML? Database to paragraph form, where to insert C# and HTML?
Previous
 
Next
New Post
3/13/2012 5:45 PM
 

Greetings all, 

I am in the process of building a new site for my company (in DNN 6), and I need to have somewhere around 20 pages display a couple of modules (std. HTML ones as of now) that will have information from a table look roughly like this, in paragraph form:

[Report Name]

[date] [Abstract text- two sentences or so]

[link 1] [link 2] [link3] [link 4] 

[Next Record, same layout]

And so on... My question then, is this: the developer who built the current site (Apache, MYSQL) is helping me with this, and we're having trouble figuring out where in the DNN file structure the C# should go to make this work.  He's written this (which works outside of DNN, in .Net 3.5): 

<script runat="server">

        void Page_Load(Object sender, EventArgs e)

        {

            System.Data.DataView dvSql = (System.Data.DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

            foreach (System.Data.DataRowView drvSql in dvSql)

            {

                HyperLink hyperlink1 = new HyperLink();

                Label label = new Label();

                hyperlink1.Text = drvSql["ReportTitle"].ToString() + ", " + drvSql["Release_Date"] + "<br/>" + drvSql["AbstractText"] + "<br/>";

                hyperlink1.NavigateUrl = drvSql["pdfLink"].ToString();

                PlaceHolder1.Controls.Add(hyperlink1);

            }

        }

    </script>

       

        <asp:Panel ID="PlaceHolder1" runat="server">

        </asp:Panel>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server"

            ConnectionString="<%$ ConnectionStrings:dbnameConnectionString %>"

            SelectCommand="SELECT * FROM [tblResearch]"></asp:SqlDataSource>

So anyone who might have an idea of how to make this work, I'd really appreciate the help. Happy to share the build site if you need to see the dummy text to see how it needs to look.

Thanks

Chris

 
New Post
3/13/2012 7:39 PM
 

Hello,

There are a few things here...

First, I think you're having trouble because DNN can't natively take that kind of code through it's normal web interface. That's, of course, standard ASP.NET code. To implement that as is in DNN, you would need to make a custom module. Your custom module allows you to make user controls that contain the code you've specified.

Still, if I am guessing right, you don't actually need a custom module. You could do what you want with  the "form and list" module.

In "form and list", you can add fields for your report title, and it's abstract. Then, you could add a link to the pdf of the report. You can customize the templates for the list view in form and list, and that would let you make your layout the way you want. You might face some start-up costs moving your old report list into your form and list module, but, my guess would be that those costs would be less than the long-term issues with custom module development.

Hope this helps,

Mike

 
New Post
5/25/2012 2:13 AM
 
To Insert Database Into Paragraph Form I Think HTML is Best Way

 
Previous
 
Next
HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...Database to paragraph form, where to insert C# and HTML? Database to paragraph form, where to insert C# and HTML?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out