|
Hi Brij,
Thank you for your help. but i need to take data from database and it will fill to listbox based on textbox value
please kindly help me
thank youlaxmi
|
|
|
|
|
Hi,
For this you have to write a javacsript function that takes a parameter and loop through the list box and select the list box item when the search is matched.
Now you can call this javascript function onKeyPress or onKeydown of textbox above the listbox with parameter as the text of textbox above the listsbox, this way an incremental search can be implemented to select listbox items and based on each character entered in the text box.
Let me know if you need any further information on the same (javascript code etc.).
Thanx,
Adil... )
|
|
|
|
|
Hi,
Thank you for your help. but i need to fill listbox data from database and please give code for this javascript.
thankslaxmi
|
|
|
|
|
Hi Laxmi,
On the code hehind, when your page loads add attributes for javascript key events(suppose your text box is TextBox1 and list box is lstTest) code is :
TextBox1.Attributes.Add("onKeyUp","javacsript:searchOptions('lstTest',document.getElementById('TextBox1').value);");
TextBox1.Attributes.Add("onLostFocus","javacsript:searchOptions('lstTest',document.getElementById('TextBox1').value);");
Now on the aspx page following function can be implemented:
function searchOptions(selectboxID, searchText){
var selectbox = document.getElementById(selectboxID);
var i;
searchTextLength = searchText.length;
for(i=0;i<selectbox.options.length-1;i++){
if(selectbox.options[i].text.indexOf(searchText)>=0){
selectbox.options[i].selected = true;
break;
}
}
}
Hope this helps, I test this in IE7.0 with list box filled with database values only.
Let me know if you need any further information on the same.
Thanx,
Adil... )
|
|
|
|
|
Hi,
Please give me sample code for this,
Please help me
thanks in advance.laxmi
|
|
|
|
|
Hi
Please see the sample code in my last reply I posted today morning itself, I tested it is working perfectly.
Thanx,
Adil... )
|
|
|
|
|
Hi Laxmi,
Please find the updated code of incremental search to display result in a div tag.
JavaScript function :
---------------------
function searchOptions(selectboxID, searchText){
var selectbox = document.getElementById(selectboxID);
var i;
var divResult = document.getElementById('divResult');
var searchResult = '';
var opt;
for(i=0;i<selectbox.options.length-1;i++){
if (selectbox.options[i].text.indexOf(searchText) >= 0) {
searchResult = searchResult + selectbox.options[i].text + "<br>";
}
}
divResult.innerHTML = '';
divResult.innerHTML = searchResult;
}
HTML Code :
-----------
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
<asp:ListBox ID="lstTest" runat="server" >
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
<asp:ListBox ID="lstTest" runat="server" >
<asp:ListItem Text="Adil"></asp:ListItem>
<asp:ListItem Text="ab"></asp:ListItem>
<asp:ListItem Text="abc"></asp:ListItem>
<asp:ListItem Text="abcd"></asp:ListItem>
<asp:ListItem Text="abcde"></asp:ListItem>
<asp:ListItem Text="abcdef"></asp:ListItem>
<asp:ListItem Text="abcdefg"></asp:ListItem>
</asp:ListBox>
<div id="divResult"></div>
Hope Now you get the the solution.
Pls let me know if you need any further information on the same.
Thanx,
Adil... )
|
|
|
|
|
please help me that how could i add some text & image into iframe by javascript dynamically. tbhattacharjee
|
|
|
|
|
You can add a webpage in iframe.
suppose you have iFrame with id="myFrame"
then:
document.getElementById("myFrame").src = "myPage.html";
if you wish to add text or image dynamically, use div tag.
|
|
|
|
|
how to generate div dynamically and position at center of the page when content will be populated dynamically by javascript.
which will work with all the browser.please help me with idea.
thanks in advance.tbhattacharjee
|
|
|
|
|
you can create a div dynamically and set it postiion in style property.
Just Have a look for detailsCheers!!
Brij
|
|
|
|
|
|
please do not request me to zip all the file and then download one zip file.
suppose i have three link button on page and i want when user will click any button then a postback will happen and file download will start.
my code is working fine but the problem is when one file is downloading if user click on another link the request is being block or queued and
start downloading second file when first download gets completed.
is there anyway out page can handle multiple request. when one file is downloading then second file will be downloading if same user click on anylink at the same point of time.
please help me with idea and sample code.
thanks in advance.tbhattacharjee
|
|
|
|
|
Each link of download should open a new window and download the file.
Then, you can download the files simultaneously.
|
|
|
|
|
Hello,
I have developed a website with database for a business... The connection strings to the database are inside the web.config file.
Now I would like to have the same website to be able to use another database
So each business has it's own database and they all use the same website...
The website at present is using the login controls in asp.net to login to the system...
what is the best way to make sure when someone from a particular business is using the website then he is pointed to his business database and not another?
I am thinking may be the best thing is to have one unique login page for each business.
Any thoughts please?
thanks
|
|
|
|
|
According for this you should create one connecting string table in you main database
so based on login id and role its should pick up connecting string when user login to system . save this connecting string in session variable.
Hope this will work for you.
|
|
|
|
|
Hi, there is no main database at present.
There is only one DB per business.
|
|
|
|
|
I dont this so with out main db you complete this kind of functionality.
|
|
|
|
|
You could have different connection strings in the webconfig and choose from them, at runtime, based on the user's role/business unit data.
|
|
|
|
|
What do you mean by "based on the user's role/business unit data." ? if you mean when they login then please note that at present in each business DB, there are login schemas.
|
|
|
|
|
In that case then you got to tear out the login schemas from the business dbs and put it in one common db. Then proceed with either my suggestion or Rana's suggestion.
Based on your original question, to give different login screen to different business, how will you identify which user is from which business before s/he logs in??
So either tear out the login schema into diff db or else, make separate deployment for each business with different db configs.
HTH!
|
|
|
|
|
There must some specific condition on which you will be deciding whioch db you are going to use.So at the loading of your website,apply the connectionstring that you want. Cheers!!
Brij
|
|
|
|
|
As far as i think you can have particular id for each bussiness and according to that id you can dynamically
use the connection string as you want.
|
|
|
|
|
hello all
can we use frament caching or partial-page output caching without webuser controls ???
I mean could there be any possibility to use fragment caching rather than used in webuser controls..?
if yes..how could it be done?
|
|
|
|
|
I have never used fragment caching without Usercontrol.and I dont think it is possible without userconrol. Cheers!!
Brij
|
|
|
|