C
CJM
Bit of a noob question... I'm finally starting to move across .ASP.NET from
ASP 3.0, and I'm trying to make the most of .NET rather than simply do what
I did before, albeit with different syntax. I'm converting a simple ASP
application to .NET as a learning vehicle.
I have an application that allows the user to search a simple DB containing
information about machine tooling. The user can search for details of a
specific item or for groups of items that have specific characteristics.
In each case, the application returns the same information, and certain
columns are returned as hyperlinks to allow further searching; for example,
if I search for Retainer #1 I get one record returned, but if I click on
the value in the value in the Tip Width field, the the hyperlink calls the
same page again, but with different search paremters that returns all
Retainers with a similar Tip Width.
Snippet:
<tr>
<td><a href="viewc105.asp?retainer=<%=iRetNo%>"
target="_blank"><%=iRetNo%></td>
<td><a
href="searchc105.asp?searchval=<%=fTipWidth%>&search=Search&SearchField=2"><%=fTipWidth%></a></td>
<td><%=.fields("Thickness")%></td>
<td><%=.fields("Depth")%></td>
<td><%=.fields("Style")%></td>
<td><%=.fields("InternalAngle")%></td>
<td><%=Format3dp(.fields("DevelopedWidth"))%></td>
<td><a
href="searchc105.asp?searchval=<%=fFlange%>&search=Search&SearchField=3"><%=fFlange%></a></td>
</tr>
Now, I know I *could* easily use the same technique in ASP.NET. I'm using a
a GridView control to generate the table, so I've configured several of the
columns as HyperTextField columns.
My first question is whether there are any alternatives to this technique?
Rather than submitting the page, then checking for certain QueryString
fields, is there any better method in ASP.NET? I'm not sure why I think
there may be better methods, but I just have a felling that there might be.
My second question is how to actually construct the table that I want to
render. As I've said, I started using a GridView, but I'm in two minds as to
whether should bind the Gridview to the DataReader that I've created, and
then retrospectively, edit the HypertextField columns to point to the right
hyperlinks; or should I manually construct each row in a While
DBReader.Read() loop. Any thoughts?
The overall problem I have at the moment is that I can imagine a dozen ways
to acheive even the simplest of tasks and all of the received wisdom I've
accumulated in ASP3.0 can only be thrown out of the window. I'm sure I can
achieve everything I want somehow, but I'd rather aim for a slick solution
than a series of ASP3-esque bodges...
Thanks in advance
Chris
ASP 3.0, and I'm trying to make the most of .NET rather than simply do what
I did before, albeit with different syntax. I'm converting a simple ASP
application to .NET as a learning vehicle.
I have an application that allows the user to search a simple DB containing
information about machine tooling. The user can search for details of a
specific item or for groups of items that have specific characteristics.
In each case, the application returns the same information, and certain
columns are returned as hyperlinks to allow further searching; for example,
if I search for Retainer #1 I get one record returned, but if I click on
the value in the value in the Tip Width field, the the hyperlink calls the
same page again, but with different search paremters that returns all
Retainers with a similar Tip Width.
Snippet:
<tr>
<td><a href="viewc105.asp?retainer=<%=iRetNo%>"
target="_blank"><%=iRetNo%></td>
<td><a
href="searchc105.asp?searchval=<%=fTipWidth%>&search=Search&SearchField=2"><%=fTipWidth%></a></td>
<td><%=.fields("Thickness")%></td>
<td><%=.fields("Depth")%></td>
<td><%=.fields("Style")%></td>
<td><%=.fields("InternalAngle")%></td>
<td><%=Format3dp(.fields("DevelopedWidth"))%></td>
<td><a
href="searchc105.asp?searchval=<%=fFlange%>&search=Search&SearchField=3"><%=fFlange%></a></td>
</tr>
Now, I know I *could* easily use the same technique in ASP.NET. I'm using a
a GridView control to generate the table, so I've configured several of the
columns as HyperTextField columns.
My first question is whether there are any alternatives to this technique?
Rather than submitting the page, then checking for certain QueryString
fields, is there any better method in ASP.NET? I'm not sure why I think
there may be better methods, but I just have a felling that there might be.
My second question is how to actually construct the table that I want to
render. As I've said, I started using a GridView, but I'm in two minds as to
whether should bind the Gridview to the DataReader that I've created, and
then retrospectively, edit the HypertextField columns to point to the right
hyperlinks; or should I manually construct each row in a While
DBReader.Read() loop. Any thoughts?
The overall problem I have at the moment is that I can imagine a dozen ways
to acheive even the simplest of tasks and all of the received wisdom I've
accumulated in ASP3.0 can only be thrown out of the window. I'm sure I can
achieve everything I want somehow, but I'd rather aim for a slick solution
than a series of ASP3-esque bodges...
Thanks in advance
Chris