Create JavaScript From Code Behind

After You Create your JavaScript String In The Code Behind  go to the page load event and this to register the JavaScript to your page

Page.RegisterStartupScript("ScriptString", ScriptString);

 

as I said in my last post some times the id you assign for a control is not always the actual id given to it on the client side

so if you are making JavaScript and using controls id make sure to use control.ID

To change an html

document['docimagename'].src = '/images/imagename.gif'

docimagename is the name attribute of the image

Hide Control

document.getElementById('ControlID').style.visibility = 'hidden';

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
TAGS:  , , ,

 

View Abdel-Rahman Awad's profile on LinkedIn

Archives

 

Rss Feed Tweeter button Facebook button Linkedin button Delicious button Digg button