Search Results

Search found 2312 results on 93 pages for 'whats your favourite'.

Page 60/93 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • Why doesn't Request.IsAjaxRequest() work in ASP.NET MVC 3?

    - by Rob Ellis
    I'm creating a new project, asp.net mvc3 with Razor, and wanting to turn the LogOn into an ajax request. HTML @using (Ajax.BeginForm("LogOn", "Account", new AjaxOptions { HttpMethod="post", OnSuccess="LoginSubmitted"})) { } Controller if (Request.IsAjaxRequest()) { return Json(new { ResultMessage = "Username or password provided is incorrect"}); } else { ModelState.AddModelError("", "The user name or password provided is incorrect."); } Everything else remains the same. First, looking at the the http response with Fiddler, I notice there is no x-requested-with header. So I add <input type="hidden" name="X-Requested-With" value="XMLHttpRequest" /> That seems to work, but now what I receive back is a Json object, which isn't being parsed and instead Google Chrome is just rendering the Json to screen. Whats happening?

    Read the article

  • jQuery/Ajax/javascript in FireFox Error when using $.post/$.get

    - by IsenGrim
    uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost/scripts/jQuery.js :: anonymous :: line 808" data: no] Line 0 is the error i get when i bring up firebug. This only happens in firefox (and maybe other browsers) but the code works fine in IE8. I have codes like this in jquery: $("#Logout").live("click", function (e) { e.preventDefault(e); $.post("/logout.php", {}, function () { //--a bunch of animations--// window.location = "/login.php"; } }); I have no idea whats wrong as even the error message is not helpful at all.. inside logout.php: <?php session_start(); session_destroy(); ?> Also dont work if I used GET or inserted phantom data. Or is there a more elegant way to do this?

    Read the article

  • Send through Email, or store in database?

    - by user156814
    I have wondered when it is best to send an email, and when its best to store data in a database/log file. Everytime a user wants to contact me or inform me of soething, I suppose an email is best.. but is an email always preferred over other ways, and in what cases. Possible reasons for being contacted I can think of are questions, suggestions, feedback, reporting abuse, advertising, etc... I assume email, "why add unnecessary things to the DB?", but I figure data in DB would be a lot easier to manage. Whats the better/best way to be informed of things like this.. What is the best way for you (webmaster) to be informed of something by users? through email, or some other way

    Read the article

  • Post Loading ads from Google Admanager

    - by Prem
    I have changed code around to basically load an add the bottom of the page in a hidden div and attached an onload event handler that called document.getElementById(xxx).appendChild() to take the hidden ad and move it into the right spot in my page. This works GREAT.. however when the ad is a text ad it AFTER i move the ad there is nothing in the rendered Iframe. I did tests to see what it looks like before i move it and sure enough the text links load in the IFRAME but the second i do the appendChild call to move the div that contains the ad i seem to loose the contents of the Iframe. Any ideas whats going on <div id="myad" style="display: none;"> GA_googleFillSlot("MyADSlotName"); </div> <script> window.onload = function() { // leader board document.getElementById('adplaceholder').appendChild(document.getElementById('myAd')); document.getElementById('myAd').style.display = ''; </script

    Read the article

  • C++ Class Static variable problem - C programmer new to C++

    - by Microkernel
    Hi guys, I am a C programmer, but had learnt C++ @school longtime back. Now I am trying to write code in C++ but getting compiler error. Please check and tell me whats wrong with my code. typedef class _filter_session { private: static int session_count; /* Number of sessions count -- Static */ public: _filter_session(); /* Constructor */ ~_filter_session(); /* Destructor */ }FILTER_SESSION; _filter_session::_filter_session(void) { (this->session_count)++; return; } _filter_session::~_filter_session(void) { (this->session_count)--; return; } The error that I am getting is "error LNK2001: unresolved external symbol "private: static int _filter_session::session_count" (?session_count@_filter_session@@0HA)" I am using Visual Studio 2005 by the way. Plz plz help me. Regards, Microkernel

    Read the article

  • ADC code in with atmega32

    - by Komal
    uint read_adc(uchar adc_input) { ADMUX=adc_input | (0x00 & 0xff); delay_us(10); ADCSRA|=0x40; //START THE CONVERSION while ((ADCSRA & 0x10)==0); // wait for the conversion to complete ADCSRA|=0x10; //clear the ADC flag return ADCW; } Q: Whats the meaning of "ADMUX=adc_input | (0x00 & 0xff)" ? which input channel we have selected here ?

    Read the article

  • Generator speed in python 3

    - by Will
    Hello all, I am going through a link about generators that someone posted. In the beginning he compares the two functions below. On his setup he showed a speed increase of 5% with the generator. I'm running windows XP, python 3.1.1, and cannot seem to duplicate the results. I keep showing the "old way"(logs1) as being slightly faster when tested with the provided logs and up to 1GB of duplicated data. Can someone help me understand whats happening differently? Thanks! def logs1(): wwwlog = open("big-access-log") total = 0 for line in wwwlog: bytestr = line.rsplit(None,1)[1] if bytestr != '-': total += int(bytestr) return total def logs2(): wwwlog = open("big-access-log") bytecolumn = (line.rsplit(None,1)[1] for line in wwwlog) getbytes = (int(x) for x in bytecolumn if x != '-') return sum(getbytes)

    Read the article

  • Rails - how do you create a user index page like stack overflows with multiple tabs whilst keeping t

    - by adam
    On stackoverflow in the users profile area there are many tabs which all display differing information such as questions asked and graphs. Its the same view though and im wondering hows its best to achieve this in rails whilst keeping the controller skinny and logic in the view to a minimum. def index @user = current_user case params[:tab_selected] when "questions" @data = @user.questions when "answers" @sentences = @user.answers else @sentences = @user.questions end respond_to do |format| format.html # index.html.erb nd end but how do i process this in the index view without a load of if and else statments. And if questions and answers are presented differently whats the best way to go about this.

    Read the article

  • Android application not working on 1.5 firmware?

    - by UMMA
    dear friends, i have created a single page application of showing phonebook data in a list. i am using 2.1 sdk in emulator and application works fine. but in my HTC hero firmware is 1.5 when i try to intall same application on HTC hero application is installed successfully but when i click on app icon it gives me force close error even i have set minsdkversion property in manifest file to 3 here is the log Cat [2010-05-17 12:28:18 - AddressBook]Starting activity com.example.AddressBook.AddressBook on device [2010-05-17 12:28:19 - AddressBook]ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined [2010-05-17 12:28:19 - AddressBook]ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined [2010-05-17 12:28:20 - AddressBook]ActivityManager: Starting: Intent { comp={com.example.AddressBook/com.example.AddressBook.AddressBook} } please help me out whats wrong? any help would be appriciated.

    Read the article

  • my .jar file won't do anything.

    - by David
    I created a program that more or less holds an array of strings as an object and randomly prints one. so basicaly class Happy { string[] namestrings = new string[#] constructor() { fill with some strings} public static void main (String[]arg) { create instance of class do some junk with it method that prints it } method that prints it {} another method } when i compile and run it on the command line it works fine but when on the comand line i type in jar -cf Happy.jar Fun.class i get a .jar file called Happy and when i click on it i get an error message that reads "the java Jar file happy could not be launched read the consol for possible error messages" I have a mac i'm running lepord if that makes a diference. Whats going on?

    Read the article

  • Is it possible to center an image on both axis inside a div?

    - by Noor
    I have a script that loads in a div with images running jQuery Cycle Lite Plugin. I got the tip that I could us the "after" function in that plugin to make changes to the picture each time the image is refreshed. So I wrote this: $("#display div").css({ margin: "0 auto", "text-align": "center", }); The html built like this: <div id="display"> <div id="slideshow1"> <img ... /> </div> </div> This isn't working, whats wrong? ( this is supposed to center it horizontally, i need to center it vertically to )..

    Read the article

  • Show Alertdialog and use vibrator

    - by user1007522
    I'm having a class that implements RecognitionListener like this: public class listener implements RecognitionListener I wanted to show a alertdialog and use the vibrator but this isn't possible because I need to provide a context what I don't have. My alertdialog code was like this: new AlertDialog.Builder(this) .setTitle("dd") .setMessage("aa") .setNeutralButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }) .show(); But the AlertDialog.Builder(this) wants a context, the same problem with my vibrator code: v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); The getSystemService method isn't available. My code that starts the class: sr = SpeechRecognizer.createSpeechRecognizer(this); sr.setRecognitionListener(new listener()); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"voice.recognition.test"); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,5); sr.startListening(intent); Whats the best way to solve this?

    Read the article

  • Validation errors from Google App Engine Logout link

    - by goggin13
    I am making a web page using the Google App Engine. I am validating my pages, and found that the logout link that is generated by the call to the users api (in python) users.create_logout_url(request.uri) does not validate as XHTML 1.0 Strict. The href in the anchor tag looks like this: /_ah/login?continue=http%3A//localhost%3A8080/&action=Logout Including a link with this anchor text throws three different validation errors: *general entity "action" not defined and no default entity *reference to entity "action" for which no system identifier could be generated *EntityRef: expecting ';' Here is a dummy page with the anchor tag in it, if you want to try it on w3c validator.Dummy Page. The logout link wont work, but you can see how the page is valid without it, but the actual text inside the href tag breaks the validation. Any thoughts on whats going on? Thank you!

    Read the article

  • how to set a tableview delegate

    - by dubbeat
    Hi, I'm trying to use a tableview without using a nib and without using a UITableViewController. I have added a UITableView instance to a UIViewController Like So mytable = [[UITableView alloc] initWithFrame:CGRectMake(22, 207, 270, 233)]; [mytable setDelegate:self]; [self.view mytable]; Also I have added the following table view methods to my UIViewController (cut for brevities sake) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { I am getting a warning saying that my UIViewController does not implement UITableView delegate protocol. Whats the correct way to tell the table view where its delegate methods are? (This is my first attempt at trying to use a UITableView without selecting the UITableTableview controller from the new file options)

    Read the article

  • i have project code in cocos and cocos2d and have problem in orientation

    - by Sukhi
    i have project code in cocos and cocos2d and have problem in orientation . my game is in landscape mode part of its code in cocos2d and another one is in cocos . cocos2d views orientations is working fine . i put this code in appdelegate.m file -(void)orientationChanged:(NSNotification *)notification { UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; if( orientation == UIInterfaceOrientationLandscapeLeft) { [[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight]; } else if( orientation == UIInterfaceOrientationLandscapeRight) { [[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeLeft]; } } but when i go to cocos code its view look good but as soon as i change the rotation LandscapeRight to LandscapeLeft my views goes in potrate mode i wrote following code in UIViewController (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Overriden to allow any orientation. BOOL orienationStatus=FALSE; if (interfaceOrientation ==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) { orienationStatus=TRUE; } return orienationStatus; } whats wrong in that i don't know .... help will be appreciated .....

    Read the article

  • Android Multithreading, creating new thread not executing rest of OnCreate

    - by Aidan
    Hi Guys, Basically I'm trying to run 2 threads within the same class at the same time. The code runs but only executes whats in run() and doesnt finish the onCreate method... anyone know why? public Camera1(){ t = new Thread(this, "My Thread"); t.start(); } public void run(){ bearing(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); new Camera1(); makeview(); tracking(); } Thanks!

    Read the article

  • C# - Rollback SqlTransaction in catch block - Problem with object accessability

    - by Marks
    Hi there. I've got a problem, and all articles or examples i found seem to not care about it. I want to do some database actions in a transaction. What i want to do is very similar to most examples: using (SqlConnection Conn = new SqlConnection(_ConnectionString)) { try { Conn.Open(); SqlTransaction Trans = Conn.BeginTransaction(); using (SqlCommand Com = new SqlCommand(ComText, Conn)) { /* DB work */ } } catch (Exception Ex) { Trans.Rollback(); return -1; } } But the problem is, that the SqlTransaction Trans is declared inside the try block. So it is not accessable in the catch() block. Most examples just do Conn.Open() and Conn.BeginTransaction() before the try block. But i think thats a bit risky, since both can throw multiple exceptions. Am I wrong, or do most people just ignore this risk? Whats the best solution to be able to rollback, if an exception happens. Thanks in advance, Marks

    Read the article

  • environment configuration for tests running in NUnit

    - by Frank Schwieterman
    I have some integration tests that hit a webserver and verify certain functionalities. Depending on the build environment, the server will be at a different address (http://localhost:8080/, http://test-vm/, etc). I would like to run these tests from a TFS build. I'm wondering whats the appropriate way to configure these tests? Would I just add a setting to the config file? I'm doing that currently. Incidentally we do have a separate branch per test environment, so I could have a different config file checked in for each environment. I wonder if there is a better way though? I'd like the build project to be able to tell the test what server to test. This seems better because then I don't have to maintain config information on a per branch basis. I believe I'd be using NUnit for Team Build (http://nunit4teambuild.codeplex.com/) to get NUnit/TFS to play together.

    Read the article

  • VB.net WebBrowser and AJAX List Options

    - by Vinsick
    I'm writing a VB.net program for a website that uses the AJAX Lits options http://www.ajaxdaddy.com/demo-dhtml-autocomplete.html Whats more is that the website has used additional arguments in the function that i'm not exactly sure what they are calling, and there a trigger that executes an action that must be click, tabbing and returning fail. Any idea on how to automate this? This website has been a holy terror since it was unleashed on my company. I've tried this: Dim ObjArr(4) As Object ObjArr(0) = CObj("prac_select") ObjArr(1) = CObj("'getCountriesByLetters'") ObjArr(2) = CObj("1") ObjArr(3) = CObj("'prac_name'") ObjArr(4) = CObj("'practice'") WebBrowser1.Document.InvokeScript("ajax_showOptions", ObjArr)

    Read the article

  • Making a jQuery selection in IE on html added via .load()

    - by Joel Crawford-Smith
    Scenario: I am using jQuery to lazy load some html and change the relative href attributes of all the anchors to absolute links. The loading function adds the html in all browsers. The url rewrite function works on the original DOM in all browsers. But In IE7, IE8 I can't run that same function on the new lazy loaded html in the DOM. //lazy load a part of a file $(document).ready(function() { $('#tab1-cont') .load('/web_Content.htm #tab1-cont'); return false; }); //convert relative links to absolute links $("#tab1-cont a[href^=/]").each(function() { var hrefValue = $(this).attr("href"); $(this) .attr("href", "http://www.web.org" + hrefValue) .css('border', 'solid 1px green'); return false; }); I think my question is: whats the trick to getting IE to make selections on DOM that is lazy loaded with jQuery? This is my first post. Be gentle :-) Thanks, Joel

    Read the article

  • Firefox doesn't show silverlight controls

    - by lmenaria
    I have a silverlight application in which I am using the windowless property to show text . Silverlight Plugin Size is 1000*2000, I Have a button (siverlight control) on the Top. I am showing some html text using DIV real time. Its working fine. My Silverlight Plugin & DIV both style property is= "position:absolute'. This application is working fine in IE, but When I run this application in Firefox Button doesn't dsiplayed. Please let me know whats a issue with Firefox ? Thanks in advance, Laxmilal

    Read the article

  • Jquery validation, step by step validate on click function.

    - by Alex
    Trying to get jquery validation plugin work with my step by step form and here is the function i made. It works but only with first step. Any other step or final submit wont work in that case. If anyone could have a look whats wrong with my code i would appreciate the most. Thank you. function StepByStep(){ var a = { rules: { fieldname1: "required", fieldname2: "required", } } var b = { rules: { fieldname3:"required" } } var aStep = $("form").validate(a); var bStep = $("form").validate(b); $('input.nextStep').click(function(){ if (aStep.form()) { //open step 2 function } return false }); $('input.submit').click(function(){ if (bStep.form()) { $('form').submit(); } return false }); }

    Read the article

  • DateTime.Parse with the "+" symbol

    - by Blah_Blah
    So I have a piece of code which parses and validates user input: DateTime myDateTime = DateTime.Parse(userInput,currentCulture); Current culture is being set (to en-ca or en-fr) and the user Input is always in ISO 8601 format "yyyy-MM-dd". If the user enters 1900-01-01 the date is created as expected. If the input is "1900-01+01" the date time created is 1899-12-31 6:00:00 PM No exception is thrown, the DateTime.Parse happily converts this to the wrong date. To make this work I am using DateTime.ParseExact(userInput,"yyyy-MM-dd",currentCulture). So my question is: whats up with the +01 or any + value? Am I missing something in ISO standard?

    Read the article

  • UIPickerview is not visible in additionally added view

    - by MaheshBabu
    Hi folks, i created an additional IBOutlet UIView. at the same time i place the IBOutlet UIPicker view in additional view. Give connections and add Addtional view as subview to main view. As [self.view addsubview:addtionalview]; I write this code in one button click event. Unfortunatly i got additional view in button click but it did n't show UIPicker. whats the wrong. I already have Two UIPicker view in main view. How can i add UIPicker view in added view. Thank u in advnace.

    Read the article

  • Doubt about constructor in JAVA

    - by Harry Joy
    I have few doubts regarding constructor in java Can a constructor be private? If yes then in which condition? Constructor is a method or not? If constructor does not return anything then why we are getting a new Object every time we call it. Whats the default access modifier of a constructor if we did not specify. Thanks & Regards Edit---------- Answer for 1 & 3 are very clear. But still doubt about 2&4 as i'm getting different answers for them.

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >