|
Can anyone please tell me wats wrong wit the following lines of code.Am tryn to remove the duplicate values in a dropdownlist using dropdownlist methods n properties.
dt is in DateTime Format
ListItem lst = new ListItem(dt.Month.ToString("00") + dt.Day.ToString("00") + dt.Year.ToString("0000")) ;
if (!Week.Items.Contains(lst))
{
//code to add the items to the dropdown
}
The following line doesnot work...though it gives no compile time error.if (!Week.Items.Contains(lst))
Am very new to this field.So can anyone please help me out.
Thanks
Regards,
Arun.
|
|
|
|
|
You created a new listitem. That item is not in the list, even if another with the same text, is. So, you need to search for items that contain that text. They are two different things.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian,
am adding the items to the dropdownlist through two functions,wenever the code is run,these two functions are called alwes.
after adding some list items to the dropdown list thru 1st function,am checkin if the dropdownlist already contains the item that am going to add through the 2nd function
if (Week.Items.FindByText(dt.Month.ToString("00") + dt.Day.ToString("00") + dt.Year.ToString("0000"))=="")
i think this is also wrong....as FindByText returns a list item.
Can you tell me how to do it using the properties and methods of the dropdownlist please.
Regards,
Arun.
|
|
|
|
|
check if it's null, if it is, the item is not there.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank u very much
Regards,
Arun.
|
|
|
|
|
Hi,
I'm about to put together a system for file storage. The idea is that a user will have his/her qwn account and once loged in the user can upload files, tag them, comment them and make them public or private. All attributes of a file are to be stored in a database.
Other users shall be able to search file types, names, comments, tag etc of a file and as long as the are public it should be able to download the file or get the file mailed to a specifyed address.
The system will be developed in ASP.NET.
have anyone heard of a similar open source project I could use for help and inspiration? I find i unnessessary to reinvent the wheel
Regards
Andreas
|
|
|
|
|
|
hi,
I have a Question regarding iTextSharp Compatibility with .Net 2.0 Frame work. Will iTextSharp be supported in the 2.0 framework?
thanks
From:eva
|
|
|
|
|
What does this have to do with ASP.NET ? iTextSharp is a 3rd party product, why not ask them ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello
I develop a web application, i ask what to give to the customers when i want to submit the project
Please help
And Thanks in advance
Assaf
|
|
|
|
|
I haven't developed a web application for a while, but I would suggest that you give them an invoice.
|
|
|
|
|
Sounds like another rentacoder job gone badly wrong.
You give them the code, obviously. You can publish it, and give them a copy of the site ready to deploy, but if they were silly enough to pay you, you should give them both.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I mean what to give him to let him run the project without viewing the source code
Thanks in advance
Assaf
|
|
|
|
|
By default, you can't. You may be able to find a setting that puts it all in a dll, but he can still view it view reflector or similar. If you want to show your work in progress, you need to host it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Generally speaking if you have been paid to develop a software app, then its work-for-hire and the source code belongs to the person who paid for your time.
|
|
|
|
|
The name and address of a reputable software company?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Dear all,
I am using C# , asp.net2.0
Actually I have a making survey form where based of request no of question displaying NOW quesetion is saved in table as questionid and questiondesp.
I am creating theses control and assign questiondesp to level but I have to save response against questionid .
my question is is there any other mean where I can display question and store value just like dropdownlist
Please suggest
Thank you.
regards
imran khan
|
|
|
|
|
You can make the tag or the id of the label store the id. You can also put a hidden field in each row containing the id.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I have a treeview I use as a menu. The treeview works perfect. BUT now I want to make a function where I add a new node to the menu programmatically. (I don't need help to add the new node in the database) I need help for: reload the menu and select the newly added node and expand the treeview to that node. I tried a lot, but nothing works for me.
Said with other words: I need a way to expand the treeview and make a specific node selected
I hope someone here can help me with my problem
My code:
TestMenu.aspx:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:TreeView ID="MenuTree" EnableClientScript="False" runat="server"
ExpandDepth="15" ShowExpandCollapse="False"
ontreenodeexpanded="MenuTree_TreeNodeExpanded"
ontreenodepopulate="MenuTree_TreeNodePopulate"
PathSeparator="/" ontreenodecollapsed="MenuTree_TreeNodeCollapsed">
<NodeStyle CssClass="menulink" />
<SelectedNodeStyle CssClass="menulink" />
</asp:TreeView>
<br /><br /><br />
ID:
<asp:Label ID="lblMenuId" runat="server" Text="Label"></asp:Label>
<br /><br />
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</asp:Content>
TestMenu.aspx.cs:
public partial class TestMenu : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
try
{
DALMenu menu = new DALMenu();
if (menu.EditGetTopMenu(MenuTree) == Status.Success)
{
}
}
catch
{ }
}
}
protected void MenuTree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (e.Node.Depth == 0)
{
try
{
DALMenu submenu = new DALMenu();
submenu.EditGetSubMenu(e.Node);
}
catch
{ }
}
}
protected void MenuTree_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
try
{
int key_id = Convert.ToInt32(e.Node.Value);
lblMenuId.Text = key_id.ToString();
if (e.Node.Depth == 0)
{
TreeView t = (TreeView)sender;
for (int i = 0; i < t.Nodes.Count; i++)
{
if (t.Nodes[i] != e.Node)
{
t.Nodes[i].CollapseAll();
}
}
}
}
catch
{
}
}
protected void MenuTree_TreeNodeCollapsed(object sender, TreeNodeEventArgs e)
{
try
{
int key_id = Convert.ToInt32(e.Node.Value);
lblMenuId.Text = key_id.ToString();
}
catch
{
}
}
private void ExpandNodes(string valuepath)
{
string[] tmp = valuepath.Split('/');
string tmpValuePath = string.Empty;
for (int i = 0; i < tmp.Length; i++)
{
if (i == 0)
tmpValuePath = tmp[i];
else
tmpValuePath += "/" + tmp[i];
TreeNodeEventArgs e = new TreeNodeEventArgs(MenuTree.FindNode(tmpValuePath));
e.Node.ChildNodes.Clear();
e.Node.PopulateOnDemand = false;
MenuTree_TreeNodePopulate(MenuTree, e);
MenuTree.FindNode(tmpValuePath).Expand();
MenuTree.FindNode(tmpValuePath).Selected = true;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
ExpandNodes("s19//24");
}
}
Kind regards,
simsen
|
|
|
|
|
|
You will have to use the onclick event of the textbox and call a javascript function that will set the text of the textbox to ""
onclick="make_blank();"
<script>
function make_blank()
{
var textbox = document.getElementById("")
if(textbox!=null)
{
textbox.value="";
}
}
</script>
modified on Monday, June 23, 2008 2:28 AM
|
|
|
|
|
onclick event of textbox .. is Sure? if yes where is it ?
|
|
|
|
|
Modified my previous post.
look it over
|
|
|
|
|
onClinetclick="make_blank();"
rajeshprajapati
|
|
|
|
|
Rajesh B Prajapati wrote: onClinetclick="make_blank();"
Don't you mean onClientClick="make_blank();"?
onclick also works as far as i know
|
|
|
|