0% found this document useful (0 votes)
38 views

Code

The document discusses three topics: 1) Automatically moving the cursor from one textbox to another on keyup using JavaScript. 2) Storing multiple selected list item values in a database by concatenating them with commas. 3) Retrieving stored multiple values from a database and reselecting the corresponding list items, as well as passing multiple values between pages in a query string.

Uploaded by

api-3848319
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Code

The document discusses three topics: 1) Automatically moving the cursor from one textbox to another on keyup using JavaScript. 2) Storing multiple selected list item values in a database by concatenating them with commas. 3) Retrieving stored multiple values from a database and reselecting the corresponding list items, as well as passing multiple values between pages in a query string.

Uploaded by

api-3848319
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 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);

You might also like