Click here to Skip to main content
15,909,827 members
Home / Discussions / C#
   

C#

 
GeneralRe: Embedding Excel in Windows Forms Pin
Giorgi Dalakishvili10-Dec-08 6:23
mentorGiorgi Dalakishvili10-Dec-08 6:23 
QuestionThe "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
hdv2128-Dec-08 7:35
hdv2128-Dec-08 7:35 
AnswerRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
Colin Angus Mackay8-Dec-08 8:03
Colin Angus Mackay8-Dec-08 8:03 
AnswerRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
Mark Salsbery8-Dec-08 8:52
Mark Salsbery8-Dec-08 8:52 
AnswerRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
Nissim Salomon8-Dec-08 9:00
Nissim Salomon8-Dec-08 9:00 
GeneralRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
hdv2128-Dec-08 9:08
hdv2128-Dec-08 9:08 
Questionmethod inheretance Pin
Deresen8-Dec-08 6:29
Deresen8-Dec-08 6:29 
AnswerRe: method inheretance Pin
Alan Balkany8-Dec-08 8:11
Alan Balkany8-Dec-08 8:11 
GeneralRe: method inheretance Pin
Deresen8-Dec-08 8:25
Deresen8-Dec-08 8:25 
GeneralRe: method inheretance Pin
Alan Balkany8-Dec-08 8:32
Alan Balkany8-Dec-08 8:32 
GeneralRe: method inheretance Pin
Deresen8-Dec-08 9:14
Deresen8-Dec-08 9:14 
GeneralRe: method inheretance Pin
Alan Balkany8-Dec-08 9:40
Alan Balkany8-Dec-08 9:40 
GeneralRe: method inheretance Pin
Ben Fair8-Dec-08 10:34
Ben Fair8-Dec-08 10:34 
GeneralRe: method inheretance Pin
Deresen8-Dec-08 10:51
Deresen8-Dec-08 10:51 
QuestionHow to verify existing and Installed components via code Pin
Eitan O8-Dec-08 6:09
Eitan O8-Dec-08 6:09 
QuestionUsing double quotes in a string Pin
compninja258-Dec-08 5:51
compninja258-Dec-08 5:51 
AnswerRe: Using double quotes in a string Pin
J4amieC8-Dec-08 5:57
J4amieC8-Dec-08 5:57 
GeneralRe: Using double quotes in a string Pin
Vikram A Punathambekar8-Dec-08 19:17
Vikram A Punathambekar8-Dec-08 19:17 
AnswerRe: Using double quotes in a string Pin
Deresen8-Dec-08 6:36
Deresen8-Dec-08 6:36 
GeneralRe: Using double quotes in a string Pin
Giorgi Dalakishvili8-Dec-08 7:10
mentorGiorgi Dalakishvili8-Dec-08 7:10 
AnswerRe: Using double quotes in a string Pin
cor28798-Dec-08 7:22
cor28798-Dec-08 7:22 
I do a lot of dynamically created JavaScript in my ASP.Net development. I use a pattern similar to this:

protected void Page_PreRender(object sender, EventArgs e)
{
	/* Call your method that registers JavaScript from here.  This event is called even if
	 * you only have a Call Back rather than a Post Back
	 */
	 
	 RegisterClientScript();
}

// This method contains any dynamic JavaScript that I wish to register on the page
protected void RegisterClientScript()
{
	// Check first to see if the page has already had the Javascript code registered.
	if (!(Page.ClientScript.IsStartupScriptRegistered("myJS"))
	{
		// Use a string builder to, well, build the string.  This limits the number of immutable strings that are added to memory and must
		// be eventually garbage collected.
		StringBuilder js = new StringBuilder();
		
		// Build the JavaScript code.  Note that inside the string we are actually using single quotes - this is legal in JavaScript for strings. 
		// In this way you don't even have to mess with escape characters.  At least not as often - there may still be occasions where you will
		// need single quotes.
		js.AppendLine("TargetDate = 'friday';");
		js.AppendLine("BackColor = 'palegreen';");
		js.AppendLine("ForeColor = 'navy';");
		js.AppendLine("CountActive = true;");
		js.AppendLine("CountStepper = -1;");
		js.AppendLine("LeadingZero = true;");
		js.AppendLine("DisplayFormat = '%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.';");
		js.AppendLine("FinishMessage = 'It is finally FRIDAY!'");
		
		/* Call the register startup script method.  This will call the above script to execute when the page renders.  The first parameter is any instance of the
		  * System.Type class, but usually you want to pass the type of this Page or Control.  Next is the key, then the JavaScript string itself.  The last boolean value
		  * specifies whether or not script tags should be added to the JavaScript code.  You can add them yourself or just do as I did and have the RegisterClientScript method
		  * do this for you.  To me this way is cleaner.
		  */
		Page.ClientScript.RegisterStartupScript(this.GetType(), "myJS", js.ToString(), true);
	}
}


"We are men of action; lies do not become us."

GeneralRe: Using double quotes in a string Pin
compninja258-Dec-08 8:59
compninja258-Dec-08 8:59 
QuestionIs there any solution to run PowerShell 1.0 in C# remotely? Pin
Julia10058-Dec-08 5:38
Julia10058-Dec-08 5:38 
QuestionDataset.ReadXML Pin
ndroo8828-Dec-08 4:14
ndroo8828-Dec-08 4:14 
AnswerRe: Dataset.ReadXML Pin
ndroo8829-Dec-08 2:21
ndroo8829-Dec-08 2:21 

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.