dude9er 0 Newbie Poster

I am trying to update web content on my site by the ID in the database. I am using a ASCX file in order to update the content and it's integrated with a BLL VB file. By example, the content on my Contact page needs to be updated, the DB table has the following columns: id, section (the section that is being updated, in this case "contactpage"), sectionContent, dateStmp and clubId.

I have set it up so that the section column's value can equal "contactpage" with different "clubId" values.

DB Example:

Section | SectionContent | clubId

contactpage | Call me now | NHSC
contactpage | Call me L8tr | ABC123
contactpage | Don't Call | KLM987
contactpage | Upchuck | CHUCK

When I go to update the page I want to grab the clubId=NHSC from the querystring, and update the relevant "sectionContent=Call Me now" column in the DB

Here is the BLL code that already exist, how can I modify it with a where statement club=@club from the querystring

Public Class CMS

        Public Shared Function GetContent(ByVal sectionname As String) As String
            Dim str As String = ""
            Dim qry As New Query(Tables.WebContent)
            qry.AddWhere(WebContent.Columns.Section, sectionname)
            If qry.GetRecordCount() = 1 Then
                Dim Content As New WebContent(WebContent.Columns.Section, LCase(sectionname))

                If Content.IsLoaded Then
                    str = Content.SectionContent.ToString()
                End If
            Else
                str = "IsNotAdded"
            End If
            Return str
        End Function

I am using FCKeditor, here is the code to update, I need to use the where statement to identify the clubId:

Public Shared OrigionalContent As String = ""
    Public Shared IsNew as Boolean = False
        
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

        If Not Page.IsPostBack Then
            If Request("sectionname") Is Nothing Then
                Response.Redirect("~/default.aspx")
                
            Else
                OrigionalContent = CMS.GetContent(Request.QueryString("sectionname").ToString())
                If OrigionalContent = "IsNotAdded" Then
                    FCKeditor1.Value = "&lt;p&gt;</p>"
                    IsNew = True
                Else
                    FCKeditor1.Value = OrigionalContent
                    IsNew = False
                End If
            End If
        End If

    End Sub


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim newcontent As String = ""
        If FCKeditor1.Value = "" Then
            newcontent = "<p></p>"
        Else
            newcontent = FCKeditor1.Value
        End If
        
        If OrigionalContent = "IsNotAdded" Or IsNew = True Then
            CMS.AddContent(Request.QueryString("sectionname").ToString(), newcontent)
        Else
            CMS.UpdateContent(Request.QueryString("sectionname").ToString(), newcontent)
        End If

        Dim ip As String = Request.ServerVariables("REMOTE_ADDR")
        
        
        If Request("ReturnURL") Is Nothing = False Then
            Response.Redirect(CStr(Request("ReturnURL")))
        Else
            Response.Redirect("~/default.aspx")
        End If

    End Sub

And of course the ASCX code that requires the Where clubId=@clubId statement

Private _Section As String = ""

    Public Property Section() As String
        Get
            Section = LCase(_Section)
        End Get
        Set(ByVal value As String)
            _Section = LCase(value)
        End Set
    End Property

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Section Is Nothing Then
            Label_Content.Text = "Please enter a section name into the WebContent control."
        Else
            Try
                sectionnameprop.Value = _Section
                Label_Content.Text = ClubStarterKit.Web.CMS.GetContent(_Section) 
            Catch ex As Exception
            
            End Try
            Edit.Visible = Page.User.IsInRole("Editors")
            
            'Added this to get the querystring
            Dim clubId As String = Request.QueryString("clubId")
            
            Dim url As String = "~\WebContent\Editor.aspx?sectionname=" & sectionnameprop.Value
            'and this            
            url += "&clubId=" & clubId
            url += "&ReturnURL="
            url += System.Web.HttpUtility.UrlEncode(Request.Url.ToString())
            Edit.NavigateUrl = url
        End If
    End Sub

Thanks everyone, please bare with me as I am new to the asp.net world.