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
Old August 18th, 2008, 11:43 PM
Registered User
Join Date: Mar 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Migration - Rendering ASP code

Hi all,

I am migrating an application from classic Asp to Asp.net. The application reads the information from a file and renders it *Dynamically* to the browser. I am not able to render the
<input name=""Name1"" type=text value='<%=Somefunction(a,b)%>'>

Though I write the Somefunction in code behind it does not get called. I am writing like this..

        Dim s As String = Server.HtmlDecode("<input name=""Name1"" type=text value='<%=Somefunction(a,b)%>'>")

Am I missing something. Or what is the best approach to achieve this.
Any help is appreciated. Thankyou.

When I write it statically like below, the function is getting called.
<input name="Name" type=text value="'<%=Somefunction("a","b")%>'">
Old August 19th, 2008, 08:07 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

You should convert all your hard coded form control HTML into appropriate server controls. So for your example you should use this:

<asp:textbox id="Name" />

Then in the appropriate place in code behind, put this:

Name.Text = Somefunction("a", "b")

It sounds like you might want to take a look at a introductory ASP.NET book.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser Rendering akkad Javascript How-To 2 December 31st, 2006 03:58 AM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
ASP.NET controls & Mozilla: Rendering Problems hgberman ASP.NET 1.0 and 1.1 Basics 6 February 3rd, 2006 06:41 PM
Migration .Net from ASP/VB Bans.Net ASP.NET 1.x and 2.0 Application Design 7 September 26th, 2004 04:20 PM

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