Index: mapviewerjava/mainframe.jsp
===================================================================
--- mapviewerjava/mainframe.jsp	(revision 3750)
+++ mapviewerjava/mainframe.jsp	(working copy)
@@ -113,7 +113,9 @@
     taskPaneWidth = showTaskPane? taskPaneWidth: 0;
     toolbarHeight = showToolbar? toolbarHeight: 0;
     statusbarHeight = showStatusbar? statusbarHeight: 0;
-    String taskPaneUrl = taskPane.GetInitialTaskUrl();
+	
+	//Encode the initial url so that it does not trip any sub-frames (especially if this url has parameters)
+    String taskPaneUrl = URLEncoder.encode(taskPane.GetInitialTaskUrl(), "UTF-8");
     String vpath = GetSurroundVirtualPath(request);
     boolean defHome = false;
     if(taskPaneUrl == null || taskPaneUrl.length() == 0) {
Index: mapviewerjava/taskframe.jsp
===================================================================
--- mapviewerjava/taskframe.jsp	(revision 3750)
+++ mapviewerjava/taskframe.jsp	(working copy)
@@ -36,14 +36,27 @@
     request.setCharacterEncoding("UTF-8");
     GetRequestParameters(request);
 
+	String url = URLDecoder.decode(taskPane, "UTF-8");
+	int index = url.indexOf("?");
+	
+	if(index > 0)
+	{
+		String path = url.substring(0, index);
+		String query = url.substring(index+1);
+		
+		if(query.length() > 0)
+			url = String.format("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s&%s", path, sessionId, URLEncoder.encode(webLayout, "UTF-8"), dwf, locale, query);
+		else
+			url = String.format("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", path, sessionId, URLEncoder.encode(webLayout, "UTF-8"), dwf, locale);
+	}
+	else
+	{
+		url = String.format("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", taskPane, sessionId, URLEncoder.encode(webLayout), dwf, locale);
+	}
     String templ = LoadTemplate("/viewerfiles/taskframe.templ");
     String[] vals = { GetSurroundVirtualPath(request) + "tasklist.jsp",
                     locale,
-                    taskPane,
-                    sessionId,
-                    URLEncoder.encode(webLayout, "UTF-8"),
-                    dwf,
-                    locale };
+                    url };
     response.getWriter().write(Substitute(templ, vals));
 %>
 
Index: mapviewernet/mainframe.aspx
===================================================================
--- mapviewernet/mainframe.aspx	(revision 3750)
+++ mapviewernet/mainframe.aspx	(working copy)
@@ -113,7 +113,9 @@
         int taskWidth = showTaskPane ? taskPaneWidth : 0;
         toolbarHeight = showToolbar ? toolbarHeight : 0;
         statusbarHeight = showStatusbar ? statusbarHeight : 0;
-        String taskPaneUrl = taskPane.GetInitialTaskUrl();
+
+        //Encode the initial url so that it does not trip any sub-frames (especially if this url has parameters)
+        String taskPaneUrl = HttpUtility.UrlEncode(taskPane.GetInitialTaskUrl());
         String vpath = GetSurroundVirtualPath(Request);
         bool defHome = false;
         if (taskPaneUrl == null || taskPaneUrl.Length == 0)
Index: mapviewernet/taskframe.aspx
===================================================================
--- mapviewernet/taskframe.aspx	(revision 3750)
+++ mapviewernet/taskframe.aspx	(working copy)
@@ -36,15 +36,29 @@
 
     GetRequestParameters();
 
+    String url = HttpUtility.UrlDecode(taskPane);
+	int index = url.IndexOf("?");
+	
+	if(index > 0)
+	{	
+		String path = url.Substring(0, index);
+		String query = url.Substring(index+1);
+		
+		if(query.Length > 0)
+			url = String.Format("{0}?SESSION={1}&WEBLAYOUT={2}&DWF={3}&LOCALE={4}&{5}", path, session, HttpUtility.UrlEncode(webLayout), dwf, locale, query);
+		else
+			url = String.Format("{0}?SESSION={1}&WEBLAYOUT={2}&DWF={3}&LOCALE={4}", path, session, HttpUtility.UrlEncode(webLayout), dwf, locale);
+
+	}
+	else
+	{
+		url = String.Format("{0}?SESSION={1}&WEBLAYOUT={2}&DWF={3}&LOCALE={4}", taskPane, session, HttpUtility.UrlEncode(webLayout), dwf, locale);
+	}
     String templ = LoadTemplate(Request, "../viewerfiles/taskframe.templ");
     String[] vals = {
                     GetSurroundVirtualPath(Request) + "tasklist.aspx",
                     locale,
-                    taskPane,
-                    session,
-                    HttpUtility.UrlEncode(webLayout),
-                    dwf,
-                    locale
+                    url
                     };
 
     Response.Write(Substitute(templ, vals));
Index: mapviewerphp/mainframe.php
===================================================================
--- mapviewerphp/mainframe.php	(revision 3750)
+++ mapviewerphp/mainframe.php	(working copy)
@@ -133,7 +133,9 @@
         $taskWidth = $showTaskPane? $taskPaneWidth: 0;
         $toolbarHeight = $showToolbar? $toolbarHeight: 0;
         $statusbarHeight = $showStatusbar? $statusbarHeight: 0;
-        $taskPaneUrl = $taskPane->GetInitialTaskUrl();
+		
+		//Encode the initial url so that it does not trip any sub-frames (especially if this url has parameters)
+        $taskPaneUrl = urlencode($taskPane->GetInitialTaskUrl());
         $vpath = GetSurroundVirtualPath();
         $defHome = false;
         if($taskPaneUrl == "") {
Index: mapviewerphp/taskframe.php
===================================================================
--- mapviewerphp/taskframe.php	(revision 3750)
+++ mapviewerphp/taskframe.php	(working copy)
@@ -27,8 +27,17 @@
 
 GetRequestParameters();
 
+//If there is an initial url, it will be encoded, so parse the decoded url.
+$comp = parse_url(urldecode($taskPane));
+
+//If there is a query component to the initial url, append it to the end of the full url string
+if(!isset($comp["query"]) || strlen($comp["query"]) == 0)
+	$url = sprintf("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", $comp["path"], $session, urlencode($webLayout), $dwf, $locale);
+else
+	$url = sprintf("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s&%s", $comp["path"], $session, urlencode($webLayout), $dwf, $locale, $comp["query"]);
+
 $templ = file_get_contents("../viewerfiles/taskframe.templ");
-print sprintf($templ, GetSurroundVirtualPath() . "tasklist.php", $locale, $taskPane, $session, urlencode($webLayout), $dwf, $locale);
+print sprintf($templ, GetSurroundVirtualPath()."tasklist.php", $locale, $url);
 
 function GetParameters($params)
 {
Index: viewerfiles/taskframe.templ
===================================================================
--- viewerfiles/taskframe.templ	(revision 3750)
+++ viewerfiles/taskframe.templ	(working copy)
@@ -51,6 +51,6 @@
 </head>
 <frameset id="taskFrameSet" name="taskFrameSet" rows="0,*" frameborder=0 border=0>
     <frame name="taskListFrame" src="%s?LOCALE=%s" noresize scrolling=no>
-    <frame name="taskPaneFrame" src="%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s" noresize>
+    <frame name="taskPaneFrame" src="%s" noresize>
 </frameset>
 </html>

