C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




To write a Script in server side in Asp.net


Posted Date: 19 Mar 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms

Posted By: joypackiaraj       Member Level: Bronze
Rating:     Points: 5



To write a Scripts in server side in Asp.net we can use ScriptManager.RegisterStartupScript() method

If you give the script tag in the string s then give addScriptTags to false.
ScriptManager is a class inside System.Web.UI .

As a result a alert box with 'hello' pops up, where you place this line.



ScriptManager.RegisterStartupScript(Control control,type type,string Key,string Script,bool addScriptTags)

Example:

string s = "alert('Hello')";
ScriptManager.RegisterStartupScript(this, this.GetType(), "Hello", s, true);







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to Fill DropDownList with first Item as Select/All
Previous Resource: Reading a Web Page with HttpRequest in C#
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

teleconferencing service

Contact Us    Privacy Policy    Terms Of Use