Note that there are some explanatory texts on larger screens.

plurals
  1. POcreate dynamic html elements and add to table asp.net
    primarykey
    data
    text
    <p>I used to some thing like this in jsp.</p> <pre><code>&lt;%@page language="java" import="java.util.*"%&gt; &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %&gt; &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt; &lt;%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %&gt; &lt;%@ page errorPage="/showError.jsp" %&gt; &lt;% String path = request.getContextPath(); %&gt; &lt;sql:query var="rs" dataSource="jdbc/production"&gt; select id,location,zone,ifnull(DATE_FORMAT(date_recp,'%m/%d/%Y'),'00-00-0000') as date_recp,qry_id ,cust_name,qry_recvd,qry_mode,ifnull(DATE_FORMAT(start_date,'%m/%d/%Y'),'00-00-0000') as start_date, timing,qry_type,qry_cat,qry_det,ifnull(DATE_FORMAT(date_esclation,'%m/%d/%Y'),'00-00-0000') as date_esclation,ifnull(DATE_FORMAT(date_recp_ho,'%m/%d/%Y'),'00-00-0000') as date_recp_ho, ifnull(DATE_FORMAT(date_recp_ho,'%m/%d/%Y'),'00-00-0000') as final_date,remarks,qry_stat from cust_supp where final_date is null or final_date='0000-00-00' &lt;/sql:query&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Customer Support Search Operation&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;link href="css/style.css" rel="stylesheet" type="text/css" /&gt; &lt;link rel="stylesheet" type="text/css" href="&lt;%= path %&gt;/js/style.css" /&gt; &lt;style type="text/css" title="currentStyle"&gt; @import "&lt;%= path%&gt;/css/demo_table.css"; @import "&lt;%= path%&gt;/css/demo_table_jui.css"; @import "&lt;%= path%&gt;/css/jquery-ui-1.8.20.custom.css"; @import "&lt;%= path%&gt;/css/TableTools.css"; @import "&lt;%= path%&gt;/css/TableTools_JUI.css"; &lt;/style&gt; &lt;script type="text/javascript" src="&lt;%= path%&gt;/js/jquery-1.7.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;%= path %&gt;/js/tcal.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="&lt;%= path %&gt;/css/tcal.css" /&gt; &lt;script src="&lt;%= path%&gt;/js/jquery.dataTables.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="&lt;%= path%&gt;/js/ZeroClipboard.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="&lt;%= path%&gt;/js/TableTools.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="&lt;%=path%&gt;/css/style.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="&lt;%=path%&gt;/css/styles.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="&lt;%=path%&gt;/js/tinybox.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="&lt;%= path%&gt;/js/send_data.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;div class="brand" style="background:url('&lt;%=path%&gt;/images/head.jpg') no-repeat ;"&gt;&lt;/div&gt; &lt;body&gt; &lt;div class="forms"&gt; &lt;form style="height:450pt;width:95%;margin-left:5pt;margin-top:0" name ="form" action="&lt;%=path%&gt;/Download"&gt; &lt;input type="hidden" name="query" value="q0" /&gt; &lt;input type="hidden" name="dwld" value="cust_supp" /&gt; &lt;table width="95%" id="dataTable" class="display"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th width="20pt"&gt;&lt;b&gt;S.no&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Query ID&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Zone&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Location&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Customer Name&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Query Received&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Date of Receipt&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Mode of Query&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Start Fall-Up Date&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Timing&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Query Type&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Query Category&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Query Details&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Date of Escalation&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Date of Receipt HO/Client/Bank&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Final Date&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Remarks&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Query Status&lt;/b&gt;&lt;/th&gt; &lt;th&gt;&lt;b&gt;Update&lt;/b&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt;&lt;tbody&gt; &lt;c:forEach var="row" items="${rs.rows}"&gt; &lt;tr&gt; &lt;td&gt;${row.id}&lt;/td&gt; &lt;td&gt;&lt;span&gt;${row.qry_id}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span&gt;${row.zone}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span&gt;${row.location}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="editable"&gt;${row.cust_name}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;select name="query_rcvd" &gt; &lt;option value="${row.qry_recvd}" selected&gt;${row.qry_recvd}&lt;/option&gt; &lt;option value="Client"&gt;Client&lt;/option&gt; &lt;option value="HO"&gt;HO&lt;/option&gt; &lt;option value="Other"&gt;Other&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;td align="right"&gt;&lt;input type="text" name="date" class="tcal" value="${row.date_recp}" /&gt;&lt;/td&gt; &lt;td&gt;&lt;select name="mode" &gt; &lt;option value="${row.qry_mode}" selected&gt;${row.qry_mode}&lt;/option&gt; &lt;option value="phone"&gt;Phone&lt;/option&gt; &lt;option value="E-mail"&gt;E-mail&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="date" class="tcal" value="${row.start_date}"/&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="editable"&gt;${row.timing}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;select name="nature"&gt; &lt;option value="${row.qry_type}" selected&gt;${row.qry_type}&lt;/option&gt; &lt;option value="ECS Debit"&gt;ECS Debit&lt;/option&gt; &lt;option value="ECS Credit"&gt;ECS Credit&lt;/option&gt; &lt;option value="ASP"&gt;ASP&lt;/option&gt; &lt;option value="MF"&gt;MF&lt;/option&gt; &lt;option value="Retail"&gt;Retail&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;td&gt;&lt;select name="category"&gt; &lt;option value="${row.qry_cat}" selected&gt;${row.qry_cat}&lt;/option&gt; &lt;option value="Status of the Transaction" &gt;Status of the Transaction&lt;/option&gt; &lt;option value="Mandate Related Queries"&gt;Mandate Related Queries&lt;/option&gt; &lt;option value="Mandate Re-submission Cases"&gt;Mandate Re-submission Cases&lt;/option&gt; &lt;option value="Wrong Reason Code Given By The Bankers"&gt;Wrong Reason Code Given By The Bankers&lt;/option&gt; &lt;option value="Txn bounced at our end but cust bank a/c debited"&gt;Txn bounced at our end but cust bank a/c debited&lt;/option&gt; &lt;option value="Extra debit in the bank account"&gt;Extra debit in the bank account&lt;/option&gt; &lt;option value="Credit Query"&gt;Credit Query&lt;/option&gt; &lt;option value="R7"&gt;R7 Report&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="editable"&gt;${row.qry_det}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="date" class="tcal" value="${row.date_esclation}"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="date" class="tcal" value="${row.date_recp_ho}"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="date" class="tcal" value="${row.final_date}"/&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="editable"&gt;${row.remarks}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="editable"&gt;${row.qry_stat}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="button" class="tab_buttons" value="Update"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/c:forEach&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>That creates a page from <code>MySql DB</code> which contains select and input elements within a <code>html</code> table, Now I want to achieve the same in an <code>aspx page</code>. I tried to add <code>dynamically</code> from code behind, but that's completely mixing <code>c# with html</code>, I don't want that, As I am new, someone suggested me spark, they said it worked like <code>jstl</code> which I used above, I tried but spark is not getting into my head, a simple simple simple example plsss. Or any other better way to achieve that. <code>MVC</code> not involved in this so that I can use razor.</p> <p>Thank you</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload