I hate putting text boxes and labels on an aspx page. It's stupid boring and that trigger in my brain says "There's GOT to be a faster way to do this" ...and now there is, I got sick of it so I made a vb script as such...
|
DIM fso, outputFile
const ForAppending = 8
dim LabelStart, TextBoxStart
LabelStart = "<asp:Label runat=" & chr(34) & "server" & chr(34) & " ID=" & chr(34) & "lbl"
TextBoxStart = "<asp:TextBox runat=" & chr(34) & "server" & chr(34) & " ID=" & chr(34) & "txt"
'variables we will need
dim controlName, labelTextdim keepAdding, intVal
keepAdding = TrueSet fso = CreateObject("Scripting.FileSystemObject")
Set outputFile = fso.OpenTextFile("ControlGenerator.txt", ForAppending, True)do while keepAdding
controlName = InputBox("ControlName?")
labelText = InputBox("Label Text?")
outputFile.WriteLine(LabelStart & controlName & chr(34 & " Text=" & chr(34) & labelText & chr(34) & "/>")
outputFile.WriteLine(TextBoxStart & controlName & chr(34) & "/><br />" )
intVal = MsgBox("Add Another?", 4)
if (intval = 7) then keepAdding = false
loopoutputFile.Close
wscript.echo("Complete") |
Save that as a vbs file. What will this do?
<asp:Label runat="server" ID="lblStreetName" Text="Street : "/>
<asp:TextBox runat="server" ID="txtStreetName"/><br />
Now to go pound out 40 or so controls like this....no, not joking.