Re: Table querying in ASP by Bob
Bob
Tue Nov 29 08:04:41 CST 2005
ukrbend wrote:
> This is a simple question, so sorry for my newbieness. How do I
> query data about a html table? Specifically I want to know how many
> columns there are currently. I thought something like this would have
> worked:
>
> <% NumCols = Request("Columns") %>
>
> But it doesn't. Any help greatly appreciated. Thanks....
ASP knows nothing about the html in the submitting page. All it can see are
the name/value pairs submitted by the form, the names coming friom the name
attributes of the elements in the form.
What you can do is use a hidden field in the form, and
a) if the table is generated by server-side code, add a line to the
server-side code to set the value of the hidden field to the number of
columns
b) if the table is generated using client-side code, use client-side code to
set its value to the number of columns in the table, perhaps in the onsubmit
event.
A better group for ASP server-side questions would be
microsoft.public.inetserver.asp.general.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.