w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Enable/Disable all controls at client side on checkbox click in MVC 3
You can try this: //Code Starts $(document).ready(function() { $("#btnDisable").click(function(e) { $("*").attr("disabled", "disabled"); e.preventDefault(); }); });​ //Code Ends

Categories : C#

Ember user authentication (Client side and Server Side completely separated)
Ember-auth isn't necessarily just for apps. You can configure the endpoints like signInEndPoint and signOutEndPoint to point to the urls that need to be hit on your server to do authentication. Also there isn't any reason to bundle the client-side and server-side in the same repository here. The demo does this because the asset pipeline support in rails is very convenient for demoing, typically for avoiding a front-end build step. You can treat it as just a library file that you include alongside ember.

Categories : Ember Js

Does MVC Razor generate HTML for the template in the view on client side or server side?
I want to understand where the Razor View Engine actually generates the HTML from the templates that we create in the view It happens on the web server. Once the HTML is fully created on the web server, this HTML is sent to the client browser.

Categories : HTML

Crop and upload image on client-side without server-side code involve
The solution i used: First I use a 3rd party javascript library to select the crop area like jCrop. Once i got the coordinates (x1,x2,y1,y2), i draw a copy of an image to a canvas. var canvas = document.getElementById('drawcanvas'); var context = canvas.getContext('2d'); canvas.width = canvas.width; // clear canvas var imageObj = new Image(); imageObj.onload = function() { // draw cropped image // ... context.drawImage(imageObj, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, sourceWidth, sourceHeight); var dataURL = canvas.toDataURL(); }; imageObj.src = // image url After i drew the canvas, i converted the canvas to a DataURL which is in base64 format. On

Categories : Javascript

REST API and clients - removing previously seen items - client-side or server-side?
First off, if the requirement is to not show a user products they've seen before on any device/platform (for example if they used the app on their iphone then ipad/ipod) then you'd definitely have to do it server side (as the app cannot know what the user has seen on other devices unless you are storing it on the server). Assuming, it is a device specific requirement, I would think your goal would be to minimize (potentially unreliable or slow) network traffic to optimize the iphone experience. Syncing back and forth with the server will require extra network traffic, which may fail at times. Which would lead to a conclusion of client side storage. Unless your users are going to be seeing some huge number of products that would chew up disk space, but I assume the amount of data you store

Categories : IOS

Parsing Google Maps API GeoCode - server side or client side?
Is this a website or an application that you need to hit geocoding servers on every request? If so, you should use client-side. If you have some predefined latLng values then you can use server side geocoding and cache the results for a couple of hours. This way, you probably won't need to worry about quota. From Google Developers' site: When to Use Client-Side Geocoding The basic answer is "almost always." As geocoding limits are per user session, there is no risk that your application will reach a global limit as your userbase grows. Client-side geocoding will not face a quota limit unless you perform a batch of geocoding requests within a user session. Therefore, running client-side geocoding, you generally don't have to worry about your quota. See here

Categories : Google Maps

Timer, timezone, server side time, client side countdown
You can use php DateTime for this. The current time The midday time The midnight time Here is an example. $now = new DateTime; $morning = new DateTime('08:00'); $night = new DateTime('22:00'); // next time is night if( $now > $morning && $now < $night ) { $time = $now->diff($night); } // next time is day else { $time = $now->diff($morning); } $target = $time->format('%h:%i:%s'); // returns a string.

Categories : PHP

How to get data from client side(android) to server side(ROR) in create action(post method)?
The request made from the client side is somewhat similar to this if I'm right: The post data from your client side is of the form: &content=valueIWantToSend In the ROR application, in the def create method, params[:content] will equal valueIWantToSend. Either change params[:post] to params[:content] on the server-side or change content to post on the client-side (Inside the try block)

Categories : Ruby On Rails

Performing both client side and server side functions on button click - Specific Scenario
ASPX: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="js/jquery-1.10.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('#lblCheck').hide(); $('#btnProceed').click(function () { var $this = $('#chkTerms') if ($this.is(':checked')) { $('#lblCheck').hide(); return true; } else { $('#lblCheck').show();

Categories : C#

Sending from server-side to client-side multiple PartialViews asynchronously with an undefined delay
Use SignalR is one option but if you wanna do yourself instead of inherit your controllers class from Controller, inherit it from AsyncController. Controllers that inherit from AsyncController can process asynchronous requests, and they can still service synchronous action methods. public class HomeController : AsyncController { public void ExtensiveTaskActionAsync() { AsyncManager.OutstandingOperations.Increment(); Task.Factory.StartNew(() => DoExtensiveTask()); } private void DoExtensiveTask() { Thread.Sleep(5000); // some task that could be extensive AsyncManager.Parameters["message"] = "hello world"; AsyncManager.OutstandingOperations.Decrement(); }

Categories : C#

How to make client side click event handler to request a server side method
Use can do like this : $('a').click(function () { var data = { userName: $(this).attr("id") }; var dataVal = JSON.stringify(data); $.ajax({ type: "POST", url: "Default.aspx/loadNewPage", contentType: "application/json; charset=utf-8", data: dataVal, dataType: "json", success: function (id) { alert("loaded"); } }); }); [WebMethod] public static void loadNewPage(int id) { // do the loading of the new HTML, etc. } You can know more about Jquery AJAX call over here.

Categories : C#

call server-side function from client-side in mvc3
You have to modify you method public ActionResult Media() { //do some stuff here return View(); } to something like public JsonResult Media() { //do some stuff here return Json(new { myData = RenderPartialViewToString("ViewName", optionalModel), errorMessage = error }); } Add following method with reference to ASP.NET MVC Razor: How to render a Razor Partial View's HTML inside the controller action protected string RenderPartialViewToString(string viewName, object model) { if (string.IsNullOrEmpty(viewName)) viewName = ControllerContext.RouteData.GetRequiredString("action"); ViewData.Model = model; using (StringWriter sw = new StringWriter()) { ViewEngineRe

Categories : Javascript

connect server-side computing with client-side visualization
First of all, I would suggest JSON rather than XML to be used for exchange format, it is much easier to parse JSON at the javascript side. Then, speaking about the architecture of your app, I think that it is better to write a server web application in Python to generate JSON content on the fly than to modify and serve static files (at least that is how such things are done usually). So, that gives us three components of your system: A client app (javascript). A web application (it does not matter what framework or library you prefer: django, gevent, even Twisted will work fine, as well as some others). What it should do is, firstly, giving the state of the points to the client app when it requests, and, secondly, accepting updates of the points' state from the next app and storing the

Categories : Javascript

How to invoke server-side function from client-side using socket.io?
Client.js <script src="/socket.io/socket.io.js"></script> <script> var socket = io.connect('http://localhost'); $("#urAnchorTagId").click(function(){ socket.emit('urEvent','urData'); }); </script> Server.js var app = express(); var server = http.createServer(app); var io = require('socket.io').listen(server); server.listen(8080); io.sockets.on('connection', function (socket) { socket.on('urEvent', function (data) { function init(){ //ur task }; }); });

Categories : Node Js

Send gridview data from client side to server side at once
You should add loader for this kind of functionality. I hope you should be using update panel. You can add update progress control for the time request is processing on server side. It will hint the user to wait. You can also use ajax request by jquery to do similar kind of work.

Categories : Javascript

php's server side associative arrays to html's client side
You haven't mentioned jQuery in your tags, but that is what I would look at. Specifically, the jQueryUI library, which runs on top of jQuery. jQuery is a javascript library that is more efficient (less typing, do more with less code) than classic javascript. See the jQueryUI sortable widget, here. For jQuery tutorials: Alex Garret's jQuery tutorials at the thenewboston.com Alex Garret's website with many more tutorials.

Categories : PHP

Pass a user geolocation from client side to server side
You have to add callbacks for success / error to trigger an event when the user accepts to share their location: navigator.geolocation.getCurrentPosition(success, error); function success(position){ var lat = position.coords.latitude; var lon = position.coords.longitude; document.getElementById('location').value = lat + ',' + lon; } function error() { // do something with the error message }

Categories : Javascript

Wanting to POST a Javascript Variable (From Client Side) to PHP File (Server Side) with AJAX JQUERY call
There could be many different things going wrong here. First, I think your jQuery's $.post snippet is wrong (you're missing a matching curvy bracket and a semicolon at the end) so I find it weird that your server informs you about a successful POST. I'd change this: function() { jQuery.post( 'packed_data.php', {'packed_dat': packed_dat}, function() { alert('Write OK!'); }) Into this: $.post('packed_data.php', { packed_dat: packed_dat }, function (data) { alert('Write OK!'); }); And then, in your packed_data.php script, give $uid a default value so in case $_POST['packed_dat'] isn't set, it still creates a file or not (and from that distinguish whether the problem is in the server side or in the client side).

Categories : PHP

client side and server side page generation
From my experience, there are two scenarios in which you'd want to render client-side: You are building a pure client-side JS application. You want to serve the data for different platforms (web, desktop, mobile native). Unless you identify your page with one of the previous scenarios (which I assume you don't), I recommend you to render in server side. Although the response is going to be bigger (server side computing time is negligible), the perceived speed compared to client side rendering is going to be faster. If you need to serve a very big page, note that you could autoload chunks of HTML via AJAX whenever the user reaches the bottom of the page without the need of client side templates.

Categories : Javascript

Accessing Client-Side arrays on Server Side ASP.Net
A valid approach would be to serialize them and assign it to a runat="server" hidden field. You'll be able then to access the array deserializing Value property. You can easily handle serialization with json format or comma separated values.

Categories : C#

Grails - Client Side vs Server Side Templating
I believe people start using client side frameworks to manage growing client side needs (Starting with backbone, ending with Angular/Ember). If your needs are not so severe then you might want to use client side temples like handlebars or mustache or underscore You might have one gsp file filled with various client templates included on page, then just use javascript to paint these templates on page using sample data or data from server. I do not agree that gsp templates lose in this case unless you are building fully dynamic experience or single page app which is usually not the case with grails. EDIT: I have just had a project when I had to consider if I need to move to client side templates all together, was using backbone. And there was one case when having server-side templates w

Categories : Grails

Server-side internationalization vs client-side?
Doing clientside i18n is growing - as implementing clientside applications in web gets more mature. you might get inspired by http://i18next.com/pages/doc_templates.html

Categories : Javascript

OpenSSL client verification - Need client side validation requirements
Just an FYI, Another way to solve this problem may be to run your C program under sslclient, which basically works similar to DJB's tcpclient, but with SSL - i.e. sslclient will spawn your program and open an SSL connection to the server, and pipe your program's stdout to the server, and pipe output from the server to your program's stdin. The nice thing about doing it this way is that you can let sslclient to all the heavy lifting as far as negotiating SSL protocols with the server and doing the actual encryption, and you can focus on the core function of your program. See http://www.superscript.com/ucspi-ssl/sslclient.html for more info.

Categories : C++

In client side MVC, who should handle client-server communication?
The model layer should be interacting with data source. In case of client-server setup where you have two separate and independent triads, the data source for client's model layer would be server's presentation layer. Basically, your client-side's model layer becomes the user of server-side.

Categories : Web Services

Is there a JavaScript (client-side) JSON library that integrates well with JSON.NET (server-side) and supports the "preserve references" feature?
There are few options: Douglas Crockford's original JSON library has plugin called cycle.js that resolved circular references. Also see this answer which has enhanced version of method to resolve references: Resolve circular references from JSON object. Cereal which handles circular references and object graphs better. CircularJSON which is very small and does exactly what it says. Having said that, I would probably refactor my design to avoid circular references because JSON is usually core component and you probably want to use mainstream libraries which is very well tested and supported. One way to avoid circular references is just to create lightweight shim objects and serialize them instead. Alternatively implement custom interface (if you have access to class) that overrides seri

Categories : Json

Client side MVC instead of server side MVC
Was to long for a comment I guess the tricky part is indeed the point you mentioned f we link each other, they will perfectly look like a complex web app. Because each MVC framework uses a different approach to tackle usual problems you have in modern web-apps, like routing, data binding, application state and rendering DOM elements, so I think you would end up having multiple frameworks doing tasks that overlap substantially, thus forcing you to deactivate or disable some of the built-in functionality of one or the other framework making your frankenstein-app :) very difficult to maintain. A good example is jQuery-mobile & ember.js, both have a routing system, jQuery uses the DOM to hold state ember.js holds it's state completely in javascript which is much faster. I had a s

Categories : Ruby On Rails

Set C# Inline Expressions in ASP.NET Controls On Server-Side
Not sure if this would help you, but look at http://msdn.microsoft.com/en-us/library/system.web.ui.databinder(v=vs.100).aspx It is showing using of the hand-written exposure of properties. If your property were always call "magic" and you return the appropriate value for magic within your code would that get you what you need?

Categories : C#

layout_gravity="right" don't make controls to right side in LinearLayout
That's because if android:orientation of LinearLayout is horizontal, the android:layout_gravity's value right and left will be not working.You can only set it to top or bottom. And if LinearLayout is vertical, you can set layout_gravity to left or right, but not top or bottom. So, I think you should use RelativeLayout here...

Categories : Android

asp.net/javascript creating cookies, advantages creating client side or server side?
Are there any alternatives creating the cookie via server side code or via javascript? No. Actually my server side is a asp.net rest service so probably this isn't a good idea? REST services usually do not deal or know about cookies. They could but it's not a common practice. REST services are using different techniques of authentication, such as sending some value in the Authorization HTTP request header. Are there any advantages or disadvantages in using either method? It would really depend on your scenario and what kind of information you are attempting to store. For example with a server side script you could create an HttpOnly cookie which is not accessible by client scripts, only by server side scripts. In any case you should not be storing sensitive information in

Categories : Javascript

Access Controls in RadComboBox ItemTemplate on server-side
Try likes this , foreach (GridViewRow row in GridView1.Rows) { string _rcbDeptSelectedValue = (row.FindControl("rcbDept") as RadComboBox).SelectedValue; }

Categories : C#

WPF DockLayoutManager- LayoutGroup dock controls to the left side(when pinning)
Use the AutoHideGroup.AutoHideType attached property: <dxd:DockLayoutManager> <dxd:LayoutGroup Orientation="Horizontal" x:Name="LayoutRoot"> <dxd:LayoutGroup Orientation="Vertical"> <dxd:LayoutPanel ItemWidth="200" dxd:AutoHideGroup.AutoHideType="Left" Caption="Statuswort" Padding="1"> <TextBox BorderThickness="0" /> </dxd:LayoutPanel> <dxd:LayoutPanel ItemWidth="200" dxd:AutoHideGroup.AutoHideType="Left" Caption="Steuerwort" Padding="1"> <TextBox BorderThickness="0" /> </dxd:LayoutPanel> <dxd:LayoutPanel ItemWidth="200" dxd:AutoHid

Categories : Wpf

how to export datagrid to excel(.xlsx format only) without using server side technology and as3xls?
You can export to Excel2007 - its just an xml file format. WE have some details on our blog: http://blog.flexicious.com/post/Flexicious-30-Release-Grid-Edition.aspx. Keep in mind however, it generates an XML file, which when you double click on, will correctly open up excel (Assuming you have excel 2007 or the reader installed).

Categories : Actionscript

Devexpress mvc extensions. Whether these extensions are server side or client side?
That depends on what you mean by "are server side or client side". It is not a pure Javascript library. They use features of the MVC framework in order to do their magic, so I'd say they are both (but not just one side). More specifically, they implement custom controls that you include in your views. The controls have settings and such that you set on server side. However, the code generated relies on Javascript so they run on the client (using ajax calls when necessary). See documentation and examples here: link

Categories : Asp Net Mvc

Undefined CLR namespace Facebook.Client.Controls
No seu projeto você tem alguma Pasta ou Classe com nome Facebook (criados por você)? Caso sim, renomeie. Deve estar dando conflito. Acredito que isso resolva. In your project, do you have any folder or class named Facebook (created by you)? If yes, rename. Should be giving conflict. I think this solves.

Categories : Misc

What's the minimum requirement for the DataSource property of ASPX server side data-bound controls?
Yes the DevExpress ASP.NET controls can be data bound to anything that supports IEnumerable. Online help docs: WebForms DevExpress ASP.NET GridView MVC Data Binding Hope that helps. If you have other questions, please feel free to contact the DevExpress support team: http://www.devexpress.com/Support/Center/CreateIssue.aspx?issuetype=Question

Categories : C#

Why {} + {} is NaN only on the client side? Why not in Node.js?
Very interesting question! Let's dig in. The root cause The root of the difference is in how Node.js evaluates these statements vs. how the Chrome development tools do. What Node.js does Node.js uses the repl module for this. From the Node.js REPL source code: self.eval('(' + evalCmd + ')', self.context, 'repl', function(e, ret) { if (e && !isSyntaxError(e)) return finish(e); if (typeof ret === 'function' && /^[ s]*function/.test(evalCmd) || e) { // Now as statement without parens. self.eval(evalCmd, self.context, 'repl', finish); } else {

Categories : Javascript

ServiceBehavior on client side
Wsdl.exe or "Add Service Reference..." generate proxy classes, datacontracts & config based upon exposed metadata. Commons ways to expose metadata is by using a mex endpoint or exposing a wsdl. Basically, Behaviors are simply not exposed. That's why you can't generate the same endpoint behaviors on client side. What is important here, is that many behaviors are "local settings only" (for a service OR for a client ). It does not tell to clients how to call the service, but how the service should run.

Categories : C#

Client side Breeze JS
Yes, with the caveats that you will still need to supply Breeze metadata either on the client or the server, and of course, you will not be able to use any of the EntityQuery.methods like 'where', 'take', 'skip', 'orderBy' etc. The Breeze samples include an "Edmunds" sample that talks to an arbitrary REST api. Excerpted here: var serviceName = "http://api.edmunds.com/v1/api/"; // edmunds var ds = new breeze.DataService({ serviceName: serviceName, hasServerMetadata: false, useJsonp: true, jsonResultsAdapter: jsonResultsAdapter }); var entityManager = new breeze.EntityManager({dataService: ds}); var q = EntityQuery.from("vehicle/makerepository"); // this will call -> "http://api.edmunds.com/v1/api/vehicle/makeRespository" myEntityManager.executeQuery(q).then(...);

Categories : Javascript

Could not get the apid in the client side/js
You need to use Phonegap 3.0, as stated on the Github page, and if you look at the Example/index.html you can see that they get the push object using: var push = window.plugins.pushNotification; Then push.registerEvent('registration', callback) should work.

Categories : Android

Permissions/ACL in a JavaScript Client Side App
To make elements hidden/visible on the screen I do inline checks in my template, something like: <% if (user.isInRole('ADMIN', 'MNGR')) { %> <li <% page == "store" ? print('class="active"') :'' %>> </li> <% } %> and added the following helper function inside my user model to check for the permissions: isInRole: function (rr) { var self = this; $.each(rr, function(i) { if (rr[i] === self.currentRole) { alert('pass'); } }); } I assume this is secure-enough, since the actual check for required permission happens again on the server side. By hiding some controls I'm just guiding the user through the application and not letting him to be confused him with actions for he/she doesn't have the required privileges.

Categories : Javascript



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