Hello Sebastian. Thank you for your response. The version of ASP.Net I am using is 2.0.50727 and I am using Visual Studio 2008 for development. Thanks for the suggestion on upgrading.
I think I am able to rule something out now (which is a sort of progress). Although the app.Response.ContentType is null (as my previous message states), I have found that if I remove the AddEvent code to prevent calling CompressionModule.vb, my page still does not handle client-side events. So that may be a bit of red herring.
Further testing (and head-scratching) indicate that the basic problem boils down to this:
For background, what I have done is develop a DNN module with an intitial "view" page made for displaying employees, along with a text box used for entering search criteria.
I have written this module similar to the "efforty.UserDirectory" module, if you have seen that. Similarly, I register java script in the Page_Load event to handle, client-side, key press events in the search text box, so that the table and its contents (fed by changes to a filter on a dataview) can be redrawn rapidly.
It works just fine... as long as I am logged in as "Host" or "Admin". But if I am on the site anonymously or logged on as a non-admin user, suddenly the events are no longer caught (i.e. the key press events in the textbox no longer get passed along to the javascript event handler). Or, more accurately, most of the time they aren't. Sometimes, after having been logged on as Host or Admin and having logged off, the events seem to be caught again. When that happens, if I do a refresh on the page, the page will stop responding to events again. It's odd...
Does this additional background give you any ideas? I would sure like to get to the bottom of this. Is it perhaps something to do with the page (classified as "view" in the .dnn file, btw) is being run in a partial rendering mode when Host/Admin are not logged on? I ran into that problem once, when trying to make a Settings page accessible via a non-Host/non-Admin user (to get around it, I had to add a Framework.AJAX.RegisterPostBackControl() call in the page's Init event handler).
For further background, in order to bring in callback support, I declared the page's class as:
Partial Class ViewPhotoStaffDirectory
Inherits Entities.Modules.PortalModuleBase
Implements Entities.Modules.IActionable
Implements DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler
Also, if it helps, the following function is called on the Page_Load, to add the client-side script:
Private Sub RegisterJSFunction()
Dim script As New System.Text.StringBuilder
With script
.Append("<script language=""javascript"">")
.Append(vbCrLf)
'SendToPhotoDirectoryUD and success/error functions
.Append("function SendToPhotoDirectoryUD(page) {")
.Append(vbCrLf)
.Append( _
ClientAPI.GetCallbackEventReference(Me, _
"'1|1|' + dnn.dom.getById('" + Me.txtSearch.UniqueID.Replace("$", "_") + _
"').value + '|' + page + '|'", _
"successPhotoDirectoryFunc", _
"this", _
"errorPhotoDirectoryFunc" _
) _
)
.Append(vbCrLf)
.Append("}")
.Append(vbCrLf)
.Append("function successPhotoDirectoryFunc(result, ctx) {" + vbCrLf)
.Append("dnn.dom.getById('" + HtmlPhotoDirectoryAnker.UniqueID.Replace("$", "_") + _
"').innerHTML = result }" + vbCrLf)
.Append("function errorPhotoDirectoryFunc(result, ctx) {" + vbCrLf)
.Append("}")
.Append(vbCrLf)
.Append("</script>" + vbCrLf)
End With
' Get a ClientScriptManager reference from the Page class.
Dim cs As ClientScriptManager = Page.ClientScript
Dim cstype As Type = Me.GetType()
' Check to see if the client script is already registered.
If (Not cs.IsClientScriptBlockRegistered(cstype, "SendToPhotoDirectoryUD")) Then
cs.RegisterClientScriptBlock(cstype, "SendToPhotoDirectoryUD", script.ToString(), False)
End If
End Sub
In addition, the VB code that handles the callbacks is shown below:
Public Function RaiseClientAPICallbackEvent(ByVal eventArgument As String) As String Implements DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler.RaiseClientAPICallbackEvent
Dim strArray As String() = eventArgument.Split("|")
' param 0 = CallBackMode; Search, sort or edit
' param 1 = SearchMode; fix or custom
' param 2 = search expression
' param 3 = page
' param 4 = sortColumn or Staff ID
Dim callBackMode As CallBackMode = CType(strArray(0), CallBackMode)
Dim searchMode As SearchMode = CType(strArray(1), SearchMode)
Dim searchExpression As String
Dim strSearch As String = strArray(2)
SearchFieldString = strSearch
searchExpression = BuildSearchExpression(strSearch)
Dim cntrlrPhotoStaffDirectorys As New PhotoStaffDirectoryController
Dim dv As DataView = cntrlrPhotoStaffDirectorys.GetEmployeesTable(ModuleIDToUse, _
DefaultSortExpression)
dv.RowFilter = searchExpression
Dim page As Int32
If Not String.IsNullOrEmpty(strArray(3)) Then
page = CInt(strArray(3))
Session(SESSION_PAGE) = CStr(page)
Else
If Not Session(SESSION_PAGE) Is Nothing Then
page = CInt(Session(SESSION_PAGE))
Else
page = 1
End If
End If
If strSearch.Length >= MinChar Or SearchStartMode = _
SearchStartMode.ShowAllRecords Then
Return Me.BuildHtmlTableBrowser(dv, page)
Else
Return "<span class='Normal'>No Results</span>"
End If
Return HtmlPhotoDirectoryAnker.InnerHtml
End Function
Thanks again, in advance. I really appreciate your help.