|
|
I think that idea is for windows APP. not for web. Check This[^]
|
|
|
|
|
|
Hi friends,
I am adding dynamic controls on form on button click....everything working fine....but if I click on button and refresh the page one more control get added.
If anybody has any idea please share with me....
Thanks,
Nagraj
|
|
|
|
|
One more control adds because the existing controls are resurrected from ViewState.
Did you try XmlHttp based refresh?
|
|
|
|
|
Hi,
I simply press F5 due to which page get refreshed....and one more control get added.
|
|
|
|
|
Hi,
When you refresh your page the last executed event in the aspx page gets executed again. Thats why one more controls is added.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Whilst the other two answers are technically correct I thought I'd elaborate:
When you click the button it causes a POST request to the server and returns a page. When you refresh the page it re-submits the POST request which contains the event information to perform, causing it to add another control. I'm not sure what you can do about it, why is this a problem anyway?
|
|
|
|
|
I'm sorry, i didn't find your problem all that refreshing...
|
|
|
|
|
Hi ,
I am adding dynamic controls on form on button click....everything working fine....but if I click on button and refresh the page one more control get added.
Thanks.
Nagraj
|
|
|
|
|
Hi All,
Please let me know if there is any way to select multiple items from a dropdown list.
The requirement is as follows:
i have a drop down list which is populated from the database.The user should be able to select multiple items from the list and press the submit button.On submitting, all the selected items from the list should be populated in a single column of a row in a table.
Kindly send me the code.
Thank You.
|
|
|
|
|
rameshbhojan wrote: i have a drop down list which is populated from the database.The user should be able to select multiple items from the list
I think not possible. Try using listbox, checkedlistbox.
|
|
|
|
|
ok navaneeth,
even if i use list box,how do i make multiple entries into the single column of a row in a table
|
|
|
|
|
How about separating the values with comma or some other separator. At the time of retrieving data, split value using the separator.
|
|
|
|
|
navaneeth,
i am new to .Net and i don get you exactly.......
could you please send the code and query for wat u suggested
|
|
|
|
|
Assume that you put a list box. use the following method to form the string to be inserted to DB
string strInsertValue = string.Empty;
for(int i=0;i<=ListBoxCount-1;i++)
{
IfListItemSelected
strInsertValue = ListBoxSelectedValue + ",";
}
at the time of retrieving data from DB split the data with ','. You will get a string array and do the processing with that.
|
|
|
|
|
navaneeth i don find any keyword like IfListItemSelected
which was in the code you sent
|
|
|
|
|
I think that navaneeth's reply is to put all the items in a single row of a column, not what you were looking for.
Where do you get a problem with several inserts depending on the data selected? You just need some kind of loop.
|
|
|
|
|
Paddy Boyd wrote: I think that navaneeth's reply is to put all the items in a single row of a column
That is his requirement. See his previous posting
|
|
|
|
|
His requirement was for single column of a row, not the other way around. Of course i may be misreading what he actually wants...
|
|
|
|
|
|
paddy i guess tats wat i want.......
let me explain.....
the requirement is once the user selects multiple items from the list box,
and submits the form, all the selected values should be inserted into a particular column of the table i,e suppose the listbox has a list if languages say, then all the selected languages from the listbox, should be inserted into the column called "languages", (seperated by comma) of a row in the table.
do you have a solution for this???
|
|
|
|
|
Hi,
The following is the code you can use to get comma separated string of selected Items from the listbox.
string strSelected = "";
foreach ( ListItem lstItem in lstBox.Items )
{
if ( lstItem.Selected )
{
strSelected += lstItem.Value + ",";
}
}
put "strSelected" in to your insert query and you are done.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Hi Chetan,
Thanks yaar for the code...
its working fine now!!!
|
|
|
|
|
hey Chetan,
wat should i set to ensure that a maximum of only 3 items could be selected from a list box???
is there any property for that or some other code???
please send me the details
|
|
|
|