Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

DotNetNuke Marketplace
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Indoo
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  FAQ Module [Lea...  FAQ Module: Displaying an Answer on Page Load
Previous Previous
 
Next Next
New Post 4/14/2008 12:33 PM
User is offline David OLeary
92 posts
www.efficionconsulting.com
10th Ranked




FAQ Module: Displaying an Answer on Page Load 

I created a module that will display 3 random FAQ questions. When a user clicks on one of the questions, I want to direct them to the FAQ page with the faqid=x appended to the url and have the answer for that question displayed (along with all the other questions). I've dug through the code to try and figure this out and while all the asp.net stuff makes perfect sense... I just don't get the AJAX stuff and it looks like I need to do some AJAX/Javascript stuff to make this happen. Any ideas for the best way to do this.


David O'Leary
Efficion Consulting
 
New Post 4/14/2008 2:24 PM
User is offline David OLeary
92 posts
www.efficionconsulting.com
10th Ranked




Re: FAQ Module: Displaying an Answer on Page Load 
Modified By David OLeary  on 4/14/2008 5:27:08 PM)

I figured this out. Inside the FAQs.ascx.vb I created a new sub:

       Public Sub ShowFAQOnLoad(ByVal FAQID As integer)

            Try

                Dim controller As New FAQsController
                Dim lblAnswer As Label = Nothing
                Dim dli As DataListItem
                Dim nKey as Integer
                For Each dli In lstFAQs.Items
                    nKey = CInt(lstFAQs.DataKeys(dli.ItemIndex))
                   
                    If nKey = FAQID Then
                        lblAnswer = CType(dli.FindControl("A2"), Label)
                        Exit For
                    End If
                Next
                If lblAnswer Is Nothing Then
                    'Throw New Exception("Unable to find FAQ that matches the supplied ID")
                Else
                    Dim FaqItem As FAQsInfo = controller.GetFAQ(FAQID, ModuleId)
   
                    If (lblAnswer.Text = "") Then
                        IncrementViewCount(FaqItem.ItemId)
                        lblAnswer.Text = HtmlDecode(controller.ProcessTokens(FaqItem, Me.AnswerTemplate))
                    Else
                        lblAnswer.Text = ""
                    End If
                End If
            Catch exc As Exception 'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub

And then I modified the Page Load and added the following below the BindData():

                    If Request("FAQID") <> "" Then
                        ShowFAQOnLoad(CInt(Request("FAQID")))
                    End If

 


David O'Leary
Efficion Consulting
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  FAQ Module [Lea...  FAQ Module: Displaying an Answer on Page Load
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Where Every Home is an Investment
Where Every Home is an Investment
www.nestbrokers.com
Faculty of Graduate and Postdoctoral Studies
At the graduate level, the University of Ottawa offers more than 180 graduate certificates, master's degrees and PhDs, as well as interdisciplinary programs such as Women's Studies and Canadian Studies. Many postdoctoral opportunities are available in both the sciences and the humanities. For further information, please consult the site of the Faculty of Graduate and Postdoctoral Studies.
www.grad.uottawa.ca
Vekkin Solutions
Vekkin Solutions provides complete website solutions and custom module development to churches and small businesses.
www.vekkin.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP