Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 13th, 2005, 07:57 AM
Authorized User
 
Join Date: Feb 2004
Location: Rawalpindi, Punjab, Pakistan.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sajid_pk Send a message via Yahoo to sajid_pk
Default Writing Client side script in code-behind asp.net

Hi,

Could anyone know how can we place client side script in Code-behind ASP .NET at our own place of choice in HTML page. Microsoft gave RegisterClientScriptBlock and RegisterStartupScript methods but they write code at start and end of form tags. How can we write client side script at our own choice of place in HTML form. (not at start or end of <form> tag). Is there any method of doing that.

Thanks.
  #2 (permalink)  
Old February 11th, 2005, 04:22 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Yes there is one way.You can use StringBuilder to create the script.
(eg)
StringBuilder strB= new StringBuilder();
strB.Append("<script language='javascript'>");
strB.Append("alert('hi')");
strB.Append("</script>");

and use strB variable in aspx file using Server Side script block.




Similar Threads
Thread Thread Starter Forum Replies Last Post
In ASP,Client side javaScript code casimir Classic ASP XML 0 October 24th, 2005 12:24 AM
How to add client-side script to an ASP button BrianWren VB.NET 1 March 30th, 2005 05:27 PM
Writing Client Side Script from Code-Behind code sajid_pk Classic ASP Databases 1 January 18th, 2005 12:53 AM
Writing client side script in code-behind asp.net sajid_pk ADO.NET 1 January 13th, 2005 08:12 AM
writing client-side script in code-behind asp .net sajid_pk General .NET 1 January 13th, 2005 08:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.