Anda di halaman 1dari 2

1.

Moving cursor automatically frm one textbox to other:


2. Storing list items in database from (checkboxlist, listbox and etc..) :
3. Multiple values passing in query string

Moving cursor automatically frm one textbox to other:

onkeyup="if (this.value.length == 3) document.getElementById('txtprefix').focus();"

Storing list items in database from (checkboxlist, listbox and etc..) :

string chk2 = "";


foreach (ListItem li in chlservices.Items)
{
if (li.Selected == true)
{
if (chk2 == "")
{
chk2 = chk2 + li.Text;
}
else
{
chk2 = chk2 + "," + li.Text;

}
}
}
Session["service"] = chk2.ToString();

Retrieving contents in checkbox or list box from database wen they r


seperated by “,”.:

string[] comp1 = Session["service"].ToString().Split(new char[] {


',' });
foreach (string com1 in comp1)
{

foreach (ListItem li in chlservices.Items)


{
if (li.Text == com1)
{
li.Selected = true;
}
}

Multiple values passing in query string

string b = txtbusiness.Text;
string s = lblstate.Text;
string l = txtcity.Text;
//Response.Redirect("al.aspx?business="+b);
string url = "al1.aspx?";
url+="state="+s+"&";
url += "business=" + b + "&";
url+="location="+l+"";
Response.Redirect(url);

Anda mungkin juga menyukai