Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP 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 May 17th, 2005, 11:32 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic ASP button generation

I am trying to dynamically generate HTML content with VB in ASP.NET. Everything is wonderful except for the <asp:Button> which does not appear. I have read that I need to create an object and add it to the page. Sounds great except except I haven't found an example give me a more explicit idea of what to do. Any help would be greatly appreciated, code is included below.

"I'm stupid. You're smart. I was wrong. You were right. You're the best. I'm the worst. You're very good-looking. I'm not very attractive." - Happy Gilmore

<body bottomMargin="400" leftMargin="0" topMargin="0" onload="resizeTo(document.body.scrollWidth,documen t.body.scrollHeight)"
rightMargin="0" MS_POSITIONING="GridLayout">
   <%
   Dim Func As Integer
   Func = Request("Func")
   if Func <> 2 Then
        Func = 1
   End if
   Select Case Func
   Case 1
         Response.Write("<form runat='server' enctype='multipart/form-data' ID='Form1' ACTION='report.asp?func=2'>")
         Response.Write("<table align='center' cellspacing='2' cellpadding='2'>")
         Response.Write("<tr><td colspan='2'><H2>Report</H2></td></tr>")
         Response.Write("<tr><td>Main File</td><td><input type='file' runat='server' id='namefile' NAME='namefile' /></td></tr>")
         Response.Write("<tr><td>G1 File</td><td><input type='file' runat='server' id='g1file' NAME='g1file' /></td></tr>")
         Response.Write("<tr><td>I File</td><td><input type='file' runat='server' id='ifile' NAME='ifile' /></td></tr>")
         Response.Write("<tr><td>G2 File</td><td><input type='file' runat='server' id='g2file' NAME='g2file' /></td></tr>")
         Response.Write("<tr><td colspan='2' align='center'><asp:Button ID='cmdCheck' Text='Check' runat='server' OnClick='check' /><input type=""reset"" /></td></tr></table>")
         Response.Write("<asp:datagrid ID='DataGrid1' runat='server'></asp:datagrid>")
         Response.Write("<asp:label ID='l1' runat='server'></asp:label></form>")

       Case 2
          Response.Write ("Case 2")
   Case Else
          Response.Write("oh no")
       End Select %>

</body>



 
Old May 17th, 2005, 06:50 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

.net issues are best posted in the .net area - This is the classic ASP area

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic generation of .Net button in a position sonaldewle General .NET 0 April 3rd, 2006 03:51 AM
Dynamic generation of asp.net server controls shashi1312 Classic ASP XML 1 August 2nd, 2005 04:52 AM
Dynamic Button Generation LouMattera BOOK: Professional C#, 2nd and 3rd Editions 2 March 4th, 2005 04:26 PM
Dynamic generation of controls in ASP.NET Maxood ASP.NET 1.0 and 1.1 Basics 2 March 8th, 2004 07:29 PM





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