Postbacks not working in Dot Net Nuke 5.2.1 with javascript disabled - dotnetnuke

I am working on my first DotNetNuke website and there is a requirement for all the custom module functionality I am developing to be available with JavaScript disabled.
However, when I create a module that contains a simple submit button, i.e.<input type="submit" />, DotNetNuke displays a critical error with JavaScript turned off but works as expected with JavaScript turned on.
When I attach to the running process using Visual Studio, the unhandled exception is thrown from admin/Skins/Nav.ascx.vb line 177. The inner exception message is "Invalid JSON primitive: ."
My research online only managed to turn up this forum post (Postbacks are not working when Javascript is disabled in the browser) that appears to be the same problem as mine, but no solution is provided.
Can anyone shed any light on this issue? Is it viable to be attempting to write non-JavaScript functionality in this version of DotNetNuke?
Update: it turns out that another website designed recently with Dot Net Nuke by the company I am working for is having the same problem with non-javascript postbacks when using DNN version 5.1.4 but it does not have the problem (i.e. it can postback without javascript) in DNN version 5.0.1.
So perhaps a hard dependency on javascript has been introduced at some point after version 5.0.1. We are investigating this possibility further and I will keep this question updated as we go. Obviously I still welcome anyone's input on the subject.
Update: i've started a thread on the Dot Net Nuke forums to see if I can get any help there. If any solutions come up I'll post them here. Trying to find official DNN stance on support for javascript disabled functionality

One of the developers in the office found a workaround to get postbacks working with javascript disabled. Unfortunately since he does not have a Stack Overflow account, I will try to translate his solution as best I can for those who are interested. Bottom line is postbacks with Javascript disabled is possible once you make a few changes to the Dot Net Nuke environment.
Step 1 - Change the menu module. In our case we used the Telerik RadMenu.
<dnn:NAV runat="server" id="dnnNAV" ProviderName="DNNMenuNavigationProvider" IndicateChildren="false" ControlOrientation="Horizontal" CSSControl="mainMenu" />
becomes
<dnn:RADMENU runat="server" id="dnnRADMENU" MaxLevel="2" EnablePageIcons="False" PagesToExclude="" ShowPath="True" />
Step 2 - Remove the actions and visibility modules.
<dnn:ACTIONS runat="server" id="dnnACTIONS" ProviderName="DNNMenuNavigationProvider" ExpandDepth="1" PopulateNodesFromClient="True" />
<dnn:VISIBILITY runat="server" id="dnnVISIBILITY" minicon="images/DNN-minus.gif" maxicon="images/DNN-plus.gif" />
Step 3 - Download the DNN source and make two changes in the LibraryUI\Utilities\ClientAPI.vb file.
Line 155:
DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(objButton.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn_dom)
becomes
If Not objButton.Page.IsPostBack Then
DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(objButton.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn_dom)
End If
Line 355:
ClientAPI.GetCallbackEventReference(objPage, "", "", "", "")
becomes
If Not objPage.IsPostBack Then
ClientAPI.GetCallbackEventReference(objPage, "", "", "", "")
End If
Step 4 - compile the Dot Net Nuke library.
Note: Also make sure you are not logged in as an admin or host, as the admin/host panel at the top of the page will also break if you attempt to postback with javascript disabled.
Hope this helps someone else. If you feel like I'm missing some important details, let me know and I'll try and fill in what's needed.

DotNetNuke relies heavily on JavaScript and I doubt there is a real easy way around it - at least considering you need to support all functionality. Perhaps you can clarify that?
The the bottom line here is that you're going to need to modify DotNetNuke to meet your needs. It certainly isn't impossible to get it working, but I would venture a guess that it just plain isn't worth it for most people.
If, as you said, you need to retain ALL functionality without using JavaScript, you're going to have a pretty substantial amount of work to do.
I'd suggest, to get started, you download the source package, set up a development environment on your local machine, turn off JavaScript in your browser and start taking notes. This will help to determine the level of effort involved.
I'm guessing you won't get a lot of responses out of this one (as the poster in the forum thread you linked to didn't) as very few people have sat down in front of DotNetNuke with this as a requirement.
Also, keep in mind that any time you're making substantial changes to the DotNetNuke framework, you're interfering with your ability to easily perform upgrades in the future. Just another thing to think about.

I believe that I've seen the leadership in DNN say that they've taken a hard dependency on JavaScript, and have no intention at this time of considering a non-JavaScript compatible scenario.
That being said, being able to do a simple postback shouldn't be too difficult to support. I would look around in the Client API area for the error that you're describing. A lot of the Client API code is in the DotNetNuke.WebUtility assembly, which is a separate download from CodePlex to get the source.

Related

Using VB based Visual Studio project with AngularJS/HTML5

My goal is to write a desktop application created through Visual Studio which uses HTML5 and AngularJS to display a well put together front end to the user but which also allows for me to use VBscript so I can do read/write items, send things to the printer, and compose/send emails from their outlook automatically.
Can this be done and which options should I select when starting my project? I can not have this run through a traditional web browser since I am doing the above mentioned items which browsers won't let me do.
p.s. I just download VS 2015 community today. I have spent the day researching and finding lots of helpful information but nothing which answers this.
You don't need VBScript
You should check out Electron, with which you can develop desktop applications in Javascript / HTML5, and maybe, an AngularJS - Electron seed project to speed things up.
Now if you consider Electron, you can check out this answer about printing with Electron.
If you want to persist in this (which seems to be the best course of action in my opinion), you can find any informations about how to do this and that with electron by reading the docs, tutorials and basic google searches.
Don't hesitate to come back to SO if you have precise questions regarding code you already have.

CEF 3 workaround missing features

I'm building an application that is using CEF 3 (version 1650) in WPF (meaning I'm using OSR mode) using Xilium.CefGlue as a wrapper.
After a lot of research I've found several features I can't get to work nor workaround:
Focus Management - I need to tell when the last focusable item in the page lost focus due to a Tab press (or the first item due to Shift+Tab)
Javascript Alerts - I got them to work for standard schemes, but not for custom schemes (also found a bug regarding it). I'm looking for a way around it.
Favicons - Seems CEF3 did not implement favicon support. I guess I can look for favicon.ico in the root directory for standard schemes, but what about favicons linked in the HTML itself?
User Permission Notification - I only found permission request events for geolocation request, but I also need for other things such as getUserMedia. Any idea how?
Zoom - This one works except for getZoomLevel, that for some reason always returns zero. Does anyone knows why or how to get around it considering it does remember each page's last zoom?
Process Model - I can't get multiple browser windows opened manually (that is, not via javascript's openWindow) all with the same custom scheme to open in the same render process (already tried all different process model parameters I know of). As far as I understand, it should be possible. What am I missing?
Thank you in advance for your help.
Focus Management is it OnTakeFocus you are looking for?
Favicons has an open enhancement issue in the CEF project
For anyone who finds their way to this question, favicon support is now available in the official CEF builds.

How are you integrating help into your WPF application. Any recommendations?

The question says it all really. If you are writing a WPF application, how are you integrating the application help? What is the state of play in mid-2013?
It seems that there is no clear answer to this from an afternoon with a search engine, but several options:
Write your own fancy tooltip based help (but where are you getting your data from?)
Use .CHM files and the Windows Forms help system (seems archaic to me).
Use Microsoft Help Viewer 1.X or Microsoft Help 2.0.
There is some confusion as to which is more recent / approved of by MS. It appear Help Viewer 1.X might be the recommended option over Microsoft Help 2.0. It doesn't help that the names are so similar...
What is the status of 2.0? Should we use it? Was it ever fully deployed?
Use a third-party product to author your help files and link to them somehow - DocToHelp/NetHelp, NetAdvantage on-line help, etc...
Furthermore, what XAML based mark-up / attributes are you using to provide the necessary context? What is the recommended method?
It seems surprising there is no clear path for supporting application based help in WPF.
My current preference is to use a third party help authorizing system to generate HTML based help.
We then use a WebBrowser to display this help as needed. The authoring system we use makes it fairly easy to extract out a single page from the main help (each "topic" is a single HTML file, and can be included with full contents or not as desired).
Granted, this definitely felt like a bit of a nasty hack at first - but once we wrote the basic plumbing (some attached properties for xaml to specify attributes for context location and add behavior to trigger help, etc), it's fairly clean.
One very nice advantage to this approach, however, is a single help system build works perfectly in all contexts - we can include the documentation online, expose it locally for use in a browser, and use it with context from within our application directly.

using silverlight for user interface only

I am planning to make a web application, using silverlight for frontend. requirement is: this frontend will be just an empty shell, and it must be language independent. it will get everything it needs to display and use from server, therefore making it language independent.
i tried to find tutorials, but there is nothing.
as far as i understand, silverlight uses xaml for all its data, so just generating it with whatever language i want shouldn't be a problem. but i don't have any silverlight experience or knowledge, so i'm not sure what is the best way to do this. for example, i don't know how will new content be generated, and what kind of structure silverlight requires.
can anyone give me some starting points?
Your requirements are rather demanding. If i can summarise:
silverlight will be the front end (or container)
you don't know what it will be showing
the content may be dynamically generated
everything, including the visual content, will be retrieved from the server
If i have misunderstood then by all means correct me or adjust your question.
Those requirements are not trivial, especially when you have no prior experience in Silverlight. Fetching data from the server is a normal behaviour in Silverlight, but fetching any generated UI content will be a slow and inefficient use of the technology platform. Silverlight is delivered via the browser, and runs on the client. If you are going to have generated UI, then you may want to consider using straight HTML instead (you can generate the contents using ASP.Net or a scripting language such as PHP). Alternatively, you can generate your required UI views from within the Silverlight app itself by either swapping in and out the appropriate pre-built piece of UI (or controls), programmatically adding new controls into the visual tree, or by loading XAML using the XamlReader class.
This answer may or may not help you much, but like i said before - put some more specific details into your question and you will get more specific answers (either add comments under your question, or post a new more specific question if you cannot edit your current one).
Edit: i have just come across this blog article from Jeff Prosise explaining the use of the INavigationContentLoader interface in Silverlight 4 to dynamically load pages from either remotely or locally. It is a detailed write-up, with a lot of code samples, it may be of use to you.
I would suggest you start at http://Silverlight.net
The "Learn" section has lots of videos that can get you started. http://www.silverlight.net/learn/

Could not load file or assembly ‘System.Web.Silverlight’

I really need some help with this as I have been trying to fix this for months and I can't figure it out.
I run an online chess site written in Silverlight 3.0
The architecture is Silverlight Client connecting to a WCF service that reads and writes data to a SQL Server database. It is hosted on Godaddy,
Once every so often I get the following error:
Could not load file or assembly ‘System.Web.Silverlight’ or one of its dependencies.
The system cannot find the path specified.
If I leave it alone it will fix itself after a few hours, however usually I just make a new publish of my application and it goes away. Also all the pages in the solution get this message not just the Silverlight application. So I have an aspx page with top ranks that does not use Silverlight but is in the same solution it also gets the same error. Its almost like the whole site dies.
This does not seem like a huge issue but it makes going on vacation hard since my site can go down at any time I am away. Also this seems to happen the most when I am sleeping so I often don't get to fixing it until I have already lost hours of potential logins.
This sounds like a ASP.NET problem. I suspect you are using ASP.NET with the Silverlight 2.0 ASP.NET server control. Ditch it and code the Object tag yourself, that way you no longer need that special assembly in your web site.
I received an answer on the Silverlight.net forums, it is a cobination of two items:
Like Anthony Suggested use an Object Tag to embed your Silverlight control.
Remove all refferences of System.Web.Silverlight from all your projects and never use it again.

Resources