|
| UI Process Block |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.distributed_apps.
| Steve |
Maybe someone can spread some light on this problem.
I have created a Web Application which uses the UIP App Block. The APP runs fine on the development server where the WEB App is in a Sub-directory of the root like "/MyUIPApplication"
When I deploy it to our staging server where the WEB application is in the Root like "/" The UIP App Block cannot load the pages. The resulting URL in the Browser is
http://sub-directory/page.aspx the UIP strips out the server from the URL.
TIA
Steve.
|
|
|
| |
|
| |
| |
| Steve |
Well if anybody else has this problem, I have solved it myself. The solution has three parts one in the web.config file and two in the WebFormViewManager.vb file The WebFormViewManager.vb file involves changes in two methods, "ActivateView" and "IsRequestCurrentView" copied below. I am not sure if this is the best solution but it works.
WebFormViewManager.vb Public Sub ActivateView(previousView As String, taskId As Guid, navGraph As String, view As String) Implements IViewManager.ActivateView
' create a session moniker
Dim sessionMoniker As New SessionMoniker(navGraph, view, taskId)
' Stores the Moniker into the Session
sessionMoniker.StoreInSession()
Dim viewSettings As ViewSettings = UIPConfiguration.Config.GetViewSettingsFromName(view)
If viewSettings Is Nothing Then
Throw New UIPException(Resource.ResourceManager.FormatMessage("RES_ExceptionViewConfig NotFound", view))
End If
Dim queryString As String = WebFormView.CurrentTaskKey + "=" + taskId.ToString()
' ThreadAbortException par for course on Redirect...trap here and squelch
' used "false" param to allow thread to continue execution after Redirect.
' this means cleanup work etc. can continue and we're not throwing a TAE every time we redirect that aspnet has to swallow up.
Try
If previousView Is Nothing Then
HttpContext.Current.Response.Redirect("~" & viewSettings.Type & "?" + queryString, True)
Else
HttpContext.Current.Response.Redirect("~" & viewSettings.Type & "?" + queryString, False)
End If
Catch e As System.Threading.ThreadAbortException
End Try
'**************** Original Code Did not work when the WEB APP is in a Root Directory Fine when a Virtual Directory ***************
'Try
' If previousView Is Nothing Then
' HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Applicatio nPath + "/" + viewSettings.Type + "?" + queryString, True)
' Else
' HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Applicatio nPath + "/" + viewSettings.Type + "?" + queryString, False)
' End If
'Catch e As System.Threading.ThreadAbortException
'End Try
End Sub
Public Function IsRequestCurrentView(view As IView, stateViewName As String) As Boolean Implements IViewManager.IsRequestCurrentView
' get state currentview; must all match
Dim viewSettings As ViewSettings = UIPConfiguration.Config.GetViewSettingsFromName(stateViewName)
If viewSettings Is Nothing Then
Throw New UIPException(Resource.ResourceManager.FormatMessage("RES_ExceptionViewConfig NotFound", stateViewName))
End If
Dim stateViewType As String = viewSettings.Type
Dim page As System.Web.UI.Page = CType(view, System.Web.UI.Page)
'**** Added t Fix WEB APP root Problem
Dim sPathPart As String = ""
If HttpContext.Current.Request.ApplicationPath = "/" Then
sPathPart = "/"
End If
Dim viewType As String = page.Request.CurrentExecutionFilePath.Replace(page.Request.ApplicationPath & sPathPart, "")
viewType = viewType.ToLower(System.Globalization.CultureInfo.CurrentUICulture)
'**************** Original Code Did not work when the WEB APP is in a Root Directory Only in a Virtual Web ***************
'Dim viewType As String = page.Request.CurrentExecutionFilePath.Replace(page.Request.ApplicationPath + "/", "")
'viewType = viewType.ToLower(System.Globalization.CultureInfo.CurrentUICulture)
If stateViewType.ToLower(System.Globalization.CultureInfo.CurrentUICulture).Equ als(viewType) Then
Return True
Else
Return False
End If
End Function
web.config
The Orignal <views> section used relative paths for the "type" attribute <views>
<view name="RegPartOne" type="members/mypage.aspx" controller="MyController" />
</views>
This needs to be changed to Root Relative <views>
<view name="RegPartOne" type="/members/mypage.aspx" controller="MyController" />
</views>
"Steve" <Click here to reveal e-mail address> wrote in message news:e3%Click here to reveal e-mail address... [Original message clipped]
|
|
|
| |
|
| |
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|