Is it possible to disable/override a ScriptResourceMapping requirement? - unobtrusive-validation

I upgraded a WebForms project to .net 4.5, and received this error:
WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping
for 'jquery'. Please add a ScriptResourceMapping named
jquery(case-sensitive).
I'd like to enable UnobtrusiveValidation, but I'm using Combres for Javascript resources, so I don't want the ScriptManager to try to download it again. Is it possible to tell the ScriptManager to just trust me that it will be loaded? In other words, I want to add a mapping for "jquery" that does nothing. It's apparently not possible to add a ScriptResourceDefinition with a name but no paths. Is there any other way?

As far as I can tell the answer is no.
This question has been asked on http://connect.microsoft.com/VisualStudio/feedback/details/735928/in-asp-net-web-application-visual-basic-the-requiredfieldvalidator-doest-work and on http://forums.asp.net/t/1850831.aspx/1 with no answers.
As a quick and nasty workaround to this problem I have added an empty file called DummyJQuery.js into the solution put the code below into application_start:
Dim jQuery As New ScriptResourceDefinition()
jQuery.Path = "~/js/DummyJQuery.js"
jQuery.DebugPath = "~/js/DummyJQuery.js"
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery)

Answer described here: http://www.codeproject.com/Articles/465613/WebForms-UnobtrusiveValidationMode-requires-a

Related

How to create API with Dart?

I am currently creating a Flutter plugin, but I'm stuck in creating API.
This is an API that I want to create. (Java Example)
JAVA
PeterWorks.UserProperties userProperties = new PeterWorks.UserProperties();
userProperties.setAttrs("user_nick", "peterPark")
.setAttrs("place","Seoul")
.setAttrs("height",180)
.setAttrs("married",false);
Can you give me a sample that how to create that API with Dart?
Thanks.
You should check the types of topics that are normally allowed here, as this is borderline and others my outright flag it. In general, you should be posting specific questions showing what you've actually tried and not "build it for me" questions.
That said, here is a link (no affiliation) I referenced a while ago that focuses on building a basic backend server using Dart. See the second example.

Where the heck is Unity's CrossPlatformValidator?

I'm trying to use Unity's excellent new CrossPlatformValidator
(Such as seen ...
http://docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html or
https://docs.google.com/document/d/1dJzeoGPeUIUetvFCulsvRz1TwRNOcJzwTDVf23gk8Rg)
But it can't be found! Naturally I am ...
using UnityEngine;
using UnityEngine.Purchasing;
I also tried different stripping and .Net levels. Nothing.
Anyone have a clue about this?
The type or namespace name `CrossPlatformValidator' could not be found. Are you missing a using directive or an assembly reference?
Stuff like this is usually found at UnityEngine.Experimental but it wasn't there when I looked so I guess it is not a new feature.
1. You can find it by going to Windows -> Services. Sign in on the Window displayed, usually on the right.
2. Create a Project ID on that Window.
3. Click on In-APP Purchasing. It is checked to OFF, click on it then click Enable.
Note: You must Sign in to be able to Enable it and you must Enable it before you can use it from Script.
Finally, the completely undocumented namespace is:
using UnityEngine.Purchasing.Security;
note that one can see this in the generated "tangle" files, for example, if one forgets it. :/
Mono Dev can often help you find things.
Right click on unresolved class -> Resolve
Screenshot of resolve function in Mono Dev.:

How to get request properties in routeStartup plugin method?

I'm developing a multilanguage application, and use routes with translated segments. For multilingual support I created special Multilingual plugin.
To use translated segments I need set translator for Zend_Controller_Router_Route before routes init. So only possible place for this in my plugin is routeStartup method, but there is one problem here - for determine right locale I need to use properties of request (Zend_Controller_Request_Abstract), like module, controller and action names, but they are not defined yet here in routeStartup method. They are already defined, for example, in routeShutdown - but I can't set translator for route there, because it have to be done before routes init.
So what can I do:
can I get request properties somehow in routeStartup
or can I re-setup translator later in routeShutdown
P.S: there is a question with exactly the same problem Zend_Controller_Router_Route: Could not find a translator, but proposed answers is not the option for me, because I can't just retrieve language code from url with Regex, I have much more complicated code to define right language code.
Thanks.
What about putting your code in preDispatch? That's what I personally do when I need to check if the person is logged in. Maybe you can move your code there too?

Is there a way to change bracket placement and indentation in Xcode?

I want to change the default behavior of XCode (4) for aligning brackets from this:
- (BOOL)someValue {
return _someValue;
}
To this:
- (BOOL)someValue
{
return _someValue;
}
I've reviewed the docs here:
http://developer.apple.com/library/ios/#documentation/DeveloperTools/Reference/XcodeUserDefaultRef/100-Xcode_User_Defaults/UserDefaultRef.html#//apple_ref/doc/uid/TP40005535-CH3-SW57
But I still dont' understand how to make the change. Any help?
First off, the documentation you referred to is for XCode 3.1 (I've linked the introduction page which says so clearly). Judging by the number of comments on devforums.apple.com about this, I think the XCCodeSenseFormattingOptions key no longer exists under the new XCode4 defaults (which are stored under bundle ID com.apple.dt.XCode). If you want this particular feature restored, file a bug with Apple.
Secondly, you might be able to do what you're looking for by modifying templates. I discovered this very related question, but there's no tacit confirmation there that the suggestion actually succeeded.
You could try using an application called Snippet Edit that allows you to easily edit all of the supplied code snippets. You will need to be using Xcode v4.3 or later though if you wish to use it.
The application can be found at http://cocoaholic.com/snippet_edit/

zend framework under document root in subdir

I developed a application with Zend Framework and now I want to be able to place the app in an subdirectory of a Documentroot.
e.g. http://www.example.com/myapp/
I read quite a lot of Docu how this could work, but all in all these solutions don´t fit my needs. Is there a trivial way to do the subdir thing, without adding the concrete path to any file which generates the pages.
There are some examples in the net, where a basePath is set in the application enviroment and so there is a method call bevor each "form" creation which prepends the path before the link.
$form->setAction($this->_request->getBaseUrl() . $this->_helper->url('sign'));
This was from: http://johnmee.com/2008/11/zend-framework-quickstart-tutorial-deploy-to-a-subdirectory-instead-of-web-root/
But this is only works for small examples, I have tons of forms, tons of views and tons of scripts. I can´t belive this (lets call it hack :) ) is the only solution to do this.
Any ideas?
You don't have to do anything special. See my tutorial at http://akrabat.com/Zend-framework-tutorial which is developed entirely within a sub-directory.
As they say on the web page:
I’m told this last issue has been
lodged has a defect and not necessary
from releases “1.7″ and beyond. The
helper->url will henceforth prepend
the baseUrl to its result.
So you should be fine. Do you actually use the $form->setAction() method on every form already? Because if you use it in combination with the url helper, the baseUrl will already be included.