Search Results

Search found 59301 results on 2373 pages for 'asp net ajax'.

Page 137/2373 | < Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >

  • Retaining parameters in ASP.NET MVC

    - by MapDot
    Many MVC frameworks (e.g. PHP's Zend Framework) have a way of providing basic state management through URLs. The basic principle is this: Any parameters that were not explicitly modified or un-set get copied into every URL For instance, consider a listing with pagination. You'll have the order, direction and page number passed as URL parameters. You may also have a couple of filters. Changing the value of a filter should not alter the sort order. ASP.net MVC seems to remember your controller and action by default: <%: Html.RouteLink("Next", "MyRoute", new {id = next.ItemId}) %> This will not re-set your action or controller. However, it does seem to forget all other parameters. The same is true of ActionLink. Parameters that get set earlier on in your URL seem to get retained as well. Is there a way to make it retain more than that? For instance, this does not seem to affect any of the links being generated: RouteValues.RouteData.Values["showDeleted"] = true;

    Read the article

  • Use of RegularExpressionValidator in MS .Net Framework

    - by Lawk Salih
    Hi- I am trying to use the RegularExpressionValidator Control in Visual Studio to validate a textbox for email address expressions. Here's my code (very basic) Email:&nbsp; <input id="Text1" type="text" /><br /> <br /> <input id="Validate" type="button" value="Validate" runat="server" /><br /> <br /> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="RegularExpressionValidator" ControlToValidate="Validate" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator> Now, when I set controlToValidate to Validate, I get the following error message: Server Error in '/' Application. Control 'Validate' referenced by the ControlToValidate property of 'RegularExpressionValidator1' cannot be validated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Control 'Validate' referenced by the ControlToValidate property of 'RegularExpressionValidator1' cannot be validated. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): Control 'Validate' referenced by the ControlToValidate property of 'RegularExpressionValidator1' cannot be validated.] System.Web.UI.WebControls.BaseValidator.CheckControlValidationProperty(String name, String propertyName) +8734357 System.Web.UI.WebControls.BaseValidator.ControlPropertiesValid() +40 System.Web.UI.WebControls.BaseValidator.get_PropertiesValid() +21 System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +27 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082 I have tried the same mechanism before and have worked; however, this time I am on a new machine, WinXP Pro running IIS v5.1. Any direction would be appreciated.

    Read the article

  • Poll database using jQuery/Ajax

    - by Gav
    Hi guys, I am trying to use jQuery (latest version) & ajax to poll a mysql db every x seconds, post.php does a simple search query on the table and limits to 1 row. (eg SELECT id FROM TABLE LIMIT 1) I've got some other jQuery UI (using v1.8) code that displays some modal/dialog boxes on the screen, simply put if post.php returns something from the db I need to initialise the dialog to pop up onto the screen. I've done all the popup stuff I am just having issues joining all these bits together - i've added some pseudo code of how i expect this to work. Thanks in advance var refreshId = setInterval(function(){ $.ajax({ type: "POST", url: "post.php", data: "", success: function(html){ $("#responsecontainer").html(html); } }); }, 2000 );s /* proposed pseudocode */ if (ajax is successful & returns a db row to #responsecontainer) { show jQueryUI modal (done this bit already fortunately) }

    Read the article

  • How to get session variables from php server with Ajax function? (PHP HTML JS Ajax)

    - by Ole Jak
    so in my php I have something like this $_SESSION['opened'] = true; But It will not be set to true until user will perform some actions with some other html\php pages So I need on some Ajax function to be able get this session variable. And some PHP sample of function to get variable in form ready for Ajax to get it. so I need something to AJAX requesting to an action (to some simple php code) which will return a value from $_SESSION. How to do such thing?

    Read the article

  • Servlet mapping for ajax call parameters

    - by Woho87
    Hi guys! <servlet-mapping> <servlet-name>Test</servlet-name> <url-pattern>/GetContacts*</url-pattern> </servlet-mapping> I got a simple problem where I can't find any solution on the internet. I have a ajax calls that have the url http://localhost:80/Push/GetContacts?id=23..... The above servlet mapping is not correct for the AJAX call. it issues a http 404 not found call. What is the right syntax to enable my ajax call?

    Read the article

  • Django - Empty session data in ajax requests

    - by ninja123
    Hi guys, I have an ajax view where I want to set a session variable like such: def upload(request, *args, **kwargs): request.session['test'] = 'test' request.session.modified = True print request.session.items() I have another normal view something like this: def advertise(request): print request.session.items() I get these two strings printed to shell: [('test', 'test')] [('_auth_user_backend', 'django.contrib.auth.backends.ModelBackend'), ('_auth_user_id', 26L)] Why is the session data that I set in the ajax view not passing to my regular views? If I set session data in regular view, everything works as fine, but it seems that ajax requests contain empty session data? Anybody dealt with something like this before? Any suggestions are greatly appreciated. Thanks.

    Read the article

  • Problem with Google AJAX Search API RESTful interface

    - by robert_d
    When I send the following query http://ajax.googleapis.com/ajax/services/search/local?v=1.0&q=coffee%20New%20York%20NY using c# WebClient.DownloadString function or ordinary web browser I get JSON data which is different from data for the same query using JavaScript and Google AJAX Search API. From REST service I get the following url field http://www.google.com/maps/place?source003duds0026q003dcoffee0026cid003d13245583795745066822 but from JavaScript query I get this url field http://www.google.com/maps/place?source=uds&q=coffee&cid=13245583795745066822 The problem with REST service answer is that the url it gives points to a web page with error message "We currently do not support the location". What am I doing wrong?

    Read the article

  • Jsonp cross-domain ajax

    - by Guillaume le Floch
    I'm working on an application which use ajax call to get html from the server. When I run it on the server, everything works fine. But when I'm running on a localhost, I've a 'Access-Control-Allow-Origin' error. I looked arround and it seems like using jsonp could be the solution. So, my ajax call looks like that: $.ajax({ url: url, dataType: 'jsonp', crossDomain: true, type: 'GET', success: function(data){ // should put the data in a div }, error: function(){ //do some stuff with errors } }); I get html from the server, but I always have this error: Uncaught SyntaxError: Unexpected token < Is there a way to wrap the jsonp response in html? Thanks!

    Read the article

  • ASP.NET server data persistence

    - by Wayne Werner
    Hi, I'm not really sure exactly how the question should be phrased, so please be patient if I ask the wrong thing. I'm writing an ASP.NET application using VB as the code behind language. I have a data access class that connects to the DB to run the query (parameterized, of course), and another class to perform the validation tasks - I access this class from my aspx page. What I would like is to be able to store the data server side and wait for the user to choose from a few options based on the validity of the data. But unless my understanding is completely off, having persistent data objects on the server will give problems when multiple users connect? My ultimate goal is that once the data has been validated the end user can't modify it. Currently I'm validating the data, but I still have to retrieve it from the web form AFTER the user says OK, which obviously leaves open the possibility of injecting bad data either accidentally (unlikely) or on purpose (also unlikely for the use, but I'd prefer not to take the chance). So am I completely off in my understanding? If so, can someone point me to a resource that provides some instructions on keeping persistent data on the server, or provide instruction? Thanks!

    Read the article

  • Reload AJAX data every X minutes/seconds, jQuery

    - by NightMICU
    Hi everyone, I programmed a CMS that has a log of who has recently logged into the system. Presently, this data is fed into a jQuery UI tab via Ajax. I would like to put this information into a sidebar on the main page and load it via AJAX every 30 seconds (or some set period of time). How would I go about doing this? Does the PHP response need to be JSON coded? I am fairly new to AJAX and JSON data. Here is the PHP I am currently using to pull details from the users table- <?php $loginLog = $db->query("SELECT name_f, name_l, DATE_FORMAT(lastLogin, '%a, %b %D, %Y %h:%i %p') AS lastLogin FROM user_control ORDER BY lastLogin ASC LIMIT 10"); while ($recentLogin = $loginLog->fetch()) { echo $recentLogin['name_f'] . " " . $recentLogin['name_l'] . " - " . $recentLogin['lastLogin']; } ?> Thanks!

    Read the article

  • How can I get my div id to reload via ajax and jquery

    - by Matt Nathanson
    I'm creating a CMS using jQuery and AJAX. When I click, my "Add Campaign" buttom, it creates a unique client ID in the DB and on a hard reload, the new client shows up in its container. I am trying to use ajax to reload the container on the fly and I'm not having the exact luck i am hoping for. I can get it to reload, but it's like it's pulling in descriptions of each of the clients as well! function AddNewClient() { dataToLoad = 'clientID=' + clientID + '&addClient=yes'; $.ajax({ type: 'post', url: '/clients/controller.php', datatype: 'html', data: dataToLoad, target: ('#clientssidebar'), async: false, success: function(html){ $('#clientssidebar').html(html); }, error: function() { alert('An error occured!'); } }); };

    Read the article

  • Can headers be sent in an AJAX request?

    - by sombe
    Can I call the server to set a new cookie with an AJAX request (that is, after the page has already loaded)? For example, when a visitor hits a link, ajax would open a php file that sets a new cookie like this: setcookie('cookiename', 'true', time()+3000, "/",'...'); But this is done after the html (the page containing the actual <a> tag pressed) was rendered. Is it nevertheless ok to set cookies in ajax? (maybe because the php file loaded is separate from the original html page).

    Read the article

  • Can't echo jquery (with ajax) variable in php

    - by Lars Kerff
    I'm trying to post a variable through ajax. But it won't echo the variable in php. This are the variables (these are working, seen in the log): $("#slider").bind("valuesChanged", function(e, data){console.log("min: " + data.values.min + " max: " + data.values.max);}); The Ajax part: $("#slider").bind("valuesChanged", function (e, data) { $.ajax({ type: "POST", dataType: "text", url: "../test.php", data: { minValue: data.values.min, maxValue: data.values.max }, async: false, success: function(data){ alert('yeah') }, error: function(xhr) { alert('fail') // if your PHP script return an erroneous header, you'll land here } }); }); </script> And php echo: <?php if ( $_POST ) { echo $_POST[ 'minValue' ]; } ?> Now why does it not echo the post? Thanks!

    Read the article

  • Paths when both including and requesting AJAX

    - by Cristian
    I was wondering if there is a way of making a relative path to the main folder (where the index.php lies) from every file that needs to be included or requested by AJAX. I want to combine both AJAX and PHP include so first time the page loads with PHP, and then to be able to refresh parts of the page with AJAX, but the files are the same and lie in subfolders. I'm having problems with the path and although I can set an absolute path, then I have to change it every time the server changes. I want a relative path to where my project is, but not DOCUMENT_ROOT, because that one doesn't work with aliases. (or do you know how to make it work with aliases? ) Thanks !

    Read the article

  • jquery ajax call errors in chrome onenter with no responseText

    - by wham12
    I've built a login page that uses a .ajax call to a generic c# handler (.ashx) to validate the username and password before allowing the user to log in. If you click on the login link <a href="#" class="ui-state-default ui-corner-all CustomButton" onclick="goLogin();return false"> the .ajax call returns successfully and it logs the user in. I am trying to make it so the user can also just press the "enter" key from the password box: $("#pword").keydown(function(e) { if (e.keyCode == 13) { goLogin(); } }); Using Firefox, both ways work just fine and the user is logged in. With Chrome however, pressing "enter" hits the error function of my .ajax call and will not log the user in. The parameters and responses look identical through Firefox's console, as expected. What would be causing this and/or how can I debug it in Chrome?

    Read the article

  • AJAX form sections - how to pass url of next stage of form

    - by dan727
    Hi, I've got a multi-part form (in a PHP MVC setup) which I have working correctly without javascript enhancement. I'm starting to add the AJAX form handling code which will handle each stage of a form submission, validating/saving data etc, before using AJAX to load the next stage of the form. I'm wondering how best to pass the URL of the next stage to the current form being processed, so that my jQuery form handling code can process the current form, then load the next part via AJAX. The form "action" is different from what the url of the next stage of the form is - what do you think would be good practice here? I was thinking about either appending the url of the next stage to the form action url, via a query string - then just use javascript to extract this url when the form is successfully processed. The other option is via a hidden form element. Not sure what other client side options I have here Any thoughts?

    Read the article

  • Navigating by foreign keys in ADO.NET Entity Framework/MySQL

    - by Werg38
    I am using ASP.NET MVC2 on top of a MySQL database in VS2008. I am using the MySQL ADO.NET connector 6.2.3 to provide the connection for the ADO.NET Entity Data Model. This is mostly working ok, however navigating via foreign keys is causing me a real headache! Here is a simplified example.. Car (Table) CarID PK Colour Doors ManufacturerID FK Manufacturer (Table) ManufacturerID PK Name In the edmx file I can see the 1-many relationship shown as a navigation property in the both the Car and Manufacturer tables. I create a Models.CarRepository that allows me to returns a IQueryable. At the View I want to be able to display the Manufacturer.Name for each car. This is not accessible via the object I get returned. What is best way to implement this? Have I encountered a limitation of the Entity Framework/MySQL combination?

    Read the article

  • how do i specify the element when loading content ajax jquery

    - by phukkie
    How can I specify an element where the content is to be retrieved from within the pageurl in the code below? $(function () { $("a[rel='sort']").click(function (e) { //e.preventDefault(); /* if uncomment the above line, html5 nonsupported browers won't change the url but will display the ajax content; if commented, html5 nonsupported browers will reload the page to the specified link. */ //get the link location that was clicked pageurl = $(this).attr('href'); //to get the ajax content and display in div with id 'content' $.ajax({ url: pageurl + '?rel=sort', success: function (data) { $('#content1').html(data); } }); //to change the browser URL to 'pageurl' if (pageurl != window.location) { window.history.pushState({ path: pageurl }, '', pageurl); } return false; }); });

    Read the article

  • Ajax twice + facbook login/logout

    - by Devenv
    Hi, I have a very specific problem. The site I'm developing loads the FB connect button by ajax (it loads the box that includes FBC button). And when user logs in it loads instead of it the box with FB logout link. The problem is that FB requires to call FB.init() at the end of the body (when all the FB stuff is already on the page) and you can't do it twice as the second time is ignored. So what happens is - I do FB.init() inside the login box and FBC button works perfectly, but the logout link doesn't as FB.init() doesn't work there. The only solution I came up with is to place the login and logout buttons outside of ajax boxes and show them in the right places after ajax boxes are loaded. I'm pretty much sure this will work but I don't like the solution (which looks more like hack).

    Read the article

  • ASP.Net MVC: Change Routes dynamically

    - by Frank
    Hi, usually, when I look at a ASP.Net MVC application, the Route table gets configured at startup and is not touched ever after. I have a couple of questions on that but they are closely related to each other: Is it possible to change the route table at runtime? How would/should I avoid threading issues? Is there maybe a better way to provide a dynamic URL? I know that IDs etc. can appear in the URL but can't see how this could be applicable in what I want to achieve. How can I avoid that, even though I have the default controller/action route defined, that default route doesn't work for a specific combination, e.g. the "Post" action on the "Comments" controller is not available through the default route? Background: Comment Spammers usually grab the posting URL from the website and then don't bother to go through the website anymore to do their automated spamming. If I regularly modify my post URL to some random one, spammers would have to go back to the site and find the correct post URL to try spamming. If that URL changes constantly I'd think that that could make the spammers' work more tedious, which should usually mean that they give up on the affected URL.

    Read the article

  • cant find div element in ajax data find

    - by Shrey
    This is my whole Ajax page which is returned <!DOCTYPE div PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <div class="CareerAjaxData">Simple Div Content</div> The jQuery script in the Main page which calls this Ajax page is $.ajax({ type : 'POST', url : url, data : data, datatype : 'html', success : function(ajaxdata) { var $tabcontent = $(ajaxdata).find('.CareerAjaxData'); console.log($tabcontent.html()); } }); But the output of Console gives: undefined I get proper response from the server. But there some problem with js I guess. whats wrong here..??

    Read the article

  • jQuery - now: Creating an object and storing values in it to pass to an AJAX call

    - by Josh K
    I have an array: myarr = []; I'm filling it with some values: myarray['name'] = "Me!"; Now I want to transform that array into a set of Key = Value pairs. I though jQuery would do it automatically, but it doesn't seem to. $.ajax ({ type: "POST", dataType: "text", url: "myurl", data: myarr }); Is there a way to do this or something I'm doing wrong? I get no javascript errors, and no serverside errors other then no POST information at all. I need the request to be sent as a true POST request. I need to keep the php code simple because sometimes the login won't be an AJAX call. I'm now trying the following with an error unexepected token ':' myarr: { 'name':'me' } The question has now become: How do I initialize a new javascript object as "blank", how do I set up mappings, and how do I pass it in an AJAX call?

    Read the article

  • return from jquery ajax call

    - by michael
    hi im tryin to use the return from a jquery ajax call in my own function, but it keeps returning undefined. function checkUser2(asdf) { $.ajax({ type: "POST", async: false, url: "check_user.php", data: { name: asdf }, success: function(data){ return data; //alert(data); } }); } $("#check").click(function(){ alert(checkUser2("muma")); }); the ajax call definately works, because when i uncomment my alert i get the correct return, and i can see it in firebug. Am i doing something stupid.

    Read the article

  • Passing PHP session variable to AJAX URL

    - by user547794
    Hello, I am trying to pass a session variable into an AJAX loaded page. Here is the code I am using: jQuery(document).ready(function(){ $("#userdetail").click(function() { $.ajax({ url: "userdetail.php?id=<?php $_SESSION['uid']?>", success: function(msg){ $("#results").html(msg); } }); }); }); This is the HTML URL I had working, not sure how to get this into the AJAX call: userdetail.php?id=<?php $_SESSION['uid']?> I should also mention that if I manually pass in the userID it works fine url: "userdetail.php?id=1",

    Read the article

< Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >