Click here to Skip to main content
15,889,536 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Listbox1 as follows
CTF
AFF
MFA

When i click the CTF in Listbox1, in Listbox2 CTF batch date will be displayed.

Listbox2 as follows
27 June 2015


I have one generate button.when i click the generate button, excel file will be download.

When i download i want to give excel filename as follows

file name of excel as follows - CTF- 27 June 2015


for that how can i do in asp.net using c#.
Posted
Comments
Maciej Los 27-Sep-15 14:49pm    
What have you tried? Where are you stuck?

1 solution

This seems to be quite obvious...
C#
string sFileName = String.Format("{0} - {1}", ListBox1.SelectedItem.ToString(), ListBox2.SelectedValue.ToString());


For further information, please see:
String.Format Method [^]
ListBox.SelectedItem Property[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900