Daily Archives

Articles indexed Wednesday May 19 2010

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

  • the name 'controlname' does not exist in the current context

    - by zohair
    Hi, I have a web application that I'm working on(ASP.NET2.0 with C#)[Using VS2005]. Everything was working fine, and all of a sudden I get the error: Error 1 The name 'Label1' does not exist in the current context and 43 others of the sort for each time that I used a control in my codebehind of the page. This is only happening for 1 page. And it's as if the codebehind isn't recognizing the controls. Another interesting thing is that the intellisense isn't picking up any of the controls either.. I have tried to clean the solution file, delete the obj file, exclude the files from the project then re-add them, close VS and restart it, and even restart my computer, but none of these have worked. Please Help. Thank you

    Read the article

  • Two-way databinding of a custom templated asp.net control

    - by Jason
    I hate long code snippets and I'm sorry about this one, but it turns out that this asp.net stuff can't get much shorter and it's so specific that I haven't been able to generalize it without a full code listing. I just want simple two-way, declarative, edit-only databinding to a single instance of an object. Not a list of objects of a type with a bunch of NotImplementedExceptions for Add, Delete, and Select, but just a single view-state persisted object. This is certainly something that can be done but I've struggled with an implementation for years. This newest, closest implementation was inspired by this article from 4-Guys-From-Rolla. Unfortunately, after implementing, I'm getting the following error and I don't know what I'm missing: System.InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. If I don't use Bind(), and only use Eval() functionality, it works. In that way, the error is especially confusing. Update: Actually, using Eval() does NOT work, but using <%# Container.SampleString %> works. However, Eval("SampleString") gives the same error. That leads me back to this article I found earlier but had discarded. Now I believe it might be related, though I haven't cracked it yet ... Here's the simplified codeset that still produces the error: using System.ComponentModel; namespace System.Web.UI.WebControls.Special { public class SampleFormData { public string SampleString = "Sample String Data"; public int SampleInt = -1; } [ToolboxItem(false)] public class SampleSpecificFormDataContainer : DataBoundControl, INamingContainer { SampleSpecificEntryForm entryForm; internal SampleSpecificEntryForm EntryForm { get { return entryForm; } } [Bindable(true), Category("Data")] public string SampleString { get { return entryForm.FormData.SampleString; } set { entryForm.FormData.SampleString = value; } } [Bindable(true), Category("Data")] public int SampleInt { get { return entryForm.FormData.SampleInt; } set { entryForm.FormData.SampleInt = value; } } internal SampleSpecificFormDataContainer(SampleSpecificEntryForm entryForm) { this.entryForm = entryForm; } } public class SampleSpecificEntryForm : WebControl, INamingContainer { #region Template private IBindableTemplate formTemplate = null; [Browsable(false), DefaultValue(null), TemplateContainer(typeof(SampleSpecificFormDataContainer), ComponentModel.BindingDirection.TwoWay), PersistenceMode(PersistenceMode.InnerProperty)] public virtual IBindableTemplate FormTemplate { get { return formTemplate; } set { formTemplate = value; } } #endregion #region Viewstate SampleFormData FormDataVS { get { return (ViewState["FormData"] as SampleFormData) ?? new SampleFormData(); } set { ViewState["FormData"] = value; SaveViewState(); } } #endregion public override ControlCollection Controls { get { EnsureChildControls(); return base.Controls; } } private SampleSpecificFormDataContainer formDataContainer = null; [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public SampleSpecificFormDataContainer FormDataContainer { get { EnsureChildControls(); return formDataContainer; } } [Bindable(true), Browsable(false)] public SampleFormData FormData { get { return FormDataVS; } set { FormDataVS = value; } } protected override void CreateChildControls() { if (!this.ChildControlsCreated) { Controls.Clear(); formDataContainer = new SampleSpecificFormDataContainer(this); Controls.Add(formDataContainer); FormTemplate.InstantiateIn(formDataContainer); this.ChildControlsCreated = true; } } public override void DataBind() { CreateChildControls(); base.DataBind(); } } } With an ASP.NET page the following: <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default2.aspx.cs" Inherits="EntryFormTest._Default2" EnableEventValidation="false" %> <%@ Register Assembly="EntryForm" Namespace="System.Web.UI.WebControls.Special" TagPrefix="cc1" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> Welcome to ASP.NET! </h2> <cc1:SampleSpecificEntryForm ID="EntryForm1" runat="server"> <FormTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SampleString") %>'></asp:TextBox><br /> <h3>(<%# Container.SampleString %>)</h3><br /> <asp:Button ID="Button1" runat="server" Text="Button" /> </FormTemplate> </cc1:SampleSpecificEntryForm> </asp:Content> Default2.aspx.cs using System; namespace EntryFormTest { public partial class _Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { EntryForm1.DataBind(); } } } Thanks for any help!

    Read the article

  • Flex AdvanceDatagrid

    - by udara
    What is the difference between normal datagrid and advance datagrid.Sorting,draging columns,resizing columns are supported even in normal datagrid. I want to add footer details like summery,average etc of each column,does AdvanceDataGrid supports these features?

    Read the article

  • VMware Fusion disk size

    - by churnd
    I have a Windows XP x64 install in VMware Fusion. The amount of space that the VM reports as used (C:) is ~20GB. However, the amount of space the VM is taking up on my disk is 30GB. Why the inconsistency? I do not have autoprotect enabled, nor do I have any snapshots I'm aware of. I have defragmented the drive and used Drive Cleanup from the VMware settings.

    Read the article

  • jquery slider control issue

    - by Geetha
    Hi All, I am using slider control to create a progress bar for media player. Problem: the max value and slider size is not matching. The video get complete before it reaches the end of the slider. Code: <script type="text/javascript" src="js/jquery.ui.core.js"></script> <script type="text/javascript" src="js/jquery.ui.slider.js"></script> <link type="text/css" href="CSS/demos.css" rel="stylesheet" /> <link type="text/css" href="CSS/jquery-ui.css" rel="stylesheet" /> $('#slider-constraints').slider("value", 0); $('#slider-constraints').slider("constraints", [0, 0]); $("#slider-constraints").slider({ max: document.mediaPlayer.SelectionEnd, animate: true, range: $R(0, document.mediaPlayer.SelectionEnd), values:(0,document.mediaPlayer.SelectionEnd), value: val, enforceConstraints: false, slide: function(event, ui) { document.mediaPlayer.currentPosition = ui.value; $('#slider-constraints').slider("constraints", [0, ui.value]); $('#slider-constraints').slider("value", ui.value); }, start: function(event, index) { document.mediaPlayer.currentPosition = index.value; $('#slider-constraints').slider("constraints", [0, index.value]); $('#slider-constraints').slider("value", index.value); } }); } // Haldler position window.setInterval(function() { if (document.mediaPlayer.PlayState != 2 && document.mediaPlayer.PlayState == 0) { $('#slider-constraints').slider("constraints", [0, 0]); $('#slider-constraints').slider("value", 0); } else { $('#slider-constraints').slider("constraints", [0, document.mediaPlayer.currentPosition]); } }, 3000); // Progressbar position window.setInterval(function() { if (document.mediaPlayer.PlayState != 2 && document.mediaPlayer.PlayState == 0) { $('#slider-constraints').slider("constraints", [0, 0]); $('#slider-constraints').slider("value", 0); } else { $('#slider-constraints').slider("value", document.mediaPlayer.currentPosition); } }, 3000); } <div id="slider-constraints" >&nbsp;</div>

    Read the article

  • Recover a folder or file in TortoiseSVN whilst also retaining all history.

    - by Topdown
    In revision 1 a folder existed. In revision 2 the folder was accidently deleted and the change committed. We wish to roll back such that the folder is present, and retain its history. In the TortoiseSVN docs it indicates 'how' in the section titled "Getting a deleted file or folder back". To quote: Getting a deleted file or folder back If you have deleted a file or a folder and already committed that delete operation to the repository, then a normal TortoiseSVN - Revert can't bring it back anymore. But the file or folder is not lost at all. If you know the revision the file or folder got deleted (if you don't, use the log dialog to find out) open the repository browser and switch to that revision. Then select the file or folder you deleted, right-click and select [Context Menu] - [Copy to...] as the target for that copy operation select the path to your working copy. A switch retrieves the file into my working copy as one would expect, however there is no "Copy to" option on the context menu when I right click this working copy. If I open the repos browser, there is a copy to option, but it seems this simply takes a copy of the file. The solution I feel is to do a Branch/Tag, but if I try this from a prior revision to the same path in the repository SVN throws error that the path already exists. Therefore, how do I recover a folder/file in TortoiseSVN whilst also retaining all history. TortoiseSVN v1.6.8, Build 19260 - 32 Bit , Subversion 1.6.11,

    Read the article

  • Android Jar libraries

    - by Jeremy Edwards
    How do you setup a project that can result in a jar library file that can be used for android? I want to create a custom library across all projects. Few other questions: Does it need to be compiled against a specific version of android sdk? When an android package is compiled against a jar library does the classes necessary to work with the code get compiled with main code into the apk or does the entire jar get included? Any notable optimizations or pitfalls I need to know about with using a jar instead of integrating the code directly? Does the jar have to be signed like the apk needs to?

    Read the article

  • setContentView gives an exception

    - by sukitha
    I have a button and onClick it changes the contentView by setContentView (int layoutResID). It works fine. But if you take the focus to the button by the trackball(making it yellow) and tap on it, it gives the exception. java.lang.IllegalArgumentException: parameter must be a descendant of this view

    Read the article

  • Running a sharded DB from a single machine

    - by ming yeow
    This sounds kinda dumb, but I have a sharded DB that I no longer think I need to run on 2 machines, and would like to run on one single machine instead. Any ideas on how that can potentially be done? There are lots of resources on how i can achieve the converse, but very little on how this can be done

    Read the article

  • ASP.NET MVC Installer

    - by DanyW
    Hi everyone, We need to install ASP.NET MVC on several developers machines with VS2010. Unfortunately the only files I can find in the Microsoft Download Center are labelled as ASP.NET MVC installer for VS2008. Can someone please point me in the direction of installer for VS2010, or can the VS2008 one also work for VS2010? Thanks, Dany.

    Read the article

  • Fading in/Fade out text in IE

    - by tau
    I had a problem and whipped up a quick solution: fade-in and fade-out a series of quotations. My solution works just as I want it in every browser except any of the IEs. The only problem with the IEs is that the text does not fade in and fade out; the text simply pops into existence. I believe I've run into a similar problem before when trying to dynamically change the filter:alpha(opacity=xx) of an element. Any help is greatly appreciated! <html> <head> <style> .fadetext{ background:green; border:1px solid red; height:50px; width:500px; } .fadetext div{ background:yellow; } </style> <script type="text/javascript"> var CI_common = { C:function(cls,elm){ if(!elm) elm = document; if(document.getElementsByClassName){ return elm.getElementsByClassName(cls); }else{ var t = []; var o = elm.getElementsByTagName("*"); var r = new RegExp("(^|\\s)" + cls + "($|\\s)"); for(var i=0;i<o.length;i++){ if(o[i].className.match(r)) t.push(o[i]); } return t; } }, eventAdd:function(obj,evt,func){ if(obj.addEventListener){ obj.addEventListener(evt,func,false); }else if(obj.attachEvent){ obj["x" + evt + func] = func; obj[evt + func] = function(){ obj["x" + evt + func](window.event); } obj.attachEvent("on" + evt,obj[evt + func]); } } } var CI_fadetext = { init:function(){ var c = CI_common.C("fadetext"); // Simply a getElementsByClassName function for(var i=0;i<c.length;i++){ c[i].style.overflow = "hidden"; var kids = c[i].getElementsByTagName("div"); for(var j=0;j<kids.length;j++){ kids[j].style.display = "none"; kids[j].style.filter = "alpha(opacity=0)"; kids[j].style.opacity = "0"; (function(obj,index,len){ obj.fadetexttimeout = setTimeout(function(){ CI_fadetext.fade(obj,true); obj.fadeininterval = setInterval(function(){ CI_fadetext.fade(obj,true); },5000*len) },5000*index); setTimeout(function(){ CI_fadetext.fade(obj,false); obj.fadeoutinterval = setInterval(function(){ CI_fadetext.fade(obj,false); },5000*len) },5000*index+4400); })(kids[j],j,kids.length); } } }, fade:function(elm,dir){ function fade(start){ start = (dir ? start + 10 : start - 10); elm.style.filter = "alpha(opacity=" + start + ")"; elm.style.opacity = start/100; document.getElementById("output").innerHTML = elm.style.filter; if(start > 100 || start <0){ elm.style.display = (dir ? "" : "none"); elm.style.filter = "alpha(opacity=" + (dir ? 100 : 0) + ")"; elm.style.opacity = (dir ? 1 : 0); }else elm.fadetexttimeout = setTimeout(function(){fade(start);},50); } if(dir){ elm.style.display = ""; fade(0); }else fade(100); } } CI_common.eventAdd(window,"load",CI_fadetext.init); // Just a window.onload level 2 event listener </script> </head> <body> <div id="output"></div> <div class="fadetext"> <div>AAAA</div> <div>BBBB</div> <div>CCCC</div> <div>DDDD</div> <div>EEEE</div> </div> </body> </html>

    Read the article

  • NSDate & Memory management

    - by iFloh
    Hi, memory management still gives me grief. This time it is an NSDate iVar that I init using NSDate *myNSDate = [[NSDate date] firstDayOfMonth]; with a method call to - (NSDate *)firstDayOfMonth { NSDateComponents *tmpDateComponents = [[NSCalendar currentCalendar] components:NSYearCalendarUnit | NSMonthCalendarUnit | NSEraCalendarUnit | NSWeekCalendarUnit | NSWeekdayOrdinalCalendarUnit fromDate:self]; [tmpDateComponents setDay:1]; [tmpDateComponents setHour:0]; [tmpDateComponents setMinute:0]; [tmpDateComponents setSecond:0]; return [[NSCalendar currentCalendar] dateFromComponents:tmpDateComponents]; } At the end of the init call the retain count is at 1 (Note the iVar is not defined as a property). When I step into the viewWillAppear method the myNSDate has vanished. I tried to do an explicit retain on it, but that only lasts until I update the iVar using the above method again. I though - ok - I add the retain to the return of the function, but that makes the leak analyser throw up an error. What am I doing wrong?

    Read the article

  • getting userbase vote average and individual user's vote in the same query?

    - by Andrew Heath
    Here goes: T1 [id] [desc] 1 lovely 2 ugly 3 slender T2 [id] [userid] [vote] 1 1 3 1 2 5 1 3 2 2 1 1 2 2 4 2 3 4 In one query (if possible) I'd like to return: T1.id, T1.desc, AVG(T2.vote), T2.vote (for user viewing the page) I can get the first 3 items with: SELECT T1.id, T1.desc, AVG(T2.vote) FROM T1 LEFT JOIN T2 ON T1.id=T2.id GROUP BY T1.id and I can get the first, second, and fourth items with: SELECT T1.id, T1.desc, T2.vote FROM T1 LEFT JOIN T2 ON T1.id=T2.id WHERE T2.userid='1' GROUP BY T1.id but I'm at a loss as to how to get all four items in one query. I tried inserting a select as the fourth term: SELECT T1.id, T1.desc, AVG(T2.vote), (SELECT T2.vote FROM T2 WHERE T2.userid='1') AS userVote etc etc but I get an error that the select returns more than one row... Help? My reason for wanting to do this in one query instead of two is that I want to be able to sort the data within MySQL rather than one it's been split into a number of arrays.

    Read the article

  • Adjust size of MPMediaPickerController's view ?

    - by Mr.Gando
    In my application I don't use the upper bar that displays Wi-Fi/Date/Time because it's a game. However I need to be able to let my user to pick his music, so I'm using a MPMediaPickerController. The problem is, that when I present my controller, the controller ends up leaving a 10 pixels ( aprox ) bar at the top of the screen, just in the place the Wi-Fi/Date/Time bar, should be present. Is there a way I could make my MPMediaPickerController bigger ? or to be presented upper in the screen ? // Configures and displays the media item picker. - (void) showMediaPicker: (id) sender { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAnyAudio]; [[picker view] setFrame:CGRectMake(0, 0, 320, 480)]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; picker.prompt = NSLocalizedString (@"AddSongsPrompt", @"Prompt to user to choose some songs to play"); [self presentModalViewController:picker animated: YES]; [picker release]; } There I tried to set the size to 320x480 but no luck, the picker is still presented and leaves a space in the upper part of the screen, could anyone help me ? Btw, here's how it looks: I have asked a bit, and people told me this could indeed be a bug, what do you guys think ?

    Read the article

  • Clone MySQL DB - errors with CREATE VIEW/SHOW VIEW privileges

    - by user43537
    Running MySQL 5.0.32 on Debian 4.0 (Etch). I'm trying to clone a WordPress MySQL database completely (structure and data) on the same server. I tried a dump to an .sql file and an import into a new empty database from the command line, but the import fails with errors saying the user does not have the "SHOW VIEW" or "CREATE VIEW" privilege. Trying it with PHPMyAdmin doesn't work either. I also tried doing this with the MySQL root user (not named "root" though) and it shows an "Access Denied" error. I'm terribly confused as to where the problem is. Any pointers on cloning a MySQL DB and granting all privileges to a user account would be great (specifically for MySQL 5.0.32). Thanks!

    Read the article

  • do not use com.sun.xml.internal.*?

    - by sarah xia
    Hi all, Is this statement true: com.sun.xml.internal package is an internal package as the name suggestes. Users should not write code that depends on internal JDK implementation classes. Such classes are internal implementation details of the JDK and subject to change without notice One of my colleagues used one of the classes in his code, which caused javac task in Ant fail to compile our project as the compiler couldn't find the class. Answer from Sun/Oracle says that this is expected behavior of the compiler as user shouldn't use the package. Question is why the classes in the package made public in the first place? Thanks, Sarah

    Read the article

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