Daily Archives

Articles indexed Wednesday April 14 2010

Page 19/122 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Masked Edit Extender Format Issue

    - by Kumar
    I am using an ASP.NET AJAX Masked Edit Extender to format phone numbers <asp:TextBox ID="tbPhoneNumber" runat="server" /> <ajaxToolkit:MaskedEditExtender TargetControlID="tbPhoneNumber" Mask="(999)999-9999" MaskType="Number" InputDirection="LeftToRight" ClearMaskOnLostFocus="false" ClearTextOnInvalid="false" runat="server" AutoComplete="false" /> On the page load event I am trying to populate the phone textbox as follows: protected void Page_Load(object sender, EventArgs e) { tbPhoneNumber.Text = "(394)456-310"; } So there is one number which is missing at the end to make it a valid phone number. When the page loads I expected the value in the textbox to be (394)456-310_ But it displays (_39)445-6310 Why is this happening?

    Read the article

  • ASP.NET treeview populate child nodes. How can I avoid a postback to server?

    - by mas_oz2k1
    I am trying to test populate on demand for a treeview. I follow the procedure from these links: http://msdn.microsoft.com/en-us/library/e8z5184w.aspx But the treeview still make a postback to the server if I expanded one of the tree nodes (If you put a breakpoint in the first line of Page_load event), thus refreshing the whole page. I am using VS2005 and Asp.net 2.0 (but the same issue occurs in VS2008) My simple test page markup is: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="aspTreeview.aspx.cs" Inherits="aspTreeview" %> <!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 runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <table> <tr> <td style="height: 80%; width: 45%;"> <asp:Panel ID="Panel1" runat="server" BorderColor="#0033CC" BorderStyle="Solid" ScrollBars="Both"> <asp:TreeView ID="TreeView1" runat="server" ShowLines="True" PopulateNodesFromClient="True" EnableClientScript="True" NodeWrap="True" ontreenodepopulate="TreeView1_TreeNodePopulate" ExpandDepth="0"> </asp:TreeView> </asp:Panel> </td> <td style="width: 10%; height: 80%;" > <div> <asp:Button ID="Button1" runat="server" Text="->" onclick="Button1_Click" /> </div> <div> <asp:Button ID="Button2" runat="server" Text="<-" /> </div> </td> <td style="width: 136px; height: 80%"> <asp:Panel ID="Panel2" runat="server" BorderColor="Lime" BorderStyle="Solid"> <asp:TreeView ID="TreeView2" runat="server" ShowLines="True" ExpandDepth="0"> </asp:TreeView> </asp:Panel> </td> </tr> <tr> <td> </td> <td> </td> <td style="width: 136px"> </td> </tr> </table> </div> </form> </body> </html> The code behind is: protected void Page_Load(object sender, EventArgs e) { Debug.WriteLine("Page_Load started."); if (!IsPostBack) { if (Request.Browser.SupportsCallback) Debug.WriteLine("Browser supports callback scripts."); for (int i = 0; i < 3; i++) { TreeNode node = new TreeNode("ENTRY " + i.ToString()); node.Value = i.ToString(); node.PopulateOnDemand = true; node.Expanded = false; TreeView1.Nodes.Add(node); } } Debug.WriteLine("Page_Load finished."); } protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { TreeNode targetNode = e.Node; for (int j = 0; j < 4200; j++) { TreeNode subnode = new TreeNode(String.Format("Sub ENTRY {0} {1}", targetNode.Value, j)); subnode.PopulateOnDemand = true; subnode.Expanded = false; targetNode.ChildNodes.Add(subnode); } }

    Read the article

  • How do you write multiple lists from Matlab to the same excel file?

    - by Ben Fossen
    I have several lists in Matlab that I want to write to the same excel file. I have one list xordered and another list aspl. I do not know the length of the lists till after I run the Matlab program. I used data = xlswrite('edgar.xls',fliplr(sortedx'),'A2:A3000') for the first list but when I tried to write another list to the same file like this I ended up with two different excel files named edgar.xls asp_data = xlswrite('edagr.xls', fliplr(aspl'), 'B2:B3000') Is there a way I can write both of these lists into the same excel file? xordered in the A column and aspl in the B column?

    Read the article

  • extract specific element from nested elements using lxml html

    - by Dan.StackOverflow
    Hi all I am having some problems that I think can be attributed to xpath problems. I am using the html module from the lxml package to try and get at some data. I am providing the most simplified situation below, but keep in mind the html I am working with is much uglier. <table> <tr> <td> <table> <tr><td></td></tr> <tr><td> <table> <tr><td><u><b>Header1</b></u></td></tr> <tr><td>Data</td></tr> </table> </td></tr> </table> </td></tr> </table> What I really want is the deeply nested table, because it has the header text "Header1". I am trying like so: from lxml import html page = '...' tree = html.fromstring(page) print tree.xpath('//table[//*[contains(text(), "Header1")]]') but that gives me all of the table elements. I just want the one table that contains this text. I understand what is going on but am having a hard time figuring out how to do this besides breaking out some nasty regex. Any thoughts?

    Read the article

  • Unique keys for Sphinx along three vectors instead of two

    - by Brendon Muir
    I'm trying to implement thinking-sphinx across multiple 'sites' hosted under a single rails application. I'm working with the developer of thinking-sphinx to sort through the finer details and am making good progress, but I need help with a maths problem: Usually the formula for making a unique ID in a thinking-sphinx search index is to take the id, multiply it by the total number of models that are searchable, and add the number of the currently indexed model: id * total_models + current_model This works well, but now I also through an entity_id into the mix, so there are three vextors for making this ID unique. Could someone help me figure out the equation to gaurantee that the id's will never collide using these three variables: id, total_models, total_entities The entity ID is an integer. I thought of: id * (total_models + total_entities) + (current_model + current_entity) but that results in collisions. Any help would be greatly appreciated :)

    Read the article

  • Scroll to anchor

    - by ZyX
    I have the following userjs which is intended to remove anchor part of the URL but still jump to it: // ==UserScript== // @name PurgeAnchor // @include * // ==/UserScript== (function() { var reg=/^(.*)\#(.*)$/; var match=reg.exec(location); function ObjectPosition(obj) { var curtop = 0; if(obj.offsetParent) while(1) { curtop += obj.offsetTop; if(!obj.offsetParent) break; obj = obj.offsetParent; } else if(obj.y) curtop += obj.y; return curtop; } if(match) { document.location.replace(match[1]); sessionStorage.setItem("anchor", match[2]); } window.addEventListener("load", (function() { var anchor=sessionStorage.getItem("anchor"); if(anchor!==null) { var obj=document.getElementById(anchor); if(obj===null) { obj=document.getElementsByName(anchor)[0]; } var pos=0; if(obj!==null) { pos=ObjectPosition(obj); window.scrollTo(0, pos); } sessionStorage.removeItem("anchor"); } }), false); })() The problem is that if I have an empty <a> tag with the name set, it fails to jump. obj.scrollIntoView() also fails. Opera-10.52_pre6306, Gentoo.

    Read the article

  • How to use strange characters in a query string

    - by peter
    I am using silverlight / ASP .NET and C#. What if I want to do this from silverlight for instance, // I have left out the quotes to show you literally what the characters // are that I want to use string password = vtakyoj#"5 string encodedPassword = HttpUtility.UrlEncode(encryptedPassword, Encoding.UTF8); // encoded password now = vtakyoj%23%225 URI uri = new URI("http://www.url.com/page.aspx@password=vtakyoj%23%225"); HttpPage.Window.Navigate(uri); If I debug and look at the value of uri it shows up as this (we are still inside the silverlight app), http://www.url.com?password=vtakyoj%23"5 So the %22 has become a quote for some reason. If I then debug inside the page.aspx code (which of course is ASP .NET) the value of Request["pasword"] is actually this, vtakyoj#"5 Which is the original value. How does that work? I would have thought that I would have to go, HttpUtility.UrlDecode(Request["pswd"], Encoding.UTF8) To get the original value. Hope this makes sense? Thanks.

    Read the article

  • Mercurial repository usage with binary files for building setup files

    - by Ryan
    I have an existing Mercurial repository for a C++ application in a small corporate environment. I asked a co-worker to add the setup script to the repository and he added all of the dependency binaries, PDFs, and executable to the repository under an Install directory. I dislike having the binaries and dependencies in the same repository, but I'd like recommendations on best practices. Here are the options I am considering: Create a separate repository for the Installer and related files Create a subrepository for the Installer and related files Use a (yet to be identified) build dependency manager I am concerned with using a subrepository with Mercurial based on what I've read so far and the (apparently) incomplete implementation. I would like to get a project dependency system, e.g. Ivy, but I don't know all of the options and haven't had time yet to try out any options. I thought I'd use TortoiseHg as a basis, and it does not have the TortoiseHg binaries in the repository although it does have some binaries such as kdiff3.exe. Instead it uses setup.py to clone multiple repositories and build the apps. This seems reasonable for OSS, but not so much for corporate environments. Recommendations?

    Read the article

  • Autocomplete Error Question - Ruby on Rails

    - by bgadoci
    I have built a very simple blog application using Ruby on Rails. New to both Ruby and Rails so excuse the stupid questions. I currently have two tables that relate to this question. I have a Post table and a Tag table. Basically I set it up such that Post has_many :tags and Tag belongs_to :post. I am using AJAX to process and display the tags in the show view of the post. I installed the auto_complete plugin and I am getting an error when I enter the letters in the text_field_with_auto_complete for tag creation. My suspicion is this is because the form is a remote_form_for or something I am doing wrong in the routes.rb. Here is the error and code: Error Processing PostsController#show (for 127.0.0.1 at 2010-04-13 23:25:46) [GET] Parameters: {"tag"=>{"tag_name"=>"f"}, "id"=>"auto_complete_for_tag_tag_name"} Post Load (0.1ms) SELECT * FROM "posts" WHERE ("posts"."id" = 0) ActiveRecord::RecordNotFound (Couldn't find Post with ID=auto_complete_for_tag_tag_name): app/controllers/posts_controller.rb:22:in `show' Rendered rescues/_trace (26.0ms) Rendered rescues/_request_and_response (0.2ms) Rendering rescues/layout (not_found) remote_form_for located in /views/posts/show.html.erb <% remote_form_for [@post, Tag.new] do |f| %> <p> <%= f.label :tag_name, "Tag" %><br/> <%= text_field_with_auto_complete :tag, :tag_name, {}, {:method => :get} %> </p> <p><%= f.submit "Add Comment" %></p> <% end %> tags_controller.rb (I'll spare you all the actions but added the following here) auto_complete_for :tag, :tag_name routes.rb map.resources :posts, :has_many => :comments map.resources :posts, :has_many => :tags map.resources :tags, :collection => {:auto_complete_for_tag_tag_name => :get }

    Read the article

  • How does Ubuntu LVM encryption work?

    - by Sridhar Ratnakumar
    While installing Ubuntu Server, during the partition step one of the options is "use entire disk and set up encrypted LVM" (see screenshots). Can anyone explain how it works under the hood? What kind of tools/technologies/algorithms are used? How exactly does this possibly prevent thieves from getting access to the data in the hard disk?

    Read the article

  • pass by reference but reference to data and not to variable

    - by dorelal
    This is psesudo code. In what programming language this is possible ? def lab(input) input = ['90'] end x = ['80'] lab(x) puts x #=> value of x has changed from ['80'] to ['90] I have written this in ruby but in ruby I get the final x value of 80 because ruby is pass-by-reference. However what is passed is the reference to the data held by x and not pointer to x itself same is true in JavaScript. So I am wondering if there is any programming language where the following is true.

    Read the article

  • How do a search a table for similar records and displaying count - Ruby on Rails

    - by bgadoci
    I have created a table in my Ruby on Rails application that I am building called Tags. It is a blog application so I allow the user to associate tags with a post and do this through a :posts, :has_many = tags and Tag belongs_to :post association. Now that I have my Tags table I am trying to see how I would render the view such that it displays the tag and tag count. (it should be noted that I am trying to render this in the /views/posts/index.html.erb file). For instance, if there are 10 entries in the Tag table for tag_name Sports. How can I display Sports (10) in the view. I am not looking to do this for a specific tag but rather, somehow search the table, combine like tags and display a list of all tags with counts next to them. (I really want these to be a link to a list of posts that contain that tag but I learned early on only to ask one question at a time). Hope that makes sense.

    Read the article

  • My image gallery (slider) stopped working

    - by Mabel
    Hi, I am using the Florance theme and it comes with a sliding image gallery using jquery and jcarousellite. Somehow it stopped working (it was ok 2 days) and error points to the script. The site in question is www.happystay.net Please, i need some help. Thanks in advance.

    Read the article

  • Is it wrong to get feedback from Stack Overflow on a live system architecture?

    - by hal10001
    I am the technical director at a startup, and I will eventually be tasked with implementing a "real" system architecture when we hire more programmers. Right now our clients are small enough, and it is just me, so documented deployments, source control, unit tests and quality assurance servers are non-existent. Eventually I will need to devise a work-flow and architecture patterns for the majority of the work we will do (e-commerce). If I posted an architecture diagram, and asked for feedback, would that be a misuse of the Stack Overflow system? I don't want to get into that battle of "hey, don't ask us to do your job for you", but the reality is that any programmer who eventually moves into this realm will have to figure it out with feedback from other developers. HighScalability.com is what comes to mind when I think about this sorta thing in terms of the knowledge I need. So if this is not the right kind of forum for that, then any book recommendations or white papers you can recommend would be appreciated.

    Read the article

  • MVC2 ValidationSummary and Client side Validation

    - by Raj Aththanayake
    Hi I want to have the ValidationSummary errors displayed during Client Side validation. Currently the validation messages are only appears next to the field during client side validation. I use…. MicrosoftAjax.js MicrosoftMvcAjax.js MicrosoftMvcValidation.js as my client side libraries. There is a solution for jQuery Validation Library which is in the thread… http://stackoverflow.com/questions/1724790/asp-net-mvc-validationsummary-for-client-side-validation Is there an easy way to do this? I used had xVal working DataAnnotation and it was very easy enable client side validation for the validation summary. E.g <%= Html.ClientSideValidation().UseValidationSummary("validationSummary", “Validation Errors”)% Is there way to do this in MVC2 using MicrosoftAjax?

    Read the article

  • Copy App_GlobalResources on deployment

    - by richard
    Hello, I have an ASP.NET web application which was previously published using the Publish feature of VS2008. Recently I switched to "Web Deployment Projects" for VS2008. When deploying I noticed that the ~/App_GlobalResources directory is not copied to the release folder on build anymore. How can I make sure the App_GlobalResources directory is copied along?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >