Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
QuestionStartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 0:25
Piratenwichtl20009-Oct-08 0:25 
AnswerRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
S. Senthil Kumar9-Oct-08 3:53
S. Senthil Kumar9-Oct-08 3:53 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 4:10
Piratenwichtl20009-Oct-08 4:10 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
S. Senthil Kumar9-Oct-08 4:51
S. Senthil Kumar9-Oct-08 4:51 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 6:30
Piratenwichtl20009-Oct-08 6:30 
QuestionAccess C# Variable in to java Script Function Pin
mharoonkhan8-Oct-08 23:48
mharoonkhan8-Oct-08 23:48 
AnswerRe: Access C# Variable in to java Script Function Pin
SeMartens9-Oct-08 0:20
SeMartens9-Oct-08 0:20 
AnswerRe: Access C# Variable in to java Script Function Pin
vijaiganesh9-Oct-08 0:37
vijaiganesh9-Oct-08 0:37 
Or You can try this... by using RegisterStartupScript and pass the variable value from the code.

public void Page_Load(Object sender, EventArgs e)
{
// Define the name and type of the client scripts on the page.
String yourVariable = "yourVariable";
String csname1 = "PopupScript";
String csname2 = "ButtonClickScript";
Type cstype = this.GetType();

// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;

// Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname1))
{
String cstext1 = "alert('Hello World');";
cs.RegisterStartupScript(cstype, csname1, cstext1, true);
}

// Check to see if the client script is already registered.
if (!cs.IsClientScriptBlockRegistered(cstype, csname2))
{
StringBuilder cstext2 = new StringBuilder();
cstext2.Append("script type=text/javascript; function DoClick(");
cstext2.Append(yourVariable);
cstext2.Append(") {");
cstext2.Append("Form1.Message.value='Text from client script.'} </");
cstext2.Append("script>");
cs.RegisterClientScriptBlock(cstype, csname2, cstext2.ToString(), false);
}
}

I hope this helps...

Cheers
vj
AnswerRe: Access C# Variable in to java Script Function Pin
Ennis Ray Lynch, Jr.9-Oct-08 3:16
Ennis Ray Lynch, Jr.9-Oct-08 3:16 
Questiondesign asynchronous interface Pin
George_George8-Oct-08 23:15
George_George8-Oct-08 23:15 
AnswerRe: design asynchronous interface Pin
Simon P Stevens9-Oct-08 3:17
Simon P Stevens9-Oct-08 3:17 
GeneralRe: design asynchronous interface Pin
George_George10-Oct-08 22:57
George_George10-Oct-08 22:57 
GeneralRe: design asynchronous interface Pin
nelsonpaixao9-Oct-08 13:49
nelsonpaixao9-Oct-08 13:49 
GeneralRe: design asynchronous interface Pin
George_George9-Oct-08 22:34
George_George9-Oct-08 22:34 
GeneralRe: design asynchronous interface Pin
nelsonpaixao10-Oct-08 13:09
nelsonpaixao10-Oct-08 13:09 
GeneralRe: design asynchronous interface Pin
George_George10-Oct-08 22:59
George_George10-Oct-08 22:59 
QuestionA potentially dangerous Request.QueryString value was detected from the client (ReturnUrl="...1111&amp;#Write"). [modified] Pin
mimimimilaw8-Oct-08 23:05
mimimimilaw8-Oct-08 23:05 
AnswerRe: A potentially dangerous Request.QueryString value was detected from the client (ReturnUrl="...1111&amp;#Write"). Pin
Guffa8-Oct-08 23:52
Guffa8-Oct-08 23:52 
AnswerRe: A potentially dangerous Request.QueryString value was detected from the client (ReturnUrl="...1111&#Write"). Pin
JendaPerl18-Aug-10 23:22
JendaPerl18-Aug-10 23:22 
QuestionGet Element of Generic List Pin
ezazazel8-Oct-08 21:21
ezazazel8-Oct-08 21:21 
AnswerRe: Get Element of Generic List Pin
Simon P Stevens8-Oct-08 23:01
Simon P Stevens8-Oct-08 23:01 
AnswerRe: Get Element of Generic List Pin
#realJSOP8-Oct-08 23:34
professional#realJSOP8-Oct-08 23:34 
GeneralRe: Get Element of Generic List Pin
ezazazel9-Oct-08 2:16
ezazazel9-Oct-08 2:16 
AnswerRe: Get Element of Generic List Pin
J4amieC9-Oct-08 0:42
J4amieC9-Oct-08 0:42 
GeneralRe: Get Element of Generic List Pin
ezazazel9-Oct-08 2:08
ezazazel9-Oct-08 2:08 

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.