Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here i got a solution for finding the id of text,select, labels through html Button click</p> <pre><code> &lt;input type="button" id="save" value="submit" onclick="submitpage()" /&gt; </code></pre> <p>then on submitpage</p> <pre><code>&lt;script type="text/javascript"&gt; function submitpage() { var completeids = new Array(); var completevalues = new Array(); var completetype = new Array(); var completeselected = new Array(); var labelvalues = new Array(); // var name = "abc"; var name = document.getElementById('&lt;%=username.ClientID %&gt;').innerHTML $('input[type="text"]').each(function () { completeids.push($(this).attr('id')); completetype.push('TEXTBOX'); completevalues.push($(this).attr('value')); completeselected.push('no'); }); $('label').each(function () { completeids.push($(this).attr('id')); completevalues.push($('label[id= ' + $(this).attr('id') + ']').html()); labelvalues.push($('label[id= ' + $(this).attr('id') + ']').html()); completetype.push('LABEL'); completeselected.push('no'); }); $('select').each(function () { completeids.push($(this).attr('id')); completevalues.push($(this).val()); completetype.push('DROPDOWN'); completeselected.push('no'); }); $('input[type="checkbox"]').each(function () { completeids.push($(this).attr('id')); completevalues.push($('label[for=' + $(this).attr('id') + ']').html()); completetype.push('CHECKBOX'); completeselected.push($(this).attr('checked')); }); $('input[type="radio"]').each(function () { completeids.push($(this).attr('id')); completevalues.push($('label[for=' + $(this).attr('id') + ']').html()); completetype.push('RADIOBUTTON'); completeselected.push($(this).attr('checked')); }); $('input[type="file"]').each(function () { completeids.push($(this).attr('id')); //completevalues.push('not yet done'); completevalues.push($(this).attr('value')); completetype.push('FILE'); completeselected.push('no'); }); var loc = window.location.href; $.ajax({ type: 'POST', url: loc + "/GetSaved", data: "{getcompleteids :'" + completeids + "',getcompletevalues :'" + completevalues + "',getcompletetypes :'" + completetype + "',getcompleteselected :'" + completeselected + "',getlabelvalue :'" + labelvalues + "',formname:'"+name+"'}", contentType: "application/json; charset=utf-8" }) .success(function (response) { alert(response.d); }) .error(function (response) { alert(response.d); }); } &lt;/script&gt; </code></pre> <p>at c# code i have used like this...</p> <pre><code> [WebMethod] public static string GetSaved(string getcompleteids, string getcompletevalues, string getcompletetypes, string getcompleteselected, string getlabelvalue, string formname) { string[] completeids = getcompleteids.Split(','); string[] completevalues = getcompletevalues.Split(','); string[] completetypes = getcompletetypes.Split(','); string[] completeselected = getcompleteselected.Split(','); string[] labelvalues = getlabelvalue.Split(','); SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dynamic"].ConnectionString); string FORMNAME = labelvalues[0]; for (int i = 0; i &lt;= completeids.Length-1; i++) { con.Open(); //FORM_NAME, USER_NAME ,CONTRO_TYPE, CONTROL_ID, CONTROL_VALUE, CONTROL_SELECTED SqlCommand cmd = new SqlCommand("INSERT INTO CONTROLS_INFORMATION VALUES('" + FORMNAME + "',' "+formname+" ','" + completetypes[i] + "','" + completeids[i] + "','" + completevalues[i] + "','" + completeselected[i] + "')", con); cmd.ExecuteNonQuery(); con.Close(); } return "successfully"; } </code></pre> <p>It was done.. Hope it will be useful to some one like me..hmm...</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.
    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