0

1) I'm having an javascript control created with HTML5 and showing it with div.

<div id="<%=this.ClientID%>" style="z-index:100;"></div>

The control has a method init() to which I need to pass parameters from code behind; in order to initialize it. So this is how I'm doing it:

string script2 = String.Format("<%=this.ClientID%>.init({0},{1})", param1, param2);

this.Page.ClientScript.RegisterStartupScript(this.GetType(), "initialize control", script2, true);

Is this the right way?

2) What's the difference between setting parameter as {1} and '{1}'?

1 Answer 1

1

a parameter constructed within '' is considered as a string and parameter without '' is considered an object.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.