Can we use the java script code in .Net Code behind?

Answers were Sorted based on User's Feedback



Can we use the java script code in .Net Code behind?..

Answer / zikku

yes we can use javascript in code behind.


Define the script block that contains the JavaScript
function. You can add this directly to the HTML of the page.


Insert the script block by the
Page.RegisterStartupScript() or the
Page.RegisterClientScriptBlock() method.

or by using updatepanel by raising an async postback using
JavaScript code

Is This Answer Correct ?    10 Yes 0 No

Can we use the java script code in .Net Code behind?..

Answer / mupnesh

yes we can use java script code.

Is This Answer Correct ?    1 Yes 0 No

Can we use the java script code in .Net Code behind?..

Answer / guest

yes

Is This Answer Correct ?    2 Yes 1 No

Can we use the java script code in .Net Code behind?..

Answer / raj

yes we can use java script code in .Net in code behind

suppose we have a validation on button click event based on id
button1
then

button1.attributes.add("OnClick",retun functionname);

Is This Answer Correct ?    1 Yes 1 No

Can we use the java script code in .Net Code behind?..

Answer / satish v itagi

I have made use of scripts in code behind. My client
wanted cursor to move from one web ui control to another in
a specific order based on the data fed/selected by user.
For eg. after entering specific word in a textbox, cursor
has to focus on save button bypassing all other ui
controls; if another specific word is entered focus should
jump on third ui control skipping the second, so on and so
forth.

User got delighted when the facility was given.

Another case where I implemented was to focus to next
control even after a post back event (otherwise smart
navigation returns focus to the same control after a post
back and use has to press tab key again to set focus to
next ui control).

This facility made my clients again happy.

Of course, it is more worthy to earn clients delight than
weighty pay packet!!!

Ofcourse, I used Page.RegisterStartupScript() and the
Page.RegisterClientScriptBlock() methods!

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

Explain about the .NET framework?

0 Answers  


How to create a db connection at one place/page so that we can use that connection for all pages/forms/windows.what r the steps ned to be performed if question not clear,let me know

0 Answers  


Difference between response.redirect and server.transfer?

0 Answers  


Distinguish between Server-side and Client-side code with its functionality?

0 Answers   Siebel,


What is virtual directory in asp.net?

0 Answers  


Why cyclomatic complexity is important?

0 Answers  


how to stop cookie in particular page using asp.net

2 Answers   CGI,


Explain what is event bubbling?

0 Answers  


How could you modify xaml content from javascript?

0 Answers  


I am having four text boxes in my web application. I am setting Required Field validator to each Text box. And I am having two buttons in my application. If i clicked the first button only first two text box validation will get fire. Dont show error message for remaining two text box. If i clicked second button last two text box validation will get fired. It will not consider the first two validation controls. That is how to enable and disable the validation controls.

4 Answers  


How ViewstateMac works?

0 Answers   CGI,


What is the difference between localization and globalization?

0 Answers  


Categories