Search Results

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

Page 171/2373 | < Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >

  • Ajax to read from form

    - by Edwin
    Hello, I'm writing a store system for my game, it worked quite well until I found out that it only takes the amount of first entered Item. function pbuy(buyitem) { var amountc = "amount-"+buyitem, var amount = $("#"+amountc+"").val(); $.ajax({ type: "POST", url: "store2.php", data: "buyitem="+ buyitem+"&amount="+amount, success: function(resp){ document.getElementById('ajaxDiv').innerHTML = resp; }, error: function(e){ alert('Error: ' + e); } }); } I'm trying to give it it the Id of the form like so: function pbuy(buyitem) { var amountc = "amount-"+buyitem, var amount = $("#"+amountc+"").val(); But nothing happens. The code the creation of the forms is: <tr> <td class='items' width='80%' align='center' valign='top'><?PHP echo $itemstore->itemname;?> </td> <td width="20%"> Price:<?PHP echo $itemstore->newprice;?> <form method="post"> <input type='text' id='amount-<?PHP echo $row;?>)' /> <input name="itembid" type="button" onclick="pbuy(<?PHP echo $row;?>)" value="Buy" /></form></td> </tr> If I hardcode the amount in the ajax function it all runs fine like it should.

    Read the article

  • Ajax Code to run PHP query After Facebook Like Button is Clicked

    - by John
    I have the PHP below on a file called fblike.php. On another file, I have the Facebook Like button. The Like button functions. I would like to run the code below when the Facebook Like button is clicked. I know that FB.Event.subscribe('edge.create', function(response) {} is supposed to run whenever the Like button is clicked. I know that I am probably supposed to use Javascript and maybe Ajax to cause the PHP on fblike.php to run. But after multiple tries, I can't get it to work. What is the specific Ajax code that I could include within the Facebook Event? Do I need to do anything to the Like button code to allow the Facebook Event to work? $submissionid = $_POST['submissionid']; $uid = $_POST['uid']; mysql_connect("server", "username", "password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); $q = "INSERT INTO fblikes VALUES (NULL, '$submissionid', '$uid', NULL)"; $r = mysql_query($q); if($r) { echo "Success!"; } elseif(!$r) { echo "Failed!"; }

    Read the article

  • Submitting form with Ajax

    - by Sidetracking
    So I'm completely lost on how to submit a form with Ajax. I'm fairly new to Javascript and hopefully I'm not in over my head. When I click submit on my form, nothing happens on my page, not in my SQL database where the info should be stored (double checked process form too). Here's the code if anyone's willing to help Javascript: $(document).ready(function() { $('#form').submit(function() { $.ajax({ url: "../process.php", type: "post", data: $(this).serialize() }); }); } HTML: <form name="contact" method="post" action="" id="form"> <span id="input"> <input type="text" name="first" maxlength="50" size="30" title="First Name" class="textbox"> <input type="text" name="last" maxlength="80" size="30" title="Last Name" class="textbox"> <input type="text" name="email" maxlength="80" size="30" title="Email" class="textbox"> <textarea name="request" maxlength="1000" cols="25" rows="6" title="Request"></textarea> </span> <input type="submit" value="Submit" class="submit"> </form>

    Read the article

  • Basic Ajax Cache Issue

    - by michaelespinosa
    I have a single page that I need to on occasion asynchronously check the server to see if the status of the page is current (basically, Live or Offline). You will see I have a function with a var live that is set when the page initially loads. I then do an ajax request to the server to retrieve whether the status of live is true or false. I compare the initial live variable with the newly returned data json object. If they're the same I do nothing, but if there different I apply some css classes. I recursively run it with setTimeout (Is there a better way to recursively do this?). My Problem: data.live doesn't change from it's initial time it runs even when it has changed in the db. I know my mysql is working because it returs the right value on the initial load. It seems like a caching issue. Any help is greatly appreciated. function checkLive() { var live = <?=$result["live"]?>; $.ajax({ type: 'get', url: '/live/live.php', dataType: 'json', success: function(data) { console.log('checking for updates... current:' + data.live); if (data.live == live) { return; } else { var elems = $('div.player_meta, object, h3.offline_message'); if (data.live == '1') { elems.removeClass('offline').addClass('live'); } else { elems.addClass('live').addClass('offline'); } } } }); setTimeout(function() { checkLive() } ,15000); } checkLive();

    Read the article

  • Receive Ajax and display output in a Photo?

    - by user1709469
    how to Receive Ajax and display output in a Photo? Images should be displayed inside the div tag After each of Bayer text, change the text to change the photo content The photos displayed are written in the form Thanks this code <script> function AjaxRequest() { var xmlhttp = null; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } // else // code for IE6, IE5 return xmlhttp; } function ajaxAction() { var font_category = document.getElementById("ajaxField").value; var xmlHttp = AjaxRequest(); xmlHttp.open("POST" , "ajax.php?message=" + message , true); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 1) response.innerHTML = "Loading..."; if (xmlHttp.readyState == 4 && xmlHttp.status == 200) response.innerHTML = xmlHttp.responseText; } xmlHttp.send(null); } </script> <textarea id="ajaxField12" name="message" rows="2" cols="20" value="Send" onchange="javascript:ajaxAction();"> </textarea> <div id="ajaxResponse" height="42" width="42"> </div>

    Read the article

  • SQL Server 2008 login problem with ASP.NET application: Failed to open the explicitly specified data

    - by eulerfx
    I am running SQL Server 2008 Express Edition on Windows Server 2008 with an ASP.NET application which must access the server. The ASP.NET application is associated with an application pool that runs on the NetworkService account. This account in turn has a Login and User record on SQL Server in the required database. When I attempt to run the ASP.NET website I get a blank page and when viewed in the error log, I seem to be getting this information event record: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Failed to open the explicitly specified database. [CLIENT: myLocalMachine] The connection string has Trusted_Connection=True; and the required database specified. When I explicitly specify the user name and password I get another login error stating the password is incorrect, even though the same un/pw combination works through SQL Server Management studio. The NETWORK SERVICE account seems to have all the required privileges for the database. Also, I made a test ASP.NET website project which does a simple select from a table in that database, and using the same config file I am not getting the error and it seems to work. Is it something to do with trust levels then, because the original ASP.NET web app references various DLLs including open source libraries. Also, the application does not seem to be able to write to the event log itself, throwing a security exception, even though everything in the config files, including machine.config states the app is in full trust.

    Read the article

  • Asp.net 4.0 Handler Mappings Missing in IIS7

    - by Marc
    I have two Windows 2008 R2 Servers running an asp.net 4.0 app. The server that is having problems actually loads asp.net pages just fine, but if there are any ajax calls they don't work. I noticed there are no .net 4.0 specific Handler Mappings in IIS for this server like the other server has. It's literally missing all .net 4.0 mappings (.axd, .soap, .cshtm, .ashx and even .aspx). I've tried running "aspnet_regiis -ir" but that didn't help. Should I reinstall the .net 4.0 framework? Manually add all these missing mappings? Is there something else going on? What I don't want to do is add a ton of handlers to a web.config, they aren't needed on the server that works so it shouldn't be needed on the broken one.

    Read the article

  • IIS 7 + ASP.NET 4

    - by user26712
    Hello, I have an ASP.NET application that I am trying to convert to an ASP.NET 4 application. The application is fairly simple. I have created a new web application in IIS 7.5 pointing to the directory that the ASP.NET application exists in. When I attempt to execute the application, but entering http://localhost%3A%5Bport%5D into my browser, I receive the following error: Error Summary HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list Most likely causes: * Managed handler is used; however, ASP.NET is not installed or is not installed completely. * There is a typographical error in the configuration for the handler module list.

    Read the article

  • Allow Single IP to access ASP.NET Web Service (ASMX) using Firewall

    - by Suresh Agrawal
    I have one asp.net web service (asmx) in separate project that is hosted on windows server having other asp.net web applications running on it. How can I restrict asp.net web service to be accessed by single IP address? I want that my web service must be accessed by one IP configured by me. If requests comes from any other IP, it must not reach to my web service and discarded by windows firewall itself. I know that this is something to do with windows firewall. I did it for SQL Server previously, but I don't know how to configure single asp.net web service project to do so.

    Read the article

  • IIS/ASP.NET performance incident - Perfmon Current Annonymous Users going through roof but Requests/sec low

    - by Laurence
    Setup: ASP.NET 4.0 website on IIS 6.0 on Win 2003 64 bit, 8xCPUs, 16GB memory, separate SQL 2005 DB server. Had a serious slowdown today with any otherwise fairly well performing ASP.NET site. For a period of a couple of hours all page requests were taking a very long time to be served - e.g. 30-60s compared to usual 2s. The w3wp.exe's CPU and memory usage on the webserver was not much higher than normal. The application pool was not in the middle of recycling (and it hadn't recycled for several hours). Bottlenecks in the database were ruled out - no blocks occurring and query results were being returned quickly. I couldn't make any sense of it and set up the following Perfmon counters: Current Anonymous Users (for site in question) Get requests/sec (ditto) Requests/sec for the ASP.NET application running the site Get requests/sec was averaging 100-150. Requests/sec for ASP.NET was averaging 5-10. However Current Anonymous Users was around 200. And then as I was watching, the Current Anonymous Users began to climb steeply going up to about 500 within a few minutes. All this time Get requests/sec & Requests/sec for ASP.NET was if anything going down. I did a whole load of things (in a panic!) to try to get the site working, like shutting it down, recycling the app pool, and adding another worker process to the pool. I also extended the expiration time for content (in IIS under HTTP Headers) in an attempt to lower the number of requests for static files (there are a lot of images on the site). The site is now back to normal, and the counters are fairly steady and reading (added Current Connections counter): Current Anonymous Users : average 30 Get requests/sec : average 100 Requests/sec for ASP.NET : 5 Current Connections : average 300 I have also observed an inverse relationship between Get requests/sec & Current Anonymous Users. Usually both are fairly steady but there will be short periods when Get requests/sec will go down dramatically and Current Anonymous Users will go up in a perfect mirror image. Then they will flip back to their usual levels. So, my questions are: Thinking of the original performance issue - if w3wp.exe CPU, memory usage were normal and there was no DB bottleneck, what could explain page requests taking 20 times longer to be served than usual? What other counters should I be looking at if this happens again? What explains the inverse relationship between Get requests/sec & Current Anonymous Users? What could explain Current Anonymous Users going from 200 to 500 within a few minutes? Many thanks for any insight into this.

    Read the article

  • SQL Server 2008 login problem with ASP.NET application: Failed to open the explicitly specified database

    - by eulerfx
    I am running SQL Server 2008 Express Edition on Windows Server 2008 with an ASP.NET application which must access the server. The ASP.NET application is associated with an application pool that runs on the NetworkService account. This account in turn has a Login and User record on SQL Server in the required database. When I attempt to run the ASP.NET website I get a blank page and when viewed in the error log, I seem to be getting this information event record: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Failed to open the explicitly specified database. [CLIENT: myLocalMachine] The connection string has Trusted_Connection=True; and the required database specified. When I explicitly specify the user name and password I get another login error stating the password is incorrect, even though the same un/pw combination works through SQL Server Management studio. The NETWORK SERVICE account seems to have all the required privileges for the database. Also, I made a test ASP.NET website project which does a simple select from a table in that database, and using the same config file I am not getting the error and it seems to work. Is it something to do with trust levels then, because the original ASP.NET web app references various DLLs including open source libraries. Also, the application does not seem to be able to write to the event log itself, throwing a security exception, even though everything in the config files, including machine.config states the app is in full trust.

    Read the article

  • Windows 7 / IIS 7 / Classic ASP not working

    - by Lucenut
    I have some old classic asp scripts. They used to work on my 2003/IIS 6 server. But on my Vista/IIS 7 and now Windows 7 Ultimate/IIS 7 server the asp pages don't work. I did what they said here: Deploying a Classic ASP Server (IIS 7) (Microsoft TechNet). I enabled those 3 features in IIS 7 but that just went from getting 404 to 500 error.

    Read the article

  • How do you 'clone' WebControls in C# .NET ?

    - by Adz
    My basic question is, in .NET, how do I clone WebControls? I would like to build a custom tag, which can produce multiple copies of its children. Ultimately I intend to build a tag similar to in JSP/Struts. But the first hurdle I have is the ability to duplicate/clone the contents of a control. Consider this rather contrived example; <custom:duplicate count="2"> <div> <p>Some html</p> <asp:TextBox id="tb1" runat="server" /> </div> </custom:duplicate> The HTML markup which is output would be something like, <div> <p>Some html</p> <input type="text" id="tb1" /> </div> <div> <p>Some html</p> <input type="text" id="tb1" /> </div> Note: I know i have the id duplicated, I can come up with a solution to that later! So what we would have is my custom control with 3 children (I think) - a literal control, a TextBox control, and another literal control. In this example I have said 'count=2' so what the control should do is output/render its children twice. What I would hope to do is write some "OnInit" code which does something like: List<WebControl> clones; for(int i=1; i<count; i++) { foreach(WebControl c in Controls) { WebControl clone = c.Clone(); clones.Add(clone); } } Controls.AddRange(clones); However, as far as I can tell, WebControls do not implement ICloneable, so its not possible to clone them in this way. Any ideas how I can clone WebControls?

    Read the article

  • Autocomplete jQuery on User Controller within Repeater .NET

    - by TheDPQ
    I have a Multiview search feature on a Web User Controller that is called within a Repeater, OHMY!! I have some training sessions being listed out on a page, each calling an employeeSearch Web User Controller so people can search for employees to add to the training session. I have the Employee Names and Employee IDs listed out in JS on the page and using the jQuery autocomplete i have them search for the employee and populate a hidden field in the User controller. Once the process is done they have the option of adding yet another employee. So i had Autocompelte 'work' in all the employee search boxes, but one i do the initial search (postback) autocomplete won't work again. Then i updated $().ready(function() to pageLoad() so it works correctly on multiple searches but only in the LAST item of the repeater (jQuery is loaded on the User Controller) FYI: I have the JS string set as EMPLOYEENAME|ID and jQuery displays the Employee Name and if they select it throws the ID in a ASP:HIDDEN FIELD <script type="text/javascript"> format_item = function(item, position, length) { var str = item.toString().split("|", 2); return str[0]; } function pageLoad() { $("#<%=tb_EmployeeName.ClientID %>").autocomplete(EmployeeList, { minChars: 0, width: 500, matchContains: true, autoFill: false, scrollHeight: 300, scroll: true, formatItem: format_item, formatMatch: format_item, formatResult: format_item }); $("#<%=tb_EmployeeName.ClientID %>").result(function(event, data, formatted) { var str = data.toString().split("|", 2); $("#<%=hf_EmployeeID.ClientID %>").val(str[1]); }); }; </script> I can already guess that by repeating pageLoad within the User Controll i override the previous pageLoad. THE QUESTION: Is there a way around this, a way to have all the jQuery appear in a single pageLoad or to somehow have a single jquery call to handle all my search boxes? I can't move the jQuery into the page calling all the controllers because i have no way of referencing the specific *tb_EmployeeName* textbox AND *hf_EmployeeID* hidden field. Thank you so much for any help or insight you can give me into this problem. This is the Multiview that on the User Controller <asp:MultiView ID="mv_EmployeeArea" runat="server" ActiveViewIndex="0"> <asp:View ID="vw_Search" runat="server"> <asp:Panel ID="eSearch" runat="server"> <b>Signup Employee Search</b> (<i>Last Name, First Name</i>)<br /> <asp:TextBox ID="tb_EmployeeName" class="EmployeeSearch" runat="server"></asp:TextBox> <asp:HiddenField ID="hf_EmployeeID" runat="server" /> <asp:Button ID="btn_Search" runat="server" Text="Search" /> </asp:Panel> </asp:View> <asp:View ID="vw_Confirm" runat="server"> <b>Signup Confirmation</b> <asp:FormView ID="fv_EmployeeInfo" runat="server"> <ItemTemplate> <%#(Eval("LastName"))%>, <%#(Eval("FirstName"))%><br /> </ItemTemplate> </asp:FormView> <asp:Button ID="btn_Confirm" runat="server" Text="Signup this employee" /> &nbsp; <asp:Button ID="btn_Reset3" runat="server" Text="Reset" /> </asp:View> <asp:View ID="vw_ThankYou" runat="server"> <b>Thank You</b><br /> The employee has been signed up and an email confirmation has been sent out.<br /><br /> <asp:Button ID="btn_Reset" runat="server" Text="Reset" /> </asp:View> </asp:MultiView> UPDATE: I never did find an answer but i had to do a demo so i hacked together something that 'works', but feels sort of cheesy. I am still very much needed of a better question or better understanding.

    Read the article

  • This 404 seems unavoidable - what am I doing wrong? [Ninject 2.0 with ASP.NET MVC 2 on .NET 4]

    - by Tomas Lycken
    I downloaded the fairly new Ninject 2.0 and Ninject.Web.Mvc (targeting mvc2) sources today, and successfully built them against .NET 4 (release configuration). When trying to run an application using Ninject 2.0, i keep getting 404 errors and I can't figure out why. This is my global.asax.cs (slightly shortified, for brevity): using ... using Ninject; using Ninject.Web.Mvc; using Ninject.Modules; namespace Booking.Web { public class MvcApplication : NinjectHttpApplication { protected override void OnApplicationStarted() { Booking.Models.AutoMapperBootstrapper.Initialize(); RegisterAllControllersIn(Assembly.GetExecutingAssembly()); base.OnApplicationStarted(); } protected void RegisterRoutes(RouteCollection routes) { ... routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Entry", action = "Index", id = "" } ); } protected override IKernel CreateKernel() { INinjectModule[] mods = new INinjectModule[] {...}; return new StandardKernel(mods); } } } The EntryController exists, and has an Index method that simply does a return View(). I have debugged, and verified that the call to RegisterAllControllersIn() is executed. I have also tried to use Phil Haacks Routing debugger but I still get a 404. What do I do to find the cause of this?

    Read the article

  • .net mvc pass dictionary data from view to controller

    - by Wei Ma
    A while ago, I was trying to pass a dictionary data from my view to my controller. And I was able to do so after googling on the net(remember it was one of scott hanselman's posts). The solution I had was something like <%for(int index=0; index<Model.Count(); index++){ var property= Model.ElementAt(index);%> <input type="hidden" name="<%="properties["+index+"].Key"%>"/> <input type="hidden" name="<%="properties["+index+"].Value"%>"/> <%}%> public ActionResult Process(IDictionary<string,string> properties) { doSomething(); return View(); } The code worked for awhile and then I did some refactoring and got rid of this chunk of code. Today, I ran into a situation in which I would like to pass a dictionary again. But no matter how hard I try, the properties parameter received by the action was always null. I tried the above code and <%for(int index=0; index<Model.Count(); index++){ var property= Model.ElementAt(index);%> <input type="hidden" name="<%="properties.Keys["+index+"]"%>"/> <input type="hidden" name="<%="properties.Values["+index+"]"%>"/> <%}%> Neither code worked. I googled again but couldn't find the post that helped me before. Can someone point out what I did wrong? thanks a million.

    Read the article

  • Quartz.Net scheduler works locally but not on remote host

    - by Glinkot
    Hi. I have a timed quartz.net job working fine on my dev machine, but once deployed to a remote server it is not triggering. I believe the job is scheduled ok, because if I postback, it tells me the job already exists (I normally check for postback however). The email code definitely works, as the 'button1_click' event sends emails successfully. I understand I have full or medium trust on the remove server. My host says they don't apply restrictions that they know of which would affect it. Any other things I need to do to get it running? using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Quartz; using Quartz.Impl; using Quartz.Core; using Aspose.Network.Mail; using Aspose.Network; using Aspose.Network.Mime; using System.Text; namespace QuartzTestASP { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ISchedulerFactory schedFact = new StdSchedulerFactory(); IScheduler sched = schedFact.GetScheduler(); JobDetail jobDetail = new JobDetail("testJob2", null, typeof(testJob)); //Trigger trigger = TriggerUtils.MakeMinutelyTrigger(1, 3); Trigger trigger = TriggerUtils.MakeSecondlyTrigger(10, 5); trigger.StartTimeUtc = DateTime.UtcNow; trigger.Name = "TriggertheTest"; sched.Start(); sched.ScheduleJob(jobDetail, trigger); } } protected void Button1_Click1(object sender, EventArgs e) { myutil.sendEmail(); } } class testJob : IStatefulJob { public testJob() { } public void Execute(JobExecutionContext context) { myutil.sendEmail(); } } public static class myutil { public static void sendEmail() { // tested code lives here and works fine when called from elsewhere } } }

    Read the article

  • Trouble with object injection in Spring.Net

    - by Abdel Olakara
    Hi all, I have a issue with my Spring.Net configuration where its not injecting an object. I have a CommService to which an object named GeneralEmail is injected to. Here is the configuration: <!-- GeneralMail Object --> <object id="GeneralMailObject" type="CommUtil.Email.GeneralEmail, CommUtil"> <constructor-arg name="host" value="xxxxx.com"/> <constructor-arg name="port" value="25"/> <constructor-arg name="user" value="[email protected]"/> <constructor-arg name="password" value="xxxxx"/> <constructor-arg name="template" value="xxxxx"/> </object> <!-- Communication Service --> <object id="CommServiceObject" type="TApp.Code.Services.CommService, TApp"> <property name="emailService" ref="GeneralMailObject" /> </object> The communication service object is again injected to many other aspx pages & service. In one scenario, I need to call the commnucation service from an static WebMethod. I try doing: CommService cso = new CommService(); But when i try to get the emailService object, its null! why didn't the spring inject the GeneralMail object into my cso object? What am I doing wrong and how do I access the object from spring container. Thanks in advance for the suggestions and solutions. Reagrds, Abdel Olakara

    Read the article

  • "Failed to find or load the registered .Net Framework Data Provider" with MySQL + ASP.NET

    - by Malachi
    How do we repair this? This question has been sort of addressed many times around the internet, but it's always a workaround. Always copying the MySql.data.dll into your bin directory, or explicitly stating what version you want. What is the "proper" approach to using DbProvderFactory for MySQL with ASP.NET? I'd like to be able to develop locally and not worry what version they have installed on the server. As it stands, if I do copy up my own version I have to make sure it's the one they use. Seems easy to break.

    Read the article

  • Ajax call in a jQuery plugin not working properly

    - by Saneef
    I'm trying to create a jQuery plugin, inside I need to do an AJAX call to load an xml. jQuery.fn.imagetags = function(options) { s = jQuery.extend({ height:null, width:null, url:false, callback:null, title:null, }, options); return this.each(function(){ obj = $(this); //Initialising the placeholder $holder = $('<div />') .width(s.width).height(s.height) .addClass('jimageholder') .css({ position: 'relative', }); obj.wrap($holder); $.ajax({ type: "GET", url: s.url, dataType: "xml", success:function(data){ initGrids(obj,data,s.callback,s.title); } , error: function(data) { alert("Error loading Grid data."); }, }); function initGrids(obj, data,callback,gridtitle){ if (!data) { alert("Error loading Grid data"); } $("gridlist gridset",data).each(function(){ var gridsetname = $(this).children("setname").text(); var gridsetcolor = ""; if ($(this).children("color").text() != "") { gridsetcolor = $(this).children("color").text(); } $(this).children("grid").each(function(){ var gridcolor = gridsetcolor; //This colour will override colour set for the grid set if ($(this).children("color").text() != "") { gridcolor = $(this).children("color").text(); } //addGrid(gridsetname,id,x,y,height,width) addGrid( obj, gridsetname, $(this).children("id").text(), $(this).children("x").text(), $(this).children("y").text(), $(this).children("height").text(), $(this).children("width").text(), gridcolor, gridtitle ); }); }); } function addGrid(obj,gridsetname,id,x,y,height,width,color,gridtitle){ //To compensate for the 2px border height-=4; width-=4; $grid = $('<div />') .addClass(gridsetname) .attr("id",id) .addClass('gridtag') .imagetagsResetHighlight() .css({ "bottom":y+"px", "left":x+"px", "height":height+"px", "width":width+"px", }); if(gridtitle != null){ $grid.attr("title",gridtitle); } if(color != ""){ $grid.css({ "border-color":color, }); } obj.after($grid); } }); } The above plugin I bind with 2 DOM objects and loads two seperate XML files but the callback function is run only on the last DOM object using both loaded XML files. How can I fix this, so that the callback is applied on the corresponding DOMs. Is the above ajax call is correct? Sample usage: <script type="text/javascript"> $(function(){ $(".romeo img").imagetags({ height:500, width:497, url: "sample-data.xml", title: "Testing...", callback:function(id){ console.log(id); }, }); }); </script> <div class="padding-10 min-item background-color-black"> <div class="romeo"><img src="images/samplecontent/test_500x497.gif" alt="Image"> </div> </div> <script type="text/javascript"> $(function(){ $(".romeo2 img").imagetags({ height:500, width:497, url: "sample-data2.xml", title: "Testing...", callback:function(id){ console.log(id); }, }); }); </script> <div class="padding-10 min-item background-color-black"> <div class="romeo2"><img src="images/samplecontent/test2_500x497.gif" alt="Image"> </div> </div> Here is the sample XML data: <?xml version="1.0" encoding="utf-8"?> <gridlist> <gridset> <setname>gridset4</setname> <color>#00FF00</color> <grid> <color>#FF77FF</color> <id>grid2-324</id> <x>300</x> <y>300</y> <height>60</height> <width>60</width> </grid> </gridset> <gridset> <setname>gridset3</setname> <color>#00FF00</color> <grid> <color>#FF77FF</color> <id>grid2-212</id> <x>300</x> <y>300</y> <height>100</height> <width>100</width> </grid> <grid> <color>#FF77FF</color> <id>grid2-1212</id> <x>200</x> <y>10</y> <height>200</height> <width>10</width> </grid> </gridset> </gridlist>

    Read the article

  • Why does System.Net.Mail work in one part of my c#.net web app, but not in another?

    - by Marc
    I have a web application that is running on IIS within my company's domain, and is being accessed via intranet. I have this application sending out email based on some user actions. For example, its a scheduling application in part, so if a task is completed, an email is sent out notifying other users of that. The problem is, the email works flawlessly in some cases, and not at all in others. I have a login.aspx page which sends out report emails when the page is loaded (its loaded once a day via windows task scheduler) - this always seems to work perfectly. I have an update page which is supposed to send email when text is entered and the "Update" button is clicked - this operation will fail most of the time. Both of these tasks use the same static overloaded method I wrote to send email using System.Net.Mail. I have tried using gmail as my smtp server (instead of our internal one), and get the same results. I investigated whether having the local SMTP Service running makes any difference, and it doesn't seem to. Besides, since C# is server-side code, shouldn't it only matter whats running on the server, and not the client? Please help me figure out whats wrong! Where should I look? What can I try?

    Read the article

  • AJAX call + JQuery Dialog Title changing dynamically

    - by Panther24
    I have an AJAX call which loads an Dialog page, now depending upon the content of the data returned on the AJAX call, I want to change the title of the Window, how do I do that. Here is the snippet of code: var divid = "brHistoryForm"; var url = "getRestoreFiles.action?profileName="+profileName; // Create xmlHttp var xmlHttp = AJAX(); // The code... xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById(divid).innerHTML=xmlHttp.responseText; } } xmlHttp.open("GET",url,true); xmlHttp.send(null); $('#brHistoryForm').dialog('open'); jQuery('#brHistoryForm').focus(); document.getElementById('pageTitle').innerHTML = "<h2>"+profileName+" - B&R History</h2>" Here 'pageTitle' is a div. When I run the above piece of code, it opens a dialog window, the action is redirected to a jsp page which is loaded inside the div. It works fine, but the title does not get set :(. I've tried to do the setting of the title in the redirected jsp page, it doesn't work either. Here is the code of that JSP page: <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>B&R History</title> </head> <body> <table style="width: 100%"> <tr> <td style="width: 40%"> <div id="pageTitle"> <h2>B&R History</h2> </div> </td> </tr> </table> <table id="diskTable" cellpadding="0" cellspacing="0" border="1" class="display"> <thead> <tr> <th>Select</th><th>Operation</th> <th>Source</th><th>Destination</th> <th>Status</th><th>Start Time</th><th>End Time</th> </tr> </thead> <tfoot></tfoot> <tbody> <s:iterator value="restoreFileList"> <tr> <td> <s:if test="%{status.equals('Finished')}"> <input onClick="loadRestoreForm('<s:property value="name"/>', '<s:property value="to_path"/>', '<s:property value="status"/>')" type="radio" name='chk' id="chk" value="<s:property value='id'/>,<s:property value="status"/>" > </s:if> <s:else> <input type="radio" name='chk' id="chk" value="<s:property value='id'/>,<s:property value="status"/>" disabled> </s:else> </td> <td> <s:if test="%{br_type == 0}"> Backup </s:if> <s:else> Restore </s:else> </td> <td><s:property value="from_path"/></td> <td><s:property value="to_path"/></td> <td><s:property value="status"/></td> <td><s:property value="start_time"/></td> <td><s:property value="end_time"/></td> </tr> </s:iterator> </tbody> </table> </body> </html> Any help would be appreciated.

    Read the article

  • Access .accdb format’s

    - by wisecarver
    Were you aware there are two versions of the Access .accdb file format? The 2007 “ACE” version and the 2010 “ACE” version both use different drivers. If you’ve tried to use the Access Database .accdb format on DiscountASP.NET servers and it failed you must have been using a Data file created with the 2010 version of Access. OK, you’re shouting at me right now for even suggesting Access Databases for Shared hosting, right? I agree, SQL Server is the way to go and I personally help a lot of developers...(read more)

    Read the article

  • No Method Error in Ruby

    - by JayG
    Hi, I currently have a Rails Apps that lets users drag and drop certain elements of the webpage and updates the application based on the users choice. This is done with the help of the Rails helpers and AJAX. However I keep running into a "NoMethodError" in Ruby. NoMethodError in ProjectsController#member_change undefined method `symbolize_keys' for nil:NilClass Here is the method that is being called. My trace says that error is occurring in this line: before = u.functions_for(r.authorizable_id) u.roles << r unless u.roles.include? r u.save flag_changed = true after = u.functions_for(r.authorizable_id) And here is the function being called def member_change flag_changed = false params['u'] =~ /role_(\d+)_user_(\d+)/ drag_role_id = $1 user_id = $2 params['r'] =~ /role_(\d+)/ drop_role_id = $1 if u=User.find(user_id) if r=Role.find(drop_role_id) if drag_role_id.to_i !=0 and old_r=Role.find(drag_role_id) if drag_role_id == drop_role_id #fom A to A => nothing happen flash.now[:warning] = _('No Operation...') elsif r.authorizable_id == old_r.authorizable_id #the same project? old_r.users.delete(u) unless old_r.valid? flash.now[:warning] = _('Group "Admin" CAN NOT be EMPTY.') old_r.users << u #TODO: better recovery member_edit #if flag_changed render :action => :member_edit, :layout => 'module_with_flash' return end old_r.save r.users << u unless r.users.include? u r.save flag_changed = true before = u.functions_for(r.authorizable_id) after = u.functions_for(r.authorizable_id) added = after - before removed = before - after added.each do |f| ApplicationController::send_msg(:function,:create, {:function_name => f.name, :user_id => u.id, :project_id => r.authorizable_id }) end removed.each do |f| ApplicationController::send_msg(:function,:delete, {:function_name => f.name, :user_id => u.id, :project_id => r.authorizable_id }) end flash.now[:notice] = _( 'Move User to Group' ) + " #{ r.name }" else flash.now[:warning] = _('You can\'t move User between Groups that belong to different Projects.') end else before = u.functions_for(r.authorizable_id) u.roles << r unless u.roles.include? r u.save flag_changed = true after = u.functions_for(r.authorizable_id) added = after - before added.each do |f| ApplicationController::send_msg(:function,:create, {:function_name => f.name, :user_id => u.id, :project_id => r.authorizable_id }) end flash.now[:notice] = _( 'Add User into Group' ) + " #{ r.name }" end else flash.now[:warn] = _( 'Group doesn\'t exist!' ) + ": #{ r.name }" end else flash.now[:warning] = _( 'User doesn\'t exist!' ) + ": #{ u.login }" end member_edit #if flag_changed render :action => :member_edit, :layout => 'module_with_flash' end and the JavaScript used to call the function jQuery('#RemoveThisMember').droppable({accept:'.RolesUsersSelection', drop:function(ev,ui){ if (confirm("This will remove User from this Group, are you sure?")) {jQuery.ajax({data:'u=' + encodeURIComponent(jQuery(ui.draggable).attr('id')), success:function(request){jQuery('#module_content').html(request);}, type:'post', url:'/of/projects/11/member_delete'});} }, hoverClass:'ProjectRoleDropDelete_active'}) Any ideas? Thanks,

    Read the article

< Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >