Search Results

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

Page 161/2373 | < Previous Page | 157 158 159 160 161 162 163 164 165 166 167 168  | Next Page >

  • Setting focus on top of the page on click of asp.net link button

    - by user74042
    I've a asp.net datagrid which shows customer order details. Pagination at the bottom of the grid is done using datalist and asp.net Linkbutton controls. Here is the code: <asp:DataList ID="DataList2" runat="server" CellPadding="1" CellSpacing="1" OnItemCommand="DataList2_ItemCommand" OnItemDataBound="DataList2_ItemDataBound" RepeatDirection="Horizontal"> <ItemTemplate> <asp:LinkButton ID="lnkbtnPaging" runat="server" CommandArgument='<%# Eval("PageIndex") %>' CommandName="lnkbtnPaging" Text='<%# Eval("PageText") %>'></asp:LinkButton> <asp:Label runat="server" ID="lblPageSeparator" Text=" | " name=></asp:Label> </ItemTemplate> </asp:DataList> When the user clicks on any page number(ie.Link button), I need to set focus on top of the page. How do i do this? Thanks!

    Read the article

  • Ajax get throws a syntax error when ip is given instead of localhost

    - by Aruna
    Hi , i am working on cakephp. I have developed an application where i have used localhost in all ajax post and get.. like var ht = $.ajax({ type: "GET", url: "http://localhost/FormBuilder/index.php/forms/getInvitees/<?php echo $emailid;?>", async: false }).responseText; var myObject = eval('(' + ht + ')'); this thing works only when i put localhost . But when i change that to my Ip like http://111.11.11.11/FormBuilder/index.php/forms/getInvitees/", then i am getting a syntax error () in the line var myObject = eval('(' + ht + ')'); WHy it happens ?? Please give valuable suggestions in solving this.. Thank you

    Read the article

  • Ajax call not working...

    - by Probocop
    Hi, I have a form that submits to a PHP script with Jquery and Ajax. The PHP script returns some XML. For some reason the Ajax success function is not firing, and the error ones is. Can anybody see where I'm going wrong? My Jquery is as follows $('#submit-excuse').submit(function (event) { event.preventDefault(); ws_url = 'http://jacamo.epiphanydev2.co.uk/content/inc/excuse-submit.php?excuse='+$('input#excuse').val(); $.ajax({ type: 'GET', url: ws_url, dataType: "xml", beforeSend: function() { $('p#response').text('Sending.'); }, success: function(xmlIn) { results = xmlIn.getElementsByTagName("ReportID"); }, error: function() { $('p#response').text('Error.'); } }); }); And my PHP script is as follows: $excuse = $_GET['excuse']; $badwords = array ( 'one', 'two', 'three', 'four', 'five' ); if ($excuse == '') { $error = 'enter something'; } else { foreach ($badwords as $word) { $pos = strpos($excuse, $word); if($pos !== false) { $passed = false; } } if ($passed !== false) { $username = 'xxxxx'; $password = 'xxxxx'; $message = $excuse; $url = 'http://twitter.com/statuses/update.xml'; $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, "$url"); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message"); curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password"); $buffer = curl_exec($curl_handle); curl_close($curl_handle); $passed = 'yes'; } echo "<?xml version='1.0' encoding='UTF-8'?>\n"; echo "\t<result>\n"; echo "\t\t<passed>" . $passed . "</passed>\n"; echo "\t</result>"; } Thanks

    Read the article

  • What to return when making an Ajax request

    - by Russell
    When we return data from an Ajax call, is it better to return a document containing HTML to display on the page or return an Xml/json data which can be processed? I know different circumstances may determine what 'better' means, but I really want to know which will be more appropriate for different circumstances. I am working on the framework for a large ASP .Net application, using jQuery Ajax (forms plugin). My initial thought was to return the data as Xml, then process accordingly. Then this increases processing required in Javascript, to populate the page. I am trying to balance flexible, clear and simple. Thanks in advance for your knowledge and information.

    Read the article

  • jQuery ajax multiline "script" response

    - by Rendrik
    I'm designing a template creation tool, which uses a jQuery Ajax request that posts parameters to a PHP file. The PHP does the actual generation of the template's HTML. // Send for processing. Expect JS back to execute. function generate() { $.ajax({ type: "POST", url: "generate.php", data: $('#genform :input').serialize(), dataType: "script", beforeSend: function() { $("#loading").html("<img src='images/loadbar.gif' />"); $("#loading") .dialog({ height: 80, width: 256, autoOpen: true, modal: true }); }, success: function(data) { $("#loading").dialog('close'); } }); } My trouble is that I have the ajax dataType: set to "script". Using this, the PHP file generates some jQuery dialogs for any errors which works nicely. However, after I generate the HTML, i'm having trouble passing it back. So I have probably 100 lines of generated HTML and javascript which i'd like to work with. In the PHP file, i've tried: echo('$("#result").html("'.$html.'");'); This does actually work if there are NO line breaks in $html. As soon as there are any line breaks, the Chrome debugger reports "gen.html:1 Uncaught SyntaxError: Unexpected token ILLEGAL". It's obvious that it's trying to eval the returned response headers, but is stopping at any line break. So, to be clear, when I pass $html back, if the contents are this: $html = "<div>hi there</div>"; It works fine (all of my error message dialogs are one line). But if it's: $html = "<div> hi there </div>"; It blows up. I'm really not sure how to get around this, or if there's a better way to go about it. It's important to me to keep the formatting so people can copy the HTML template. I may just break down and display the template file on the PHP page if I can't solve this, but I was really hoping to keep everything within the confines of the HTML page.

    Read the article

  • jQuery, ajax request doesn't success with JSON on IE

    - by sylouuu
    I made an AJAX call and it works on FF & Chrome but not on IE 7-8-9. I'm loading a JSON file from my domain: $.ajax({ url: 'js/jquery.desobbcode.json', dataType: 'json', cache: false, success: function(json) { alert('ok'); }, error: function(xhr, errorString, exception) { alert("xhr.status="+xhr.status+" error="+errorString+" exception="+exception); } }); I also tried by adding contentType: 'application/json' but I receive the same output which is : xhr.status=200 error=parsererror exception=SyntaxError Unterminated string constant I checked my JSON file with JSONLint and it's OK. I checked if there is an extra comma and the content is also trimmed. See my JSON file If I put dataType: 'text', I receive the OK alert but a debug popup too. Could you help me? Regards.

    Read the article

  • Codeigniter + ajax(jQuery) session problem

    - by faya
    Hello, I have a problem in server side retrieving session with using ajax post request. Here is my sample code: JavaScript: $(function() { $('.jid_hidden_data').submit(function() { var serialized = $(this).serialize(); var sUrl = "http://localhost/stuff"; $.ajax({ url: sUrl, type: "POST", data: serialized, success: function(data) { alert(data); } }) return false; }); }); CodeIngiter(PHP) side: function stuff() { $post_stuff = $this->input->post('my_stuff'); // WORKS PERFECTLY $user_id = $this->session->userdata('user_id'); // RETURNS NULL } Where commented returns NULL it should return users session data, because it really exists. What is the problem? Method post doesn't get cookies or what? Thanks for any help!

    Read the article

  • Submtting data using $.ajax and retrieving values from $_POST array

    - by Linda Keating
    I'm having trouble retrieving my form Data that has been submitted via ajax like this: $( "form" ).on( "submit", function( event ) { var formData = $(this).serializeArray(); console.log("fomData"); $.ajax({ url: window.location.origin+ "/selfservicemanager/localtmfsetup/local_tmf_setup.php", type: "POST", data: JSON.stringify(formData), success : function (){ alert("success"); } }); }); I can see the data being sent over the network like this: But when I try to retrieve the data on the server side the $_POST array is empty. <?php var_dump($_POST); die(); ?> array (size=0) empty Any ideas? I've tried to stringify the data being sent, and also tried to decode the $_POST array but it expects a string.....

    Read the article

  • Alternative for table mark-up in ASP.NET not working properly

    - by yetanothercoder
    Using Visual WebDeveloper 2010 Express and ASP.NET 4.0 Don't know whether its relevant but the whole thing is in a ContentPlaceHolder and inside an UpdatePanel. To avoid using the old table tr td model, I have created a simple form like this <div class="admin-form"> <asp:Label ID="UserNameLabel" runat="server" CssClass="form-label" Text="User Name" /> <asp:TextBox ID="UserNameText" runat="server" Width="200px"/> <br /> <asp:Label ID="PasswordLabel" runat="server" CssClass="form-label" Text="Password" /> <asp:TextBox ID="PasswordText" runat="server" TextMode="Password" Width="200px"/> <br /> <asp:Label ID="ConfirmPasswordLabel" runat="server" CssClass="form-label" Text="Confirm Password" /> <asp:TextBox ID="ConfirmPasswordText" runat="server" TextMode="Password" Width="200px"/> <br /> <asp:Label ID="EmailLabel" runat="server" CssClass="form-label" Text="Email" /> <asp:TextBox ID="EmailText" runat="server" Width="200px"/> <br /> <br /> <br /> <span class="form-label"></span> <asp:Button ID="CreateUserButton" runat="server" CssClass="button blue" Text="Create New User"/> </div> And the CSS .form-label { width: 300px !important; } This renders incorrectly as I would like to have all textboxes vertically lined after taking 300px. What is wrong? P.S: I cannot use HTML Controls like label as I have resx for globalization

    Read the article

  • Ajax Reload same page onclick

    - by user277891
    Hi, This is my situation.I have some 10 links on a page. So when user clicks on those links ajax-same page reload must take place. To be clear I have something like this. <a href="test.php?name=one">one</a> | <a href="test.php?name=Two">Two</a> If javascript is enabled, Onclick, ajax load must take place. If javascript is disabled, Then the above should work. Basically I am using "name" to limit some values of my search page.

    Read the article

  • PHP save a page then redirect to previous page(ajax)

    - by Shiro
    Dear all, I would like to ask for how to redirect to previous page (ajax paging). Example, Let's say currently I am in page 5, then I click on one record, after I edit it, I would like to go back to that page 5 not page 1. The problem is my paging is using ajax, http://domain/photo/#5 I try to use $_SERVER[http_referer], but I only get http://domain/photo , I not able to get # and the value. What is the best way to redirect back to the previous paging. My last choice is using $_SESSION. Hope I can get better answer here. Thx.

    Read the article

  • Strange lifecycle behaviour with f:ajax and valueChangedListener

    - by gerry
    I want to use the f:ajax tag to update a part of a page with a editor gui, which style depends on a selectOneMenu and its selected item. The problem is, that if the ajax is called the server first renders the editor and then executes the valueChangedListener method. In my JSF2.0 / Facelets app I've the following code: ... <h:selectOneMenu id="typeSelect" validator="#{addEntityBean.checkType}" value="#{addEntityBean.selectedTypeAsString}" valueChangeListener="#{addEntityBean.selectedTypeChanged}"> <f:ajax render="editorGrid"/> <f:selectItems value="#{addEntityBean.entityTypeListAsString}"/> </h:selectOneMenu> ... <h:panelGrid id="editorGrid" columns="2" binding="#{addEntityBean.dynamicEditorGrid}" /> The BackingBean code looks like this: public String getSelectedTypeAsString() { return selectedTypeAsString; } public void setSelectedTypeAsString(String selectedType) { this.selectedTypeAsString = selectedType; } public Class<? extends Entity> getSelectedType() { log.severe("getSelectedType"); Class<? extends Entity> res = null; if(selectedTypeAsString != null){ int index = entityTypeListAsString.indexOf(selectedTypeAsString); res = entityTypeList.get(index); } return res; } public void selectedTypeChanged(ValueChangeEvent event){ setSelectedTypeAsString((String)event.getNewValue()); Class<? extends Entity> clazz = getSelectedType(); if(clazz != null){ try { setEntity(clazz.newInstance()); } catch (Exception e) { log.severe(e); } } else{ setEntity(null); } } public HtmlPanelGrid getDynamicEditorGrid() { HtmlPanelGrid grid = DynamicHtmlComponentCreator.createHtmlPanelGrid(); Entity entity = getEntity(); if(entity != null){ log.severe("getEntity() -->"+entity.getClassName()); grid = (HtmlPanelGrid)buildGui(grid, entity, "entityBean.entity", false); } else log.severe("getEntity() --> null"); return grid; } The problem is, that the server logs show that at first the getDynamicEditorGrid() is executed. And later the selectedTypeChanged()-listener-method. So everytime the selected editor style type is update one selection later. I.e. after a page reload (the type is initally null) the user selects the A, now the getDynamicEditorGrid() is executed again with type null and after that the type is changed to A. Again the user selects now B (after A) and now the getDynamicEditorGrid() is executed with the type A and after that the type is changed to B. What is wrong with my code? How can I fix this really strange behavior...

    Read the article

  • 400 bad request when calling a WCF service via jQuery/Ajax in a IIS7 server

    - by Max
    This is what the IIS log says: 2012-12-12 16:35:44 W3SVC1 server001 76.229.32.109 POST /Dashboard/svc/RunJob.svc/RunJob/ExecuteJob - 80 - 76.229.32.109 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+WOW64;+Trident/4.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.30729;+.NET+CLR+3.5.30729) ASP.NET_SessionId=poxpqp45rv2m3tuflzckix45 http ://server001/Dashboard/RunJob.aspx server001 400 0 0 2444 1423 1934 I have maxReceivedMessageSize set to a very high number. The weird thing is that the same code works in the lab but it wont work in production. Both environments (lab and production) are using the same web.config file. Any ideas? Thank you

    Read the article

  • Jquery ajax call with '+' sign.

    - by 0plus1
    Hi, I'm doing this: $.ajax({ type: "POST", url: baseURL+"sys/formTipi_azioni",data:"az_tipo="+azione, beforeSend: function(){$("#form").html('<p><img src="'+baseURL+'lib/img/ajax-loader.gif" width="16" height="16" alt="loading" /><p>');}, success: function(html){$("#form").html(html);} }); there is a case when azione is TB+ the plus sign doesn't get POSTed at all, a blank space get sent. I already tried this: azione = escape(String(azione)); With no luck. Does anybody knows how to fix this? Thank you

    Read the article

  • Ajax(jQuery) strange file post problem

    - by faya
    Hello, I have a problem posting file via ajax jQuery function. I have something like this: $('#my_form').submit(function() { var serialized = $(this).formSerialize(); var sUrl = "xxx"; $.ajax({ url: sUrl, type: "POST", data: serialized, success: function(data) { $(".main_container").html(data); } }) return false; // THIS return statment blocks sending file content }); When I remove return false statement everything is okey, server side gets the file content and etc, but when it's there (i monitor with firebug) that this posting sends only file name. What can be wrong? P.S. - I need this return false statement, because I want to manipulate return data myself.

    Read the article

  • making ajax request to another server

    - by santhosh
    Hi, I had a ajax sample code from W3Schools, where If i request ajax call to remote server the request getting fails. function loadXMLDoc() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","http://www.google.com",true); xmlhttp.send(); } How to solve this..?

    Read the article

  • how to implement ajax in Ruby on rails via jquery

    - by swaroopsm
    how do i pass few of my form field(s) values to a controller usnig ajax/jquery? For eg.: In php/jquery I do something like this: $("#test-btn".click(function(){ var name=$("#name").val(); var age=$("#age").val(); $.post("insert.php",{name: name,age: age}, function(data){ $("#respone").html(data).hide().fadeIn(500); }); }); //insert.php <?php //insert values to database! ?> how do i acheive a similar functionality in rails using ajax/jquery?

    Read the article

  • How? Encrypt and Decrypt user membership passwords in ASP.NET

    - by smdrager
    We are creating a new site using ASP.NET membership provider for user registration and log in. Our old system encrypted user passwords so that we could recover them if we needed to. I am having a great deal of trouble figuring out if it is possible to use ASP.NET membership functions to simply encrypt the password when the user registers and then unencrypt it so I can see it. Documentation for this is neigh non-existant. I know how to configure Web.config to have it store passwords as encrypted ala passwordFormat="Hashed" in the provider and assigning a validationKey in the machineKey, however it seems like the password still gets hashed (though perhaps it is just well encrypted). Either way I cannot decifer how the password can be recovered (by us) if neccessary. Thanks!

    Read the article

  • jQuery ajax() and cakePHP urls

    - by Pickledegg
    I'm trying to call the 'tariff' action of my 'countries' controller using jQuery ajax() and pass it a country name in the following format: /countries/tariff/countryname however, with the following code ( set to GET ), it is calling this with the get '?' added: /countries/tariff/?countryname $(document).ready(function(){ $('#CountriesIndexForm select').change(function(){ $.ajax({ type: "GET", url: "/countries/tariff/", data: escape($(this).val()), success: function(html){ $(this).parent().next('div').html(html); } }); }); }); I understand its because the type: is set to GET, but is there a fix for this?

    Read the article

  • jQuery doesn't work after an Ajax post

    - by user1758979
    I'm using jQuery to sort a list of entries, between <LI></LI> tags, and then an Ajax post to validate the order and 'update' the page with the content returned. $.ajax({url: "./test.php?id=<?php echo $id; ?>&action=modify", contenttype: "application/x-www-form-urlencoded;charset=utf-8", data: {myJson: data}, type: 'post', success: function(data) { $('html').html(data); OnloadFunction (); } }); Then, I lose the ability to sort the list (I'm not sure if clear...). I tried to move the content of the $(document).ready inside the OnloadFunction (), and call it with <script>OnloadFunction ();</script> inside the block dealing with the modifications to do : $action= $_GET['action']; if ($action == "modify") { // Code here } but it doesn't work... I can't figure out how to do that. Could anyone help ? I stripped out the main part of the code to keep only the essential (filename: test.php) <!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> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript" src="jquery-ui-1.9.0.custom.min.js"></script> <script> $(document).ready(function(){ //alert("I am ready"); OnloadFunction (); }); function OnloadFunction () { $(function() { $("#SortColumn ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {} }); }); //alert('OnloadFunction ends'); } function valider(){ var SortedId = new Array(); SortIdNb = 0; $('#SortColumn ul li').each(function() { SortedId.push(this.id); }); var data = { /* Real code contains an array with the <li> id */ CheckedId: "CheckedId", SortedId: SortedId, }; data = JSON.stringify(data); $.ajax({url: "./test.php?id=<?php echo $id; ?>&action=modify", contenttype: "application/x-www-form-urlencoded;charset=utf-8", data: {myJson: data}, type: 'post', success: function(data) { //alert(data); $('html').html(data); OnloadFunction (); } }); } </script> </head> <body> <? $action= $_GET['action']; $id = $_GET['id']; if ($id == 0) {$id=1;} $id += 1; if ($action == "modify") { echo "action: modify<br>"; echo "id (àvèc aççént$): ".$id."<br>"; // "(àvèc aççént$)" to check characters because character set is incorrect after the ajax post $data = json_decode($_POST['myJson'], true); // PHP code here to treat the new list send via the post and update the database print_r($data); } ?> <!-- PHP code here to get the following list from the database --> <div id="SortColumn"> <ul> <li id="recordsArray_1">recordsArray_1</li> <li id="recordsArray_2">recordsArray_2</li> <li id="recordsArray_3">recordsArray_3</li> <li id="recordsArray_4">recordsArray_4</li> <li id="recordsArray_5">recordsArray_5</li> </ul> </div> <input type="button" value="Modifier" onclick="valider();"> </body> </html>

    Read the article

  • I want to prevent ASP.NET GridView from reacting to the enter button

    - by StephaneT
    I have an ASP.NET page with a gridview control on it with a CommandButton column with delete and select commands active. Pressing the enter key causes the first command button in the gridview to fire, which deletes a row. I don't want this to happen. Can I change the gridview control in a way that it does not react anymore to pressing the enter key? There is a textbox and button on the screen as well. They don't need to be responsive to hitting enter, but you must be able to fill in the textbox. Currently we popup a confirmation dialog to prevent accidental deletes, but we need something better than this. This is the markup for the gridview, as you can see it's inside an asp.net updatepanel (i forgot to mention that, sorry): (I left out most columns and the formatting) <asp:UpdatePanel ID="upContent" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnFilter" /> <asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" /> </Triggers> <ContentTemplate> <div id="CodeGrid" class="Grid"> <asp:GridView ID="dgCode" runat="server"> <Columns> <asp:CommandField SelectImageUrl="~/Images/Select.GIF" ShowSelectButton="True" ButtonType="Image" CancelText="" EditText="" InsertText="" NewText="" UpdateText="" DeleteImageUrl="~/Images/Delete.GIF" ShowDeleteButton="True" /> <asp:BoundField DataField="Id" HeaderText="ID" Visible="False" /> </Columns> </asp:GridView> </div> </ContentTemplate> </asp:UpdatePanel>

    Read the article

  • Ajax: Appending list-item at the top

    - by ptamzz
    I'm calling a php processing file using ajax an appending the returned HTML usign the code below $.ajax({ type: "POST", url: "proc/process.php", data: dataString, cache: false, success: function(html){ $("ul#lists").append(html); $("ul#lists li:last").fadeIn("slow"); $("#flash").hide(); } }); It appends a <li></li> item at the end of the ul#lists. I want the returned list-item <li></li> at the top of the lists instead of being appended at the last. How do I do that??

    Read the article

< Previous Page | 157 158 159 160 161 162 163 164 165 166 167 168  | Next Page >