Click here to Skip to main content
15,914,209 members
Home / Discussions / C#
   

C#

 
QuestionRe: make a new object in an event! Pin
pcsience6-May-09 5:37
pcsience6-May-09 5:37 
AnswerRe: make a new object in an event! Pin
musefan6-May-09 5:49
musefan6-May-09 5:49 
QuestionRe: make a new object in an event! Pin
pcsience6-May-09 7:55
pcsience6-May-09 7:55 
AnswerRe: make a new object in an event! Pin
Henry Minute6-May-09 9:06
Henry Minute6-May-09 9:06 
QuestionRe: make a new object in an event! Pin
pcsience6-May-09 11:38
pcsience6-May-09 11:38 
AnswerRe: make a new object in an event! Pin
Henry Minute6-May-09 12:01
Henry Minute6-May-09 12:01 
GeneralRe: make a new object in an event! Pin
pcsience9-May-09 2:29
pcsience9-May-09 2:29 
QuestionCompositeDataBoundControl designer crashes VS2008 Pin
Andre Vianna6-May-09 4:40
Andre Vianna6-May-09 4:40 
I'm building a very simple composite control and when use the designer to select a data source it crashes Visual Studio 2008.

Here is the code:

namespace WebControlDesigner {
	[ToolboxData("<{0}:ControlWithTasks runat=\"server\"></{0}:ControlWithTasks>")]
	public class ControlWithTasks : CompositeDataBoundControl {
		
		public ControlWithTasks() : base() { }

		[Category("Apearance")]
		[DefaultValue("Your Birthday")]
		public string Prompt {
			get { return (string)ViewState["Prompt"] ?? "Your Birthday"; }
			set { ViewState["Prompt"] = value; }
		}

		[Category("Data")]
		[Bindable(true)]
		public DateTime Birthday {
			get { return (DateTime?)ViewState["Birthday"] ?? DateTime.Now; }
			set { ViewState["Birthday"] = value; }
		}

		protected override int CreateChildControls(IEnumerable pDataSource, bool pBinding) {
			base.CreateChildControls();

			Label vLabel = new Label();
			vLabel.Text = Prompt;
			vLabel.ForeColor = Color.Red;
			this.Controls.Add(vLabel);

			Literal vLiteral = new Literal();
			vLiteral.Text = ":&nbsp;";
			this.Controls.Add(vLiteral);

			TextBox vTextBox = new TextBox();
			vTextBox.ID = "TextBox1";
			vTextBox.Text = Birthday.ToString();
			this.Controls.Add(vTextBox);

			return 0;
		}
	}
}


It's an extremely simple control, and builds without error.
Here is the page that consumes it:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="WebControlDesigner" Namespace="WebControlDesigner" TagPrefix="wcd" %>
<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
		<wcd:ControlWithTasks ID="ControlWithTasks1" runat="server">
		</wcd:ControlWithTasks>
	</div>
    </form>
</body>
</html>


It renders perfectly and display the designer menu correctly but if I create a data source or try to select a existing one it crashes VS2008. OMG | :OMG: Confused | :confused:
What is missing?
Please!! I need some help.
Questionproblem in C# Pin
kakarman6-May-09 4:26
kakarman6-May-09 4:26 
AnswerRe: problem in C# Pin
musefan6-May-09 4:29
musefan6-May-09 4:29 
AnswerRe: problem in C# Pin
led mike6-May-09 4:37
led mike6-May-09 4:37 
AnswerRe: problem in C# Pin
Luc Pattyn6-May-09 4:38
sitebuilderLuc Pattyn6-May-09 4:38 
QuestionCrystal report binding Pin
KIDYA6-May-09 3:31
KIDYA6-May-09 3:31 
QuestionHTK Pin
dileeparuwan6-May-09 3:25
dileeparuwan6-May-09 3:25 
QuestionUsing Cell Phone as a PC Microphone in using in the hand 32feet Pin
Ami Vaknin6-May-09 3:21
Ami Vaknin6-May-09 3:21 
AnswerRe: Using Cell Phone as a PC Microphone in using in the hand 32feet Pin
Henry Minute6-May-09 6:21
Henry Minute6-May-09 6:21 
GeneralRe: Using Cell Phone as a PC Microphone in using in the hand 32feet Pin
Ami Vaknin6-May-09 11:16
Ami Vaknin6-May-09 11:16 
QuestionOut of Memory exception.. Pin
Jacob Dixon6-May-09 3:16
Jacob Dixon6-May-09 3:16 
AnswerRe: Out of Memory exception.. Pin
S. Senthil Kumar6-May-09 9:09
S. Senthil Kumar6-May-09 9:09 
GeneralRe: Out of Memory exception.. Pin
Jacob Dixon6-May-09 10:18
Jacob Dixon6-May-09 10:18 
GeneralRe: Out of Memory exception.. Pin
S. Senthil Kumar6-May-09 10:25
S. Senthil Kumar6-May-09 10:25 
QuestionReading large xls files in C# Pin
aastudent6-May-09 3:08
aastudent6-May-09 3:08 
AnswerRe: Reading large xls files in C# Pin
foluis26-Mar-10 11:16
foluis26-Mar-10 11:16 
GeneralRe: Reading large xls files in C# Pin
aastudent28-Mar-10 21:47
aastudent28-Mar-10 21:47 
GeneralRe: Reading large xls files in C# Pin
foluis29-Mar-10 8:22
foluis29-Mar-10 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.