how to execute javascript function in code behind
-
Friends In my code i want to execute my javascript function in such a way ... Button1_Click(....) { ................... .................. ..Some code in C#.. .................. ................. ..javascript Funtion... } I am unable to do this plz help me
Deepak Nigam
-
Friends In my code i want to execute my javascript function in such a way ... Button1_Click(....) { ................... .................. ..Some code in C#.. .................. ................. ..javascript Funtion... } I am unable to do this plz help me
Deepak Nigam
u can use page.clienscript.registerstartup("me.gettype","some name","javascript function name",true)
-
Friends In my code i want to execute my javascript function in such a way ... Button1_Click(....) { ................... .................. ..Some code in C#.. .................. ................. ..javascript Funtion... } I am unable to do this plz help me
Deepak Nigam
deepaknigam11 wrote:
In my code i want to execute my javascript function
You can't execute a JS function from server. JS works on the client browser. You can send JS scripts to the response which will be registered to the rendered page. Use
ClientScriptManager.RegisterStartupScript()
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
deepaknigam11 wrote:
In my code i want to execute my javascript function
You can't execute a JS function from server. JS works on the client browser. You can send JS scripts to the response which will be registered to the rendered page. Use
ClientScriptManager.RegisterStartupScript()
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
Thanks In my application i am generatind some id by the C# code and now i have to pass this value to tha javascript funtion. this all code occour on a single button click.. Now wht to do.... When i am trying to execute both the code javascript code executes first and C# code comes letter..that is wht i don't want... What can i do now... Halp me...........
Deepak Nigam
-
Thanks In my application i am generatind some id by the C# code and now i have to pass this value to tha javascript funtion. this all code occour on a single button click.. Now wht to do.... When i am trying to execute both the code javascript code executes first and C# code comes letter..that is wht i don't want... What can i do now... Halp me...........
Deepak Nigam
You can't change this. Tell me what you are trying to do. What you are doing in JS after a server side processing ? Are you trying to show some alerts ?
deepaknigam11 wrote:
C# code and now i have to pass this value to tha javascript funtion.
You can declare a public variable in the code behind and can be accessed in JS like this
var a = <%= publicVariableName; %>
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
You can't change this. Tell me what you are trying to do. What you are doing in JS after a server side processing ? Are you trying to show some alerts ?
deepaknigam11 wrote:
C# code and now i have to pass this value to tha javascript funtion.
You can declare a public variable in the code behind and can be accessed in JS like this
var a = <%= publicVariableName; %>
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
hi navaneeth can we use like this ClientScriptManager.RegisterStartupScript(me.gettype,"some name","javascript function name",true) is this syntax is correct..
-
Friends In my code i want to execute my javascript function in such a way ... Button1_Click(....) { ................... .................. ..Some code in C#.. .................. ................. ..javascript Funtion... } I am unable to do this plz help me
Deepak Nigam
ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "onClick", "try{hidedg();}catch(ex){}", true);
Best Regards, Trishul Tandel Software Developer
-
You can't change this. Tell me what you are trying to do. What you are doing in JS after a server side processing ? Are you trying to show some alerts ?
deepaknigam11 wrote:
C# code and now i have to pass this value to tha javascript funtion.
You can declare a public variable in the code behind and can be accessed in JS like this
var a = <%= publicVariableName; %>
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
Hi Navaneeth In my application i am generating a random name that i have assigned to an image. now through javascript i want to access this name in the clipboard....... So that he/she can paste it whereevrhe wishes. I am unable to get it as javascript code executes before the name generated......
Deepak Nigam