Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

Another way???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim::.. - 26 Jul 2005 09:06 GMT
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
Curt_C [MVP] - 26 Jul 2005 14:38 GMT
> 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
[quoted text clipped - 19 lines]
>
>    

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

Signature

Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Tim::.. - 26 Jul 2005 14:46 GMT
Thanks...

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

> > 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
[quoted text clipped - 22 lines]
> Why not just pass a variable to the page, in the Querystring to
> differentiate the page you came from?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.