Can we use the java script code in .Net Code behind?
Answers were Sorted based on User's Feedback
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 |
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 |
if i have a web page, and after the postback i dont to maintain the viewstate. How can we maintain in web application?
Features and disadvantages of dataset ?
4 Answers Interlink, Microsoft,
What is use of <% %> in asp.net?
when will garbage collector run?
Which is the namespace used to write error message in event Log File?
What is a proxy in web service?
Difference between Response.redirect vs server.transfer?
Why is it preferred to not use finalize for clean up?
How to retrieve data row by row from a DataTable? Thanks In advance PriyaPP
Details on web.config and global.asax - just explain what are the sections will be there.
What is difference between asp state management and asp.net state management? How can we pass info between 2 asp.net pages?
what is the difference between this.controls and page.form1.controls and me.controls?