w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to implement Remote validation in Umbraco 6.0 for MVC
It may just be me, but your configured route isn't the same as the URL you are using. You URL starts with /us/ but this is part of the path is missing from your route, so it would throw a 404. You could change your route to "us/Stores/{action}/{id}" perhaps and see if that works.

Categories : C#

In Umbraco 6.1.1 MVC 4, how can I do a form post back to a surface controller using a model that inherits from Umbraco's RenderModel?
Ok, I've had no responses to this question but am now in a position to answer it myself. Maybe it was a fundamental oversight, but not that obvious imho, and information on the Umbraco forum etc about inheriting from RenderModel is fairly limited. Essentially the answer, as was my first instinct, is to solve the original exception "No parameterless constructor defined for this object" by providing a paramaterless constructor. The difficulty is working out what to put inside the parameterless constructor for my model, since it inherits from the Umbraco RenderModel which requires an IPublishedContent instance passed to it's constructor. Luckily while browsing around I happened across this post on the Umbraco forum: http://our.umbraco.org/forum/developers/api-questions/40754-Getting-Curre

Categories : Asp Net Mvc

Umbraco MVC Implementation - View does not depend on Umbraco implementations
No you can't. Simply because all requests pass through a single action. In order to retrieve a path to a CMS-managed page, you need to use the node/content traversal the @Model provides. See here for more details on this. Edit To clarify, the author of the article is suggesting that the Umbraco implementation should be more in line with a traditional MVC implementation with little or no logic in the views. Therefore, any querying of node data should happen prior to the view (e.g. in the Mappers). So this is where you would have to retrieve the links. Umbraco's default MVC implementation forces all requests to go via a single action on a single controller. The author's implementation allows the requests to be shared across one controller per document type - which is better IMO. But it st

Categories : Asp Net Mvc

Umbraco MediaService / Umbraco MediaItem not saving
To Save media, I found this method with MediaService. However, I think it's possible another method more refined [HttpPost] public JsonResult Upload(HttpPostedFileBase file) { IMedia mimage; // Create the media item mimage = _mediaService.CreateMedia(file.FileName, <parentId>, Constants.Conventions.MediaTypes.Image); mimage.SetValue(Constants.Conventions.Media.File, file); _mediaService.Save(mimage); return Json(new { success = true}); }

Categories : C#

Umbraco - error when using umbraco.library:NiceUrl(...)
Ok I found a solution: I added an extra check to this part: <!-- Return the url --> <xsl:if test="$i = $max"> <xsl:if test="$id != '' "> <xsl:value-of select="umbraco.library:NiceUrl($id)" /> </xsl:if> </xsl:if> this fixed my problem.

Categories : Xslt

NetBeans Remote Development with additional configuration
It turned out that setsee is more or less an internal tool. Yet “the core question” remains: how to have an arbitrary script executed on behalf of an SSH session created by IDE, before IDE actually uses that script. Answer to the “How can I set environment variables for a remote rsync process?” question on Super User says it all. To summarize it shortly: in ~/.ssh/authorized_keys one has to modify an entry corresponding to the key with which the IDE will log in. There one has to add a command parameter that is a script to be executed after logging in but before “returning control”. There is also another thing associated with that solution. If the script to be executed within the command option outputs anything the it will break many tools (possibly the IDE as well). Such too

Categories : C++

GIT: Managing repos between two remote development teams
This isn't a simple problem. When you have two repositories that simultaneously update each one of them you can get conflicts when sync-ing them. Conflicts may need human interaction to be solved the correct way. One way to solve this is to always sync, while pushing to B, A is locked down and then B is pushing to A and A is unlocked again, and the other way around. This is probably not a good solution for you. I suppose that you have bandwidth limitations, otherwise all devs would work directly with A. So, let's do some magic. You have a timezone difference. Let's move the master repository twice every day. Make B read only and let all devs push to A. Let B do a pull. Make A read only and let all devs push to B. Let A do a pull and so on. You would always have fast-forward updates (i

Categories : GIT

Preferred method of adding records to custom tables in Umbraco?
There are two answers to this question: Use a framework/solution like EF; Use Contour If you haven't looked at it, Contour is an Umbraco plugin that does exactly what you need. See here for more information about Contour. However, for more control I use PetaPoco or more recently NPoco (via NuGet) and also Autofac to inject the Database (analogous to DataContext) into the constructor of my Controllers. This is super easy and if you aren't already using an IoC container like Autofac in your builds I would highly recommend looking into it. Especially if you stick with EF, as you could ensure that a single DataContext object was created and disposed for each request, making sure that you didn't have multiple contexts floating about.

Categories : Asp Net Mvc

Could not locate Razor Host Factory type: umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines
If you are trying to host the blogengine site within a virtual directory of the Umbraco site, then you will have to amend the blogengine web.config to "remove" all the Umbraco-specific handlers and modules, as these will be inherited by the blogengine application, causing this exception because the application can't find the relevant DLLs in its bin folder. I recently had a similar problem and I have posted the web.config I used in the virtual directory below. Mine was a very simple web application, so obviously this will not work by itself in your blogengine app. You will need to add the relevant parts into your web.config file. Also, this was for a v6 Umbraco install in IIS7.5, so you may have to experiment a little. <?xml version="1.0"?> <configuration> <configSecti

Categories : Iis

Script working fine on development server but not remote server
If its timing out on the server it's more than likely because a link to a resource in your script is not pointing to the correct location. Leading to a function call not working or other resource not being found.

Categories : PHP

Android Development: Undefined Method
openSearch() and openSettings() are methods that the author of the tutorial created in order to perform other operations. Search well into the code, there must be somewhere the declaration of those methods, if the author made them visible. They should look something like this: public void openSearch() { //Do something here. } public void openSettings() { //Do something here. } Replacing the //Do something here with the code implementation present in the tutorial.

Categories : Android

Git flow to work with troubled development method
If scheduled and weekly releases share common codebase (i.e you have single development mainline and one supported version per system) you can use "Branch per task" idea and Git Flow as implementation of idea. Would a different version control system work better? It's (mostly) a question of personal tastes and preferences

Categories : GIT

Which is the best method for filtering user selection in android development?
You are going in right direction. I am also doing same kind of project using two spinner.select the 1st spinner and based on the Item selected add items to 2nd spinner in spinner1.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub //add items to array/arraylist of 2nd spinner }

Categories : Android

Django Development Server, blank HttpResponse on Post Method
Although it doesn't actually solve the question at hand, I found a way that was much better for what I was trying to do. I discovered that everything in my code for the POST Method worked except the output or rendering of a template. HttpRedirection worked, and also the Django Messages System. I found a tutorial on how to use that and it works perfectly for posting responses back to the originating template. The Django Messaging system, for those who aren't aware, is a way to add details back to the originating request object. Here's a snipper messages.success(request, "success message") return HttpResponseRedirect(request.path) The first line of code is attaching the message to the request object (in this case the same one that was passed in to the view) and then in the second line o

Categories : Python

undefined method `title' for nil:NilClass Agile Web Development with Rails
It may happen because cart item model do not save product_id. 1) First, add validation to LineItem model. It will not solve issue, but you will be sure that issue is related with product_id. validates :product_id, presence: true 2a) Update controller to play with Rails 4 strong parameters: http://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html 2b) Or use Rails 3 while learning Ruby On Rails. UPDATE. You should also remove previous LineItem records from DB using rails console, otherwise you will still see this error, because old LineItems not associated with Product.

Categories : Ruby On Rails

Rails - Undefined Method in Staging, but fine in local development
Check your bundler groups, application config, and environment initializer files, maybe you have something defined as being development-only and not staging? Also try opening a console up on staging and trying to manually load and invoke the module that's not found. Remember that require returns true if the module was not already loaded.

Categories : Ruby On Rails

Do any standards and practices exist for applying acceptance test driven development to non-development tasks?
Take a look at this post in StackExchange: Agile methodologies such as Scrum in non-software development projects Also there is a nice article called "Scrum is not just for software" written by the Agile Alliance (note that this is a PDF download)

Categories : Misc

Java: Remote Method Invocation (RMI)
The Registry doesn't have your remote interface on its CLASSPATH. IMHO the best solution to this is to run the Registry inside your server JVM, with LocateRegistry.createRegistry(). As far as I know I no longer need to make stub file Not correct. See the preamble to the Javadoc for UnicastRemoteObject. You would need to provide a super(0) line in your remote object's constructor to satisfy the conditions specified there.

Categories : Java

Custom validation with ajax.....Here remote method is not working
Your brackets are not closed properly. You have an extra }, Keep your code well-indented to avoid such minor mistakes in the future. This should be your code instead: function submitForm() { $.validator.addMethod("subTitleVal", function (value, element) { return this.optional(element) || /^[A-Za-zs\_,.:;()''""]+$/.test(value); }, "Enter Valid Name."); var validator = $("#company").validate({ errorPlacement: function (error, element) { offset = element.offset(); error.insertBefore(element) error.addClass('message'); error.css('position', 'absolute'); error.css('left', offset.left + element.outerWidth()); }, rules: { name: { required: true,

Categories : Validation

Display form's message by remote method using ujs on Rails
First, change your books_controller so that it will always render create.js.erb whether the book is persisted or not. def create @book = Book.new(params[:book]) respond_to do |format| if @book.save format.html { redirect_to @book, notice: 'Book was successfully created.' } format.json { render json: @book, status: :created, location: @book } else format.html { render action: "new" } format.json { render json: @book.errors, status: :unprocessable_entity } end format.js end end Then, in you create.js.erb, you will want to check whether your book is persited? or not: <% if @book.persisted? %> # ... <% else %> # display the error message <% end %> Let's say we are going to display the error message in a <p> with t

Categories : Ruby On Rails

Reading a property file from a remote location using getResourceAsStream() method
Hi Can I use the below code to read a propery file from a remote location in internet. Probably not. You can only use it to read a property file that is available on the CLASSPATH. Unless you are using something like the RMI codebase feature, or URLClassLoaders, your CLASSPATH does not include network locations. You don't seem to understand what getResourceAsStream() is actually for.

Categories : Java

modifying url of jquery validation plugin remote method with php framework
I've managed to get this to work with laravel by changing the code to the following: rules: { ticket: { remote: { type:"POST", url:'/ticketaudits/validateTicket', } } }, I'm then handling the server side code by getting the parameter from the post request rather than from the get request/url/ It works - so happy with that now to get the returned messages to work but thats another question!

Categories : Jquery

ruby on rails, agile web development with rails, build method with array
There's nothing you can do, but looping over all products and creating line items for them. Just like this: @cart = current_cart @line_items = [] params[:product_ids].each do |product_id| product = Product.find product_id @line_items << @cart.line_items.build(:product => product) end

Categories : Ruby On Rails

WCF after executing service method. System.ServiceModel.CommunicationException: The remote server returned an error: NotFound
Silverlight always throws NotFound if the WCF throws an error, because the HTTP response code would be 500: this error code forces Silverlight to throw NotFound. So, first of all try to debug the WCF while doing this call. If you can't do that, make the WCF log the error somewhere. If you like having the correspondent error thrown on the silverlight side, you have to use a server WCF behavior that makes the WCF answer with 200 code even if an error occurred. More information here: http://msdn.microsoft.com/en-us/library/ee844556(v=vs.95).aspx

Categories : C#

Umbraco throwing 404
Unfortunately both your links are going to the IIS error page as well as all the other errors on the site so we cant tell what you sitemap should be, see this link for tips on how to set up the 404 page http://www.simonantony.net/knowledge-base/articles/how-to-setup-a-404-error-page-on-your-umbraco-site/ . Make sure that's working across the whole site then with you Google site map is it an XML sitemap or HTML sitemap and how have you implemented it did you use a package or made it you self.

Categories : Iis

How to use RazorPDF in Umbraco 4.11
The best place to start for what you need is here: http://our.umbraco.org/documentation/Reference/Mvc/ But no, strictly speaking you don't need a SurfaceController. You would only need one if you wanted to access the Umbraco context for the requests you are making via the controller. So if you just want to have a controller serve up your PDF, you can have a standard controller implementation. You will have to adjust your routes for this though, and this is all covered in the Umbraco documentation above. Edit: You'll need a route like this: RouteTable.Routes.MapRoute( name: "PdfRazor", url: "PdfCreator/{action}" ); You will also need to add the path to the Web.config for Umbraco to ignore, e.g: <add key="umbracoReservedPaths" value="~/umbraco,~/install,~/pdfcreator" />

Categories : Asp Net Mvc

Bootstrap 3 in Umbraco
As far as I know there is no starter kit, or package for it. But it shouldn't be too tough Create your new Umbraco site first, just a bare bones site, no themes, no kits, no packages(yet) Download the new bootstrap files and add the bootstrap img folder and css files to your StyleSheets folder, add the bootstrap.min.js to your Scripts folder. Make a new master/global template that references all of your bootstrap dependencies Make all other templates use this new template as their master. Hope this helps get you going.

Categories : Twitter

Upgrading umbraco from 4 to 6
Yes, according to the bug report you can install a Umbraco v4.11.x and then upgrade this to v6.1.x and this should work fine. The downloads are all available here: http://our.umbraco.org/download However, the easiest way to get Umbraco set up is to use NuGet in Visual Studio. So you could run the following line from the NuGet console: Install-Package UmbracoCms -Version 4.11.10 You'll have to use the console for this because if you use the Package manager, it will just install the latest Umbraco package version. Next, load your site in a browser and configure the database settings. Then upgrade using NuGet again. I find the easiest way to do this is to open the NuGet package manager in Visual Studio, select "Updates", find the Umbraco package and click "Update". This will automatical

Categories : Mysql

FileSystemProvider for Umbraco v6.1
Why is it that I spend hours trying to find the answer and then find it soon after I post? The issue was two fold: 1) I should've been implementing IFileSystem (took inspiration from AmazonS3Provider source) 2) the parameter name being passed from FileSystemProviders.config file was not included in the constructor

Categories : C#

URL rewriting in ASP.Net Umbraco
Try: <add name="301_bname" redirectMode="Permanent" ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite" virtualUrl="^~/brands/(.*)" destinationUrl="~/$1" /> The virtualUrl parameter uses a regular expression to match the incoming URL. You can then use the $1 notation to pass the pattern to the destinationUrl parameter. Since both urls are on the same domain, and (I assume) within your web application, you don't need the redirect="Domain" part, and you can use relative URL paths.

Categories : Asp Net

URL rewriting not Working in Umbraco
Try this: <add name="redirect_brands" redirect="Application" redirectMode="Permanent" virtualUrl="^~/brand/(.*)" rewriteUrlParameter="IncludeQueryStringForRewrite" destinationUrl="/$1" ignoreCase="true" /> I think you're missing the ~ in the virtualUrl

Categories : Asp Net

Umbraco's useage of Tempdata
It depends on how you set up your instances of Umbraco. I have just set a load-balanced website using Umbraco, and although the published website is load-balanced, the Umbraco back office isn't. This is mainly because it doesn't need to be. You would load-balance an application if the traffic was going to be high enough to warrant it, but with the Umbraco back-office, it's possibly unlikely that it is going to have that load of traffic. Check this article out, it explains some of the options available. I set up the published site to be loadbalanced across two servers. Both instances of the published site resolve against a primary domain (www.site.com), but each instance has a unique, non-loadbalanced sub domain (u1.site.com and u2.site.com). The back office has it's own subdomain (admin

Categories : Asp Net Mvc

Umbraco add CC while sending mails
Umbraco's SendMail() helper method is (purposefully) very basic. It is actually only a few lines that creates a MailMessage instance with the from and to values and sends it via the SmtpClient.Send() method. The ToMail parameter can actually accept multiple email addresses, presumably comma or semi-colon delimited. But these would not be CC recipients. You would actually be be better off just creating your own method.

Categories : Api

Image rendering in umbraco
So when it doesn't display the images does it not display the whole <li> element? From the piece of code you've given there's nothing there about different logic for the different languages. What if in your XSL template you remove this whole chunk of code and just take it back to basics. <li>test</li> I suspect that the language choice is messing something else up somewhere else in the page. Just try simplifying the page one step at a time by removing the Macros.

Categories : Asp Net

Umbraco not rendering IE box shadows
I'm guessing the link to your css is relative or something, it's got absolutely nothing to do with umbraco - you have full control over the html. Perhaps paste a link to your website or your html code. also for cross browser drop shadows you need something like this -moz-box-shadow: 3px 3px 4px #444; -webkit-box-shadow: 3px 3px 4px #444; box-shadow: 3px 3px 4px #444; -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#444444')"; filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#444444');

Categories : HTML

Umbraco 6.05 on Windows Azure
There are no different in term of how they store the file whether you use Web Sites or Cloud Services as long as you didn't modify the Umbraco. Both Web Sites and Cloud Services keep the file, in this case, the Media folder in their local storage unless you modify Umbraco to save into Blob Storage to have a better scaling. You can write and modify your own custom Media location or try to look at this URL http://our.umbraco.org/projects/backoffice-extensions/universal-media-picker

Categories : Azure

Umbraco quotation marks
Actually I don't think it is putting quotes round it, that's just how your browser is showing the rendered value in its code view. What is happening is that the XSLT is outputting the value as an encoded string instead of unencoded HTML. You need to add the attribute disable-output-escaping="yes" and the outer p tag: <div><xsl:value-of select="./broed" disable-output-escaping="yes" /></div>

Categories : HTML

Umbraco error "Looks like there's still work to do"
I assume you are seeing the error in the database's [umbracoLog] error table? Have you just migrated your site to a new server? If so, your umbraco.config file may be missing. This is usually why you see the "Looks like ..." message, because nothing has previously been published. Also, check the permissions on the site to ensure that modify permissions have been given to the correct folders. If none of these help, one of your doc types or pages may be corrupt, meaning that when a page or pages of a particular doc type are being saved, Umbraco thinks there should be a particular property on the doc type when there isn't. Check the Umbraco logs in the database [umbracoLogs] table, and see if there is a reference to a particular doc type or page being saved. The solution here would be to

Categories : Asp Net

Where is DefaultRenderMvcControllerResolver located in Umbraco Api
The namespace is Umbraco.Web.Mvc but only available from v6.1 onwards I think. All the code is open source and available at https://github.com/umbraco/Umbraco-CMS

Categories : C#

Can't download Umbraco CMS with NuGet
Is the space in "Umbraco CMS" the issue? I can nuget it from VS as follows: Tools | Library Package Manager | Package Manager Console PM> install-package umbracocms (hit enter key)

Categories : Visual Studio 2010



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.