G
Guest
Could someone please tell me a nother way I could achieve the following...
I'm having problems because of a component within mya ASP.NET page due to
the ViewState set in the component!
I currently have a text editor ("editor.aspx")
and two different content mangement pages showing the pages available to edit
viewpage.aspx
and
PgeEditor.aspx
I want to update the appropriate table in the database according to which
page the user can from eg: Chose a page from viewpage or PgeEditor
The code below works fine apart from my Boolean keeps getting reset to FALSE
in the code because of the text editor component I'm using...
Would really appritiate any suggestions... HELP
Thanks
<CODE>
' Works fine
Private Function GetDocument() As String
Dim ds As DataSet
If Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/viewpage.aspx" Then
ds = GetDataSet(("SELECT content FROM tblPageContent WHERE
pageID=" + rowID.ToString()))
iNews = True
ElseIf Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/news/pgeEditor.aspx" Then
ds = GetDataSet(("SELECT content FROM tblNewsArchive WHERE
newsID=" + rowID.ToString()))
iNews = False
End If
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
ds.Dispose()
End Function 'GetDocument
' Sub UpdateDocument doesn't work as iNews always equals FALSE
Private Sub UpdateDocument(ByVal doc As String)
Dim strSQL As String = ""
If iNews = True Then
strSQL += "UPDATE tblPageContent SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE pageID=" + rowID.ToString()
RunQuery((strSQL))
Else
strSQL += "UPDATE tblNewsArchive SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE newsID=" + rowID.ToString()
RunQuery((strSQL))
End If
iNews = Nothing
End Sub 'UpdateDocument
I'm having problems because of a component within mya ASP.NET page due to
the ViewState set in the component!
I currently have a text editor ("editor.aspx")
and two different content mangement pages showing the pages available to edit
viewpage.aspx
and
PgeEditor.aspx
I want to update the appropriate table in the database according to which
page the user can from eg: Chose a page from viewpage or PgeEditor
The code below works fine apart from my Boolean keeps getting reset to FALSE
in the code because of the text editor component I'm using...
Would really appritiate any suggestions... HELP
Thanks
<CODE>
' Works fine
Private Function GetDocument() As String
Dim ds As DataSet
If Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/viewpage.aspx" Then
ds = GetDataSet(("SELECT content FROM tblPageContent WHERE
pageID=" + rowID.ToString()))
iNews = True
ElseIf Request.ServerVariables("HTTP_REFERER") =
"http://localhost/cpncms_v1/cms/news/pgeEditor.aspx" Then
ds = GetDataSet(("SELECT content FROM tblNewsArchive WHERE
newsID=" + rowID.ToString()))
iNews = False
End If
Dim table As DataTable = ds.Tables(0)
Dim row As DataRow = table.Rows(0)
Dim doc As String = row("content").ToString()
Return doc
ds.Dispose()
End Function 'GetDocument
' Sub UpdateDocument doesn't work as iNews always equals FALSE
Private Sub UpdateDocument(ByVal doc As String)
Dim strSQL As String = ""
If iNews = True Then
strSQL += "UPDATE tblPageContent SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE pageID=" + rowID.ToString()
RunQuery((strSQL))
Else
strSQL += "UPDATE tblNewsArchive SET content='"
strSQL += (doc.Replace(Chr(39), Chr(39) + Chr(39)))
strSQL += "' WHERE newsID=" + rowID.ToString()
RunQuery((strSQL))
End If
iNews = Nothing
End Sub 'UpdateDocument