Advertisement
Advertisement
| 11.21.2007 at 09:41AM PST, ID: 22976044 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: |
On click on button
protected void btnSubmit_Click(object sender, EventArgs e)
{
DropDownList SecurityQuestionDrp = (DropDownList)this.FindControl("SecurityQuestion"); // SecurityQuestion is the dynamic ID
string strDrp = SecurityQuestionDrp.SelectedValue;
}
// Generates Dynamic dropdownlist and add to the html table DynamicTable after row 6
private void GetDynamicHTML()
{
oDynmcFld = new DynamicFieldBL();
DataSet oDst = oDynmcFld.GetFieldsByFormId("GetFieldsByFormId", 1);
oDst.Relations.Add("ControlValuesRelation", oDst.Tables[0].Columns["FieldId_PK"], oDst.Tables[1].Columns["FormFileds_Mstr_PK"]);
DataTable oDt = oDst.Tables[0];
HtmlTableRow htr = new HtmlTableRow();
HtmlTableCell htc1 = new HtmlTableCell();
HtmlTableCell htc2 = new HtmlTableCell();
DropDownList drp = new DropDownList();
int startWith = 6;
if (oDt.Rows.Count > 0)
{
for (int iCnt = 0; iCnt <= oDt.Rows.Count - 1; iCnt++)
{
htr = new HtmlTableRow();
htc1 = new HtmlTableCell();
htc2 = new HtmlTableCell();
if (bool.Parse(oDt.Rows[iCnt]["IsMandatory"].ToString()))
{
sTempHTML += "<font class=\"alert\">*</font> ";
}
if (oDt.Rows[iCnt]["FldType"].ToString() == "DropDownList")
{
drp = new DropDownList();
drp.ID = oDt.Rows[iCnt]["FieldID"].ToString();
drp.Items.Clear();
DataTable dp = oDst.Tables[1];
foreach (DataRow da in dp.Rows)
{
if (oDt.Rows[iCnt]["FieldId_PK"].ToString() == da["FormFileds_Mstr_PK"].ToString())
{
drp.Items.Add(new ListItem(da["FieldValue"].ToString(), da["FieldValue"].ToString()));
}
}
}
htr.Cells.Add(htc1);
htr.Cells.Add(htc2);
DynamicTable.Rows.Insert(startWith, htr);
startWith = startWith + 1;
}
}
}
Some ASPX CODE
<asp:Panel ID="pnlMain" runat="server" Width="100%">
<table width="100%" cellpadding="3" cellspacing="0" border="0" id="DynamicTable" runat="server" >
<tr>
<td colspan="2" class="alert">
<asp:Literal ID="lblMsgDisplay" runat="server" SkinID="lblErrSkin"></asp:Literal>
</td>
</tr>
<tr>
<td align="right">
<font class="alert">
<asp:Literal runat="server" ID="litLoginMandatory2" Text="*"></asp:Literal>
</font>
<asp:Literal ID="lblUserName" runat="server" Text="Username:"></asp:Literal></td>
<td align="left">
<asp:TextBox ID="txtUserName" runat="server" MaxLength="20"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVUserName" runat="server" ControlToValidate="txtUserName"
ErrorMessage="Please enter user name" SetFocusOnError="True" Display="None" ValidationGroup="vgOnlineUser"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td align="right">
<asp:Label ID="lblSalutation" runat="server" Text="Salutation:"></asp:Label></td>
<td align="left">
<asp:DropDownList ID="cmbSalutation" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td align="right">
<font class="alert">
<asp:Literal runat="server" ID="litLoginMandatory" Text="*"></asp:Literal>
</font>
<asp:Label ID="lblFirstName" runat="server" Text="First name:"></asp:Label></td>
<td align="left">
<asp:TextBox ID="txtFirstName" runat="server" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFirstName" runat="server" ControlToValidate="txtFirstName" ErrorMessage="Please enter first name" SetFocusOnError="True" Display="None" ValidationGroup="vgOnlineUser"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td align="right">
<font class="alert">
<asp:Literal runat="server" ID="litLoginMandatory3" Text="*"></asp:Literal>
</font>
<asp:Label ID="lblSurname" runat="server" Text="Surname:"></asp:Label></td>
<td align="left">
<asp:TextBox ID="txtSurName" runat="server" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVSurname" runat="server" ControlToValidate="txtSurName"
ErrorMessage="Please enter your surname" SetFocusOnError="True" Display="None" ValidationGroup="vgOnlineUser"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<font class="alert">
<asp:Literal runat="server" ID="litLoginMandatory4" Text="*"></asp:Literal>
</font>
<asp:Label ID="lblEmail" runat="server" Text="Email:"></asp:Label></td>
<td align="left">
<asp:TextBox ID="txtEmail" runat="server" MaxLength="100"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEmail" runat="server" ControlToValidate="txtEmail" ErrorMessage="Please enter email" SetFocusOnError="True" Display="None" ValidationGroup="vgOnlineUser"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="Rexpvemail" runat="server" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ErrorMessage="Invalid email (name@domain.com)" SetFocusOnError="True" Display="None" ValidationGroup="vgOnlineUser"></asp:RegularExpressionValidator> </td>
</tr>
<tr >
<td> </td>
<td id="submitTD" runat="server">
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" ValidationGroup="vgOnlineUser" Text="Apply" CssClass="formButtonFocus" />
<asp:Button ID="btnReset" OnClientClick="javascript:window.document.forms[0].reset(); return false;" runat="server" Text="Reset" CausesValidation="False" CssClass="formButton" />
<asp:ValidationSummary runat="server" ID="OnlineUserSummary" EnableClientScript="True"
ShowMessageBox="True" ShowSummary="False" validationgroup="vgOnlineUser"></asp:ValidationSummary>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</td>
</tr>
</table>
</asp:Panel>
|