ajaxToolkit:AjaxFileUpload passing parameters to server - asp.net

I am using ajaxToolkit:AjaxFileUpload (June 2013 Release). An id should be passed to the server when uploading.
How can I achieve that? Setting "ContextKeys" does not work - it's null on the server.
The version seems to be buggy anyway - I had to put a second ajaxToolkit:AjaxFileUpload on the page to get the upload working.
Thanks
Stephan

For those who are interested in the solution:
I was not able to get the AjaxFileUpload pass the query parameters.
So I decided to use the AsyncFileUpload which works fine.

Related

Here API | MultiValueQueryParameter for Via Points

I'm using the latest version of the here javascript sdk 3.1.32.0
When I use H.service.Url.MultiValueQueryParameter for my via points like
{
...,
via: new H.service.Url.MultiValueQueryParameter(['50.1234,8.7654', '51.2234,9.1123']);
}
I see in the URL params of my request this: &via=%5Bobject%20Object%5D
Someone an idea why this happens?
Thanks in advance!
When you use "via" parameter, you define a list of via waypoints. A via waypoint is not a native datatype recongnized by JavaScript, therefore, you will see in the URL params the word object refering to a particular data structure, in this case the via Waypoint composed mainly by Latitude, Longitude.
Regards.
This took a while to figure out the actual issue with the malformed url params. I was dynamically loading the here maps service script on mount of a component. Accidentally this happened in some cases twice. In both cases H was globally available and everything worked like expected. BUT when the script was loaded twice H.service.Url.MultiValueQueryParameter didn't return the correct params. It basically encoded them twice, or tried to.
The other side issue was that https://www.npmjs.com/package/#types/heremaps is outdated and doesn't cover MultiValueQueryParameter. So I had to remove the types and use my own. Else I probably would have realized the issue earlier.

How do I register a MediatR post processor

I would like to try the new pipeline feature in MediatR: https://github.com/jbogard/MediatR/wiki/Behaviors
I tried the following, but it does not get executed
services.AddMediatR();
services.AddTransient(typeof(IRequestPostProcessor<,>), typeof(PostHandler<,>));
What am I missing?
You need to register the behavior associated with post-processors, like this unit test shows.
Your registration code would look like:
services.AddMediatR();
services.AddTransient(typeof(IRequestPostProcessor<,>), typeof(PostHandler<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestPostProcessorBehavior<,>));
That behavior will get all the post-processors you registered and execute them.
Edit
After a comment about the post-processor running twice, I had a look at the code that registers MediatR in the ASP.NET Core built-in DI container, and it turns out instances of IRequestPreProcessor<TRequest, TResponse> and IRequestPostProcessor<TRequest, TResponse> are automatically registered as you can see here. What's left to do to get them running in the pipeline is just register the associated behavior. So the necessary registration is then:
services.AddMediatR();
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestPostProcessorBehavior<,>));
I encountered the same issue as Larsi in the comment above. My code looked like this
services.AddScoped<IPipelineBehavior<AddMessageRequest, MessageResponse>, RequestPostProcessorBehavior<AddMessageRequest, MessageResponse>>();
but the behaviour still executed twice. My solution was to simply not register it manually, seems like the registration is handled otherwise now.
In my case services.AddMediatR(Assembly.GetExecutingAssembly()); was enough.
Would be nice if someone could expand on why this is.

Open direct links to AX-objects or datasets from external application

Is there a way to open a specified document, eg "production order 123" or form, eg "purchase orders" in Ax2012 from an external application directly?
In detail, I'm looking for something similiar like AXPath, but this doesn't work with versions greater then 2009.
Is there any ( maybe included ) way to achieve this?
There is! It's using AX's drilldown functionality which uses AxHLink.exe to handle dynamics:// URLs, which are passed to the Classes\SysStartupCmd function. You could also create some custom code there if you wanted to launch the AX client executable directly.
My question I asked some while back should have a great deal of useful information in it here:
What handles dynamics:// URLs?
Some more can be found: http://technet.microsoft.com/en-us/library/aa834337.aspx
EDIT:
It sounds like you are confused or the posts weren't clear enough. I think you have 3 basic options.
Dynamics:// URLs are handled by AxHLink.exe and they only seem to handle drilldown, viewalert, and viewalertrule. So if you want to use Dynamics:// URLs, you will need to hi-jack those somehow. There is a pastbin from Jan in that other stack post.
Create a custom URI handler and event poller (lot of work) see http://axcoder.blogspot.dk/2010/10/how-to-open-form-in-running-ax-from.html
Extend SysStartupCmd and then instead of using Dynamics:// URLs, just call Ax32.exe -startupCmd directly and a parameter can be passed to your custom class.

CurrentWorkItem.ID is correct or not in workflow script editor?

I am using Tridion 2011 SP1, And I am creating workflow like start-->create-->Review-->publish--Stop.
I created and registered the class library, and invoke the C# method using VBscript (Script Editor of WF Tab) as given below.
Option Explicit
Dim workflowHandler
Set workflowHandler= CreateObject("CoreComponentWorkflow.WorkflowHandler")
If Not workflowHandler Is Nothing Then
Call workflowHandler.PublishComponent(Cstr(CurrentWorkItem.ID))
FinishActivity "Published to WIP"
End If
Set workflowHandler= Nothing
Is the above code is correct? I am sure I am able to create object using the below line.
Set workflowHandler= CreateObject("CoreComponentWorkflow.WorkflowHandler")
And currently I am publishing the current item only using the C# code, am calling the C# function as below.
Call workflowHandler.PublishComponent(Cstr(CurrentWorkItem.ID))
After publishing the item, I am finishing the activity using below.
FinishActivity "Published to WIP"
I have checked the above code directly in the server by hard coding the currentworkitem, it was working fine. But when I put the same code in vbscript editor, the item is not published.
Can any one suggest on this?
When you hardcode you might be adding the TCM ID directly so it is working properly, which means that CurrentWorkItem.ID is not the correct API call to get the Component ID. See Igor comment below to get the tcm id.

Jquery Validation Not working throwing error $.validation is undefinedj

jQuery validation is working fine on my machine, when i pushed it to test server it won't it's throwing some errors which is kind of surprising.
These are the errors I am getting:
$.validator is null or not an object...
I've never gotten this error before and it throwing an error when I declared a variable like var isValid.
I don't know what to do. I am doing the custom validation methods not in the document.ready(). Does this cause this error? I wonder because all jquery validations are passing and hitting the server side validations.
Almost always this type of $.<insert-function-here> is a path or typo error, jQuery cannot find the function. Check your includes and script for typos and verify the paths are correct.
I just found it...there is mismatching of version for validation plug in and jquery base file..i don't know how it is working on my machine..i don't know..I just changed my jquery file to 1.4.2 and validation plug in to latest one..and its working perfect...thanks for your reply.. –

Resources