Another way???

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
 
C

Curt_C [MVP]

Tim::.. said:
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

Why not just pass a variable to the page, in the Querystring to
differentiate the page you came from?
 
G

Guest

Thanks...

Why didn't I think of that... DOWWW!

Curt_C said:
Why not just pass a variable to the page, in the Querystring to
differentiate the page you came from?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top