H
Heimer
Is the following possible in .Net? Specifically c# codebehind using
webcontrols. I'm pretty sure it isn't but I wanted to check to make
sure..
Basically I have an object, lets call it a TEMPLATE. Each TEMPLATE
has x MAP(s) on it. Each MAP has x ATTRIBUTE(s). I need to be able
to create a web form that will allow me to edit the MAP(s) and
ATTRIBUTE(s) when I supply a TEMPLATE(ID). The MAP(s) will be listed
on a page with the optoin of changing the ATTRIBUTE(s). The
ATTRIBUTE(s) values will be in html select boxes.
In any scripting languagues I would just loop over my query object and
build the select and text boxes as needed in html, keeping naming
simple by adding the unique IDentifier to the name attribute of the
select box. Then on form submit I'd loop through the Request.Form[]
and do my query updates that way. See pseudo code below...
templateQuery="SELECT * FROM TEMPLATE INNER JOIN MAPS ON
Template.MapId= Maps.MapId WHERE TemplateId = @templateId"; //returns
template with 3 maps
positionQuery="SELECT * FROM POSITION";
<% for(int i=0;i<templateQuery.Length;i++){ %>
<tr><td colspan="2"><%= templateQuery.templateName %></td></tr>
<tr><td>Position: </td>
<td><select name="position<%= templateQuery.templateId%>">
<% for(int j=0;j<positionQuery.Length;j++){ %>
<option <% if (templateQuery.positionId ==
positionQuery[j].positionId){ %>SELECTED <%}%> value="<%=
positionQuery[j].positionId %>"><%= positionQuery[j].positionName %>
<%} %>
</select></td></tr>
<% } %>
webcontrols. I'm pretty sure it isn't but I wanted to check to make
sure..
Basically I have an object, lets call it a TEMPLATE. Each TEMPLATE
has x MAP(s) on it. Each MAP has x ATTRIBUTE(s). I need to be able
to create a web form that will allow me to edit the MAP(s) and
ATTRIBUTE(s) when I supply a TEMPLATE(ID). The MAP(s) will be listed
on a page with the optoin of changing the ATTRIBUTE(s). The
ATTRIBUTE(s) values will be in html select boxes.
In any scripting languagues I would just loop over my query object and
build the select and text boxes as needed in html, keeping naming
simple by adding the unique IDentifier to the name attribute of the
select box. Then on form submit I'd loop through the Request.Form[]
and do my query updates that way. See pseudo code below...
templateQuery="SELECT * FROM TEMPLATE INNER JOIN MAPS ON
Template.MapId= Maps.MapId WHERE TemplateId = @templateId"; //returns
template with 3 maps
positionQuery="SELECT * FROM POSITION";
<% for(int i=0;i<templateQuery.Length;i++){ %>
<tr><td colspan="2"><%= templateQuery.templateName %></td></tr>
<tr><td>Position: </td>
<td><select name="position<%= templateQuery.templateId%>">
<% for(int j=0;j<positionQuery.Length;j++){ %>
<option <% if (templateQuery.positionId ==
positionQuery[j].positionId){ %>SELECTED <%}%> value="<%=
positionQuery[j].positionId %>"><%= positionQuery[j].positionName %>
<%} %>
</select></td></tr>
<% } %>