Search Results

Search found 818 results on 33 pages for 'onload'.

Page 10/33 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Inconsistencies in Health Monitoring Between WebForms and MVC

    As I have written and spoken on numerous occasions, Health Monitoring happens to be one of my favorite features in ASP.NET. In WebForms, it's a path well trodden. However, while building Morts & Elvises with MVC2, I ran into a strange inconsistency, which I'd like to describe here. WebForms Whenever a WebForm throws an unhandled exception, at the very least the error is written to the system's even log. Suppose we have this silly simple page method: protected override void OnLoad...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Small app structure review

    - by Lorenzo
    Hi, I would be grateful if someone could review following: I have a main Form app. OnLoad it displays with Docstyle=Fill the main menu which is done by user control. If the user selects a choice in that Menu control, it fires an event (with one parameter Choice) which main forms reacts on. If the choice is run the app, it closes the user control (dipose) and call method starting the app. If the choice is to quit, it calls Application.Exit. Is that alright form programmers point of view?

    Read the article

  • Dropdowns revisited

    For my DIBI presentationI need a dropdown menu (in order to compare it on desktop and mobile), so I wrote one.Point is, it took me thirty lines of JavaScript, nine of which only contain a closing },and three of which deal with the fact that bloody Firefox still doesn’t support contains().Net amount of lines: 18. Can somebody please remind me why we all used to think dropdownsare so extremely complicated? I can’t for the life of me figure it out.window.onload = function () { document.getElementById('dropdown').onmouseover...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How to move an object using X and Y coordinates in JavaScript

    - by Geroy290
    I am making a 2d game with JavaScript and HTML5 and am trying to move an image that I have drawn with JavaScript like so: //canvas var c = document.getElementById("gameCanvas"); var ctx = c.getContext("2d"); //baseball var baseball = new Image(); baseball.onload = function() { ctx.drawImage(baseball, 400, 425); }; baseball.src = "baseball2.png"; I'm not sure how I would move it though, I have seen many people seem to just type something like ballX and ballY but I don't understand where the actual x and y definition comes from. Here is my code so far: http://jsfiddle.net/xRfua/ I have a different image source but it is a local source so I couldn't include it. Thanks in a dvance for any help!

    Read the article

  • Delete blank row in dropdownlist or select default value in infopath dropdown

    - by KunaalKapoor
    Regular Dropdown (Pulling from DataSource)1. Double click on dropdown field in the data source.2. Select Fx button for Default value.3. Select Insert field or group.4. Select secondary xml from data source.5. Select “value” and click on ok.For a cascading dropdown:You have to add the rule and follow these steps,1. Rules -> ‘Add’ - > ‘Add Action’.2. Select ‘Set a field value’ option in first dropdown in Action.3. Select your field with help of ‘Select a Field or Group’ option in ‘Field’.4. Select your external data source list value in ‘Value’.This rule you can apply in OnLoad or whenever you will get external data source values.

    Read the article

  • How to refresh/reload page once using jQuery?

    - by Pete
    Hi! Newbie question: I'm wondering how to refresh/reload a page (or even specific div) once(!) using jQuery? Ideally in a way right after the "DOM structure" is available (cf. "onload" event) and not negatively affecting "back button" or "bookmark" functionalities. Please note: ''replace('' is not allowed due to third-party restrictions. Thanks in advance! --Pete

    Read the article

  • NHibernate.MappingException: No persister for:

    - by Sara Chipps
    Now, before you say it I DID google and my hbm.xml file IS an Embedded Resource. Here is the code I am calling: ISession session = GetCurrentSession(); var returnObject = session.Get<T>(Id); Here is my mapping file for the class: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="HQData.Objects.SubCategory, HQData" table="SubCategory" lazy="true"> <id name="ID" column="ID" unsaved-value="0"> <generator class="identity" /> </id> <property name="Name" column="Name" /> <property name="NumberOfBuckets" column="NumberOfBuckets" /> <property name="SearchCriteriaOne" column="SearchCriteriaOne" /> <bag name="_Businesses" cascade="all"> <key column="SubCategoryId"/> <one-to-many class="HQData.Objects.Business, HQData"/> </bag> <bag name="_Buckets" cascade="all"> <key column="SubCategoryId"/> <one-to-many class="HQData.Objects.Bucket, HQData"/> </bag> </class> </hibernate-mapping> Has anyone run to this issue before? I swore that was it after I read it, but no dice. Here is the rest of the error and thanks for your help. MappingException: No persister for: HQData.Objects.SubCategory]NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName, Boolean throwIfNotFound) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:766 NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:752 NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Event\Default\DefaultLoadEventListener.cs:37 NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:2054 NHibernate.Impl.SessionImpl.Get(String entityName, Object id) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:1029 NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:1020 NHibernate.Impl.SessionImpl.Get(Object id) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:985 HQData.DataAccessUtils.NHibernateObjectHelper.LoadDataObject(Int32 Id) in C:\Development\HQChannelRepo\HQ Channel Application\HQChannel\HQData\DataAccessUtils\NHibernateObjectHelper.cs:42 HQWebsite.LocalSearch.get_subCategory() in C:\Development\HQChannelRepo\HQ Channel Application\HQChannel\HQWebsite\LocalSearch.aspx.cs:17 HQWebsite.LocalSearch.Page_Load(Object sender, EventArgs e) in C:\Development\HQChannelRepo\HQ Channel Application\HQChannel\HQWebsite\LocalSearch.aspx.cs:27 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436 I had changed some code and I wasn't adding the Assembly to the config file during runtime. Thanks for your help This has been fixed, I am not F-ing with my NHibernate setup ever again!

    Read the article

  • Chrome Extension - Cross-Origin XMLHttpRequest - Returning HTML/JSON

    - by Tyler
    Hi everyone, I hope you can help me :) I've created a Chrome extension (my first one) and I'm having some difficulty auto-populating a <select> with <option> that are being returned. the default_popup page is index.htm. I have two <select> (listboxes? can't remember the name) boxes. When a user first clicks the extension, it performs a XMLHttpRequest to a php script and get's a list of names from a MySQL database. It returns (onLoad) the list in the form of: <option>blah</option> When a user selects an option from the first listbox/select, it performs another XMLHttpRequest and auto-populates the second listbox/select. Then when a user selects an option from the second listbox it will eventually populate a few details further down the page. I've been testing by just running the index.htm file and seeing if just the code works correctly, which it does. However when trying to view it from the extension, it doesn't work. The onLoad doesn't fill in the first listbox, and selecting an option (one that I typed in the box for testing purposes) from the first listbox doesn't populate the second listbox. I thought maybe it was a permissions error, so I tried adding the domain to the manifest.json file; but I appear to be getting an error in the manifest.json file after doing so. In my default_popup (index.htm) file I have this script for my XMLHttpRequest: <script type="text/javascript"> function getClient(str,type) { if (str=="") { document.getElementById(type).innerHTML=""; return; } 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(type).innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","http://(domain removed)/Extension/getInfo.php?q="+type+"&c="+str,true,"user","pass"); xmlhttp.send(); } </script> This is what my manifest.json file looks like: { "name": "Client Center Lite", "version": "1.0", "description": "blah", "browser_action": { "default_icon": "images/icon_19.png", "default_popup": "index.htm", "default_title": "Client Center Lite" }, "icons":{ "128":"images/icon_128.png" } "permissions": { "http://(domain removed)/" }, } Am I doing this correctly? The point of the extension is to be able to quickly view client details. The extension will only be given to employees locally in a .crx file, and not distributed online. The domain I am accessing through the PHP/MySQL is accessible from the web, but I'm currently using localhost in my mysql_connect string. Do I need to be returning the <option> elements encoded as JSON? If so, I'm completely cluesless as how to do that.

    Read the article

  • "Alert" and "if" changes behaviour of dom copying from iframe to div

    - by lowkey
    Hi guys! Tried to make a little old school ajax (iframe-javascript) script. A bit of mootools is used for DOM navigation Description: HTML: 1 iframe called "buffer" 1 div called "display" JAVASCRIPT: (short: copy iframe content into a div on the page) 1) onLoad on iframe triggers handler(), a counter makes sure it only run once (this is because otherwise firefox will go into feedback loop. What i think happens: iframe on load handler() copyBuffer change src of iframe , and firefox takes that as an onload again) 2) copybuffer() is called, it sets src of iframe then copies iframe content into div, then erases iframe content THE CODE: count=0; function handler(){ if (count==0){ copyBuffer(); count++; } } function copyBuffer(){ $('buffer').set('src','http://www.somelink.com/'); if (window.frames['buffer'] && $('display') ) { $('display').innerHTML = window.frames['buffer'].document.body.innerHTML; window.frames['buffer'].document.body.innerHTML=""; } } problems: QUESTION 1) nothing happens, the content is not loaded into the div. But if i either: A) remove the counter and let the script run in a feedback loop: the content is suddenly copied into the div, but off course there is a feedback loop going on, you can see it keeps loading in the status bar. OR B) insert an alert in the copyBuffer function. The content is copied, without the feedback loop. why does this happen? QUESTION 2) The If wrapped around the copying code i got from a source on the internet. I am not sure what it does? If i remove it the code does not work in: Safari and Chrome. Many thanks in advance! UPDATE: Like the answers said i have created an event handler. They used jQuery, i have made one in mootools: window.addEvent('domready', function() { $('buffer').addEvent('load', function(){ $('display').set('html',window.frames['buffer'].document.body.innerHTML) window.frames['buffer'].document.body.innerHTML=""; }).set('src','somelink'); }); Bonus question: 3) Im new at stackoverflow (what an amazing place!), is it better if i make new threads for follow up questions?

    Read the article

  • Colorbox class don't work with ajax/dom object

    - by almal
    i usually use colorbox tool for open "popup windows" in my page and all are fine. In my new project the situation is little different because i use js/ajax/dom for create dinamically my objects in handleRequestStateChange() function. After import js,jquery and css for colorbox, in the head of my js page i write: $(document).ready(function () { $(window).scroll(function () { //oP1 = document.createTextNode(posizione_menu.offsetTop); //divIpt.appendChild(oMtx1); $(".divHcss").css("position", "fixed").css("top", "0px").css("z-index", "999"); }); //Examples of how to assign the Colorbox event to elements $(".group1").colorbox({rel:'group1'}); $(".group2").colorbox({rel:'group2', transition:"fade"}); $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); $(".group4").colorbox({rel:'group4', slideshow:true}); $(".ajax").colorbox(); $(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390}); $(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409}); $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"}); $(".inline").colorbox({inline:true, width:"50%"}); $(".callbacks").colorbox({ onOpen:function(){ alert('onOpen: colorbox is about to open'); }, onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); }, onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); }, onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); $('.non-retina').colorbox({rel:'group5', transition:'none'}) $('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true}); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here."); return false; }); }); and after in handleRequestStateChange() i create my a element and assign to a div: var a = createElement('a'); //a.style.display = "block"; a.setAttribute('class','iframe'); a.setAttribute('href',"php/whois.php?P1="+oStxt.value); var divIp3 = createElement('div', 'divIp3', 'divIp3css'); var divIp31 = createElement('div', 'divIp31', 'divIp31css'); divIp3.appendChild(divIp31); divIp3.appendChild(a); a.appendChild(divIp31); The divIp31 become linkable but the href open page in a normal browser tab and not using attribute class for colorbox. Someone have an idea about? Thanks in advance AM

    Read the article

  • Show the focused div only bookmarklet

    - by ideotop
    I'm searching to select a text from a div, then click on a bookmarklet that remove all html parts in the body except the div where the text is selected maybe jquery can help with something like : javascript:var%20s=document.createElement('script');s.setAttribute('src',%20'http://jquery.com/src/jquery-latest.js');document.body.appendChild(s);s.onload=function(){/*the code*/};void(s);

    Read the article

  • Firefox extension object instantiating

    - by Michael
    I want my javascript object to be initialized just once, so each new browser window will not create new data items, new functions, etc... usually we initialize the code at the end of main javascript using load window.addEventListener("load", main.onLoad, false); so once the second browser window opened, the initialization code will start from scratch. However, I would like to re-use the existing object on consequent browsers. Any mechanism that I can use?

    Read the article

  • XML cross-browser support

    - by 1anthony1
    I need help getting the file to run in Firefox: I have tried adapting scripts so that my file runs in both IE and Firefox but so far it still only works in IE. (The file can be tested at http://www.eyle.org/crosstest.html - simply type the word Mike in the text box using IE (doesn't work in Firefox).The HTML document is: <!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=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> var xmlDoc; //loads xml using either IE or firefox function loadXmlDoc() { //test for IE if(window.ActiveXObject) { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = false; xmlDoc.load("books2.xml"); } //test for Firefox else if(document.implementation && document.implementation.createDocument) { xmlDoc = document.implementation.createDocument("","",null); xmlDoc.load("books2.xml"); } //if neither else {document.write("xml file did not load");} } //window.onload = loadXmlDoc(); var subject; //getDetails adds value of txtField to var subject in outputgroup(subject) function getDetails() { //either this or window.onload = loadXmlDoc is needed loadXmlDoc(); var subject = document.getElementById("txtField1").value; function outputgroup(subject) { var xslt = new ActiveXObject("Msxml2.XSLTemplate"); var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); var xslProc; xslDoc.async = false; xslDoc.resolveExternals = false; xslDoc.load("contains3books.xsl"); xslt.stylesheet = xslDoc; xslProc = xslt.createProcessor(); xslProc.input = xmlDoc; xslProc.addParameter("subj", subject); xslProc.transform(); document.write(xslProc.output); } outputgroup(subject); } </script> </head> <body> <input type="text" id="txtField1"> <input type="submit" onClick="getDetails(); return false"> </body> </html> The file includes books2.xml and contains3books.xsl (I have put the code for these files at ...ww.eyle.org/books2.xml ...ww.eyle.org/contains3books.xsl) (NB: replace ...ww. with http: // www)

    Read the article

  • JSONP context problem

    - by PoweRoy
    I'm using a javascript autocomplete () in a greasemonkey script. On itself it works correctly but I wan't to add JSONP because I want the data from another domain. The code (snippet): function autosuggest(url) { this.suggest_url = url; this.keywords = []; return this.construct(); }; autosuggest.prototype = { construct: function() { return this; }, preSuggest: function() { this.CreateJSONPRequest(this.suggest_url + "foo"); }, CreateJSONPRequest: function(url) { var headID = document.getElementsByTagName("head")[0]; var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = url +'&callback=autosuggest.prototype.JSONCallback'; //newScript.async = true; newScript.onload = newScript.onreadystatechange = function() { if (newScript.readyState === "loaded" || newScript.readyState === "complete") { //remove it again newScript.onload = newScript.onreadystatechange = null; if (newScript && newScript.parentNode) { newScript.parentNode.removeChild(newScript); } } } headID.appendChild(newScript); }, JSONCallback: function(data) { if(data) { this.keywords = data; this.suggest(); } }, suggest: function() { //use this.keywords } }; //Add suggestion box to textboxes window.opera.addEventListener('AfterEvent.load', function (e) { var textboxes = document.getElementsByTagName('input'); for (var i = 0; i < textboxes.length; i++) { var tb = textboxes[i]; if (tb.type == 'text') { if (tb.autocomplete == undefined || tb.autocomplete == '' || tb.autocomplete == 'on') { //we handle autosuggestion tb.setAttribute('autocomplete','off'); var obj1 = new autosuggest("http://test.php?q="); } } } }, false); I removed not relevant code. Now when 'preSuggest' is called, it add a script to the header and circumvent the crossdomain problem. Now when the data is received back 'JSONcallback' is called. I can use the data, but when 'Suggest' is I can't use the this.keywords array or this.suggest_url. I think this is because 'JSONcallback' and 'Suggest' are called in a different context. How can I get this working?

    Read the article

  • LinkButton Click event ignored

    - by Craig
    I have the following Hyperlink as a button:- <asp:LinkButton ID="loginButton" runat="server" CssClass="loginButton" Text="LOGIN" OnClientClick="return validateLogin(memNoID,pwID)" AddressOf="loginButton.Click"></asp:LinkButton> It causes a postback but only executes the onload and prerender sections of code. It totally ignores the following function signature:- Protected Sub loginButton_Click(ByVal sender As Object, ByVal e As EventArgs) Some code End Sub Any pointers appreciated.

    Read the article

  • Control.IsAccessible

    - by Gerhard
    I need to check if a c# WinForm Window (FORM Class) has been initialized and waiting for user events. But I could not find out how to manage that. Therefore I had the idea to set the Control.IsAccessible Flag of the Form to true, within the OnLoad Event of the Windows Form. My question is now, what is the Control.IsAccessible Flag origin intended for? Or is there an other solution to check if the Winform is initialized. Thanks for your help

    Read the article

  • Printing problem

    - by Bandpay
    Hi there, Time to ask an odd question. window.print(); Prints only one page of 2 pages in IE8 & IE7 even the same prints both pages in FF. Now if I cancel the print dialog and just go to File - Print I get both pages in both IE & FF. window.print(); is included in ONLOAD Any idea why? Thanks Babak

    Read the article

  • JSF Ajax refresh issue

    - by johnip
    In my JSF page, I have a dropdown that needs to be populated onload of the page which is set in request scope, now I have a Ajax call that refreshes a part of the page. The Ajax piece works fine but the issue is on refresh it also calls the getter for the Dropdown and returns null ( because its in request scope). To me it makes no sense to call the getter for a component that's not part of the Ajax refresh. Am I doing it correct , please suggest.

    Read the article

  • jqModal and jquery widget long shot

    - by rod
    Hi All, I just started playing around with jquery widgets within my jqmodals in my mvc app. I know this may be a long shot but I'll take it. Initially, I can click the Add link, get the alert ("which is the prize", watching too much tv), next click cancel to close modal and get the desired results. I can, then, click the Edit link and get the same desired results. However, if I click Edit link first then I try to click the Add link, "forget about it" I don't get the alert (which means my widget did not init). But I can still go back and click Edit and get the prize (the alert message). ajax: "/Home/EditPrintAdLine" and ajax: "/Home/AddPrintAdLine" render the same web user control Any ideas? <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"> Home Page </asp:Content> <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <h2><%= Html.Encode(ViewData["Message"]) %></h2> <p> To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>. </p> <div id="printAdLineEditDialog" class="jqmWindow"></div> <div id="printAdDialog" class="jqmWindow"></div> <table> <tr><td><a id="printAdLineItem" href="#">Add a Line Item</a></td></tr> <tr><td><a id="editPrintAdLine" href="#">Edit</a></td></tr> </table> <script type="text/javascript"> $(document).ready(function() { $.widget("ui.my_widget", { _init: function() { alert("My widget was instantiated"); } }); // Add line $('#printAdLineItem').click(function(e) { $('#printAdDialog').jqmShow(this); e.preventDefault(); }); $('#printAdDialog').jqm({ ajax: "/Home/AddPrintAdLine", onLoad: function(hash) { $('#PrintAdLine_RunDate').my_widget(); } }); // Edit line $('#editPrintAdLine').click(function(e) { $('#printAdLineEditDialog').jqmShow(this); e.preventDefault(); }); $('#printAdLineEditDialog').jqm({ ajax: "/Home/EditPrintAdLine", onLoad: function(hash) { $('#PrintAdLine_RunDate').my_widget(); } }); }); </script> </asp:Content>

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >