Xml
Users need to register in accordance with different user types, in the database to filter out different products available to the user. Think, the best effect can only be without the method of refreshing.
Front steps: (JS)
function Fillproduction ()
{
var dwl = document.all ("Dropdownlistlevel");
var HTP = new ActiveXObject ("Microsoft.XMLHTTP");
var url = "reg.aspx?fp=" + dwl.value; Htp.open ("POST", Url,false);
Htp.setrequestheader ("Content-type", "application/x-www-form-urlencoded") htp.send ();
var str = Htp.responsetext;
if (str!= "")
{
var MyData = Str.split ("$");
if (Mydata[0]!= 0)
{
for (Var i=1;i<=mydata[0];i++)
{
var tmp = Mydata[i].split ("@");
var item = new Option ();
Item.text = tmp[0] + "|" + tmp[1] + "BV"; Item.value = tmp[2]; DOCUMENT.SUBMIT.DROPDWONLISTPRODUCTION.OPTIONS[I-1] = Item;
}
Document.submit.hidpid.value = Document.submit.DropDwonListProduction.value;
}
Else
{
var len = document.submit.DropDwonListProduction.options.length;
for (Var i=len-1;i>=0;i--)
{
Document.submit.DropDwonListProduction.options.remove (i);
}
Document.submit.hidpid.value = "";
}
}
HTP = null;
}
Background encoding:
private void Fillproduction ()
{
String sql;
sql = "Select Pgr_prod_descr,pgr_bv_value,pgr_prod_grp_cd from Prod_grp t where T.pgr_bv_value = (select DAL_BV from def_a Cct_level where dal_id = "+ request[" FP "] +") ";
DataTable DT;
DT = sqlhelper.filldatatable (sqlhelper.conn_string,commandtype.text,sql);
string tmp;
if (dt. Rows.Count >0)
{
TMP = dt. Rows.Count.ToString () + "$";
for (int i=0;i<=dt. rows.count-1;i++)
{
TMP = tmp + dt. Rows[i][0]. ToString () + "@" + dt. ROWS[I][1]. ToString () + "@" + dt. ROWS[I][2]. ToString () + "$";
}
}
Else
{
TMP = "0$";
}
Response.Write (TMP);
}