Note that there are some explanatory texts on larger screens.

plurals
  1. POC# code to pass value of textbox created using for loop to another page
    primarykey
    data
    text
    <p>I am using the following C# code to populate a div using stringbuilder, I want to get the studentid of a particular student which is clicked.</p> <pre><code>PSC.Data.SQLDB.SQLDBHelper objReg = null; DataSet objRegDetails = null; try { objReg = new PSC.Data.SQLDB.SQLDBHelper(); objRegDetails = new DataSet(); objRegDetails = objReg.ExecuteDataSet("ListConsultants", retXML); if (objRegDetails != null) { if (objRegDetails.Tables.Count &gt; 0) { if (objRegDetails.Tables[0].Rows.Count &gt; 0) { for (int i = 0; i &lt; objRegDetails.Tables[0].Rows.Count; i++) { strRep = "&lt;div style='width :70px;height :90px; float :left ;'&gt;&lt;div style='width :70px; height :70px; float :left ;'&gt;"; strRep += "&lt;input type=\"hidden\" id=\"hdcid\" name=\"" + objRegDetails.Tables[0].Rows[i]["CName"] + "\" value=\"" + objRegDetails.Tables[0].Rows[i]["ConsultantId"] + "\"&gt;"; strRep += "&lt;a href='a1.asp?hdcid=&lt;%=hdcid.Value %&gt;'&gt;"; strRep += "&lt;img src='../Images/Consultant/defaultimage.png' style='width:70px; height:70px;float:left;'&gt;&lt;/a&gt;&lt;/div&gt;"; strRep +="&lt;div style='width :70px; height :20px; float :left ;' class='pageRegText'&gt;"; strRep += objRegDetails.Tables[0].Rows[i]["CName"].ToString(); //Session["ConsultantId"] = objRegDetails.Tables[0].Rows[i]["ConsultantId"].ToString(); strRep += "&lt;/div&gt;"; strRep += "&lt;div style='width :70px; height :20px; float :left ;'&gt;&lt;/div&gt;"; strRep += "&lt;/div&gt;"; divmain.InnerHtml += strRep; } } } } } catch (Exception exc) { } finally { objRegDetails = null; objReg = null; } </code></pre> <p>Question: How can I get the hidden field value in another page when I click the link tag?</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