% timeout(1) set con = server.createobject("ADODB.Connection") con.open Application("CString") if Request.Form("Posted") = "Y" then if Request("PageID") = "NULL" then strSQL = "UPDATE CMS_Menu SET PageID = NULL, Frame = NULL WHERE MenuID = "& Request("id") con.execute(strSQL) elseif Request("PageID") <> Empty and IsNumeric(Request("PageID")) then s_Frame = Request("Frame") if s_Frame = Empty then s_Frame = Replace(Request("Frame_New"), "'", "''") end if strSQL = "UPDATE CMS_Menu SET PageID = "& Request("PageID") &", Frame = '"& s_Frame &"' WHERE MenuID = "& Request("id") con.execute(strSQL) else s_Frame = Request("Frame") if s_Frame = Empty then s_Frame = Request("Frame_New") end if %> <% end if con.close() set con = Nothing %> <% Response.End() end if %>
<% if Request("id") <> Empty and IsNumeric(Request("id")) then strSQL = "SELECT MenuID, MenuName, MainMenuID, PageID, Frame FROM CMS_Menu WHERE MenuID = "& Request("id") set rsMenu = con.execute(strSQL) if not rsMenu.EOF then rsMenu.MoveFirst() i_MenuID = rsMenu("MenuID") s_MenuName = rsMenu("MenuName") i_MainMenuID = rsMenu("MainMenuID") i_MenuPageID = rsMenu("PageID") s_Frame = rsMenu("Frame") if IsNull(i_MenuPageID) then i_MenuPageID = 0 end if if IsNull(s_Frame) then s_Frame = "" end if %>
<% con.Close() set con = Nothing %>