| | |
abt ddl
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2007
Posts: 95
Reputation:
Solved Threads: 17
aspx
Code behind
Mark as fixed if it helps you!!!
ASP.NET Syntax (Toggle Plain Text)
<asp:DropDownList id="ddl1" runat="server" > </asp:DropDownList>
Code behind
ASP.NET Syntax (Toggle Plain Text)
ddl1.Items.Add(Format(Date.Today, "dd MMM yyyy"))
Mark as fixed if it helps you!!!
•
•
Join Date: Oct 2008
Posts: 5
Reputation:
Solved Threads: 0
thnx for ur reply n sorry bcoz am a fresher so i could not able to get u.could u plz tell me what it means?and my doubt is, does it generate d-m-y automatically? plz tel me any website or link related to this concept if poss. it's very imp n urgent sir.
thanks in advance,
============================================
thanks in advance,
============================================
•
•
•
•
aspx
ASP.NET Syntax (Toggle Plain Text)
<asp:DropDownList id="ddl1" runat="server" > </asp:DropDownList>
Code behind
ASP.NET Syntax (Toggle Plain Text)
ddl1.Items.Add(Format(Date.Today, "dd MMM yyyy"))
Mark as fixed if it helps you!!!
•
•
Join Date: Sep 2007
Posts: 95
Reputation:
Solved Threads: 17
if u mean explaination: then
First add an .aspx page then drag n drop ddl on page and set its property to autopostback = true. then
from design page double click the ddl its takes u to the code behind page where u will be coding. just find the Page_load event to add the
ddl1.Items.Add(Format(Date.Today, "dd MMM yyyy"))
First add an .aspx page then drag n drop ddl on page and set its property to autopostback = true. then
from design page double click the ddl its takes u to the code behind page where u will be coding. just find the Page_load event to add the
ddl1.Items.Add(Format(Date.Today, "dd MMM yyyy"))
Last edited by reach_yousuf; Nov 11th, 2008 at 9:11 am.
•
•
Join Date: Oct 2008
Posts: 5
Reputation:
Solved Threads: 0
sir,i did as u told but am getting 3 errors,those are:
Error 1 The name 'ddl1' does not exist in the current context
Error 2 The name 'Format' does not exist in the current context
Error 3 The name 'Date' does not exist in the current context
Error 1 The name 'ddl1' does not exist in the current context
Error 2 The name 'Format' does not exist in the current context
Error 3 The name 'Date' does not exist in the current context
•
•
•
•
if u mean explaination: then
First add an .aspx page then drag n drop ddl on page and set its property to autopostback = true. then
from design page double click the ddl its takes u to the code behind page where u will be coding. just find the Page_load event to add the
ddl1.Items.Add(Format(Date.Today, "dd MMM yyyy"))
•
•
Join Date: Sep 2007
Posts: 95
Reputation:
Solved Threads: 17
pls, c the code below
aspx page
code behind
aspx page
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:DropDownList id="ddl1" runat="server" AutoPostBack="True" > </asp:DropDownList> </div> </form> </body> </html>
code behind
ASP.NET Syntax (Toggle Plain Text)
Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ddl1.Items.Add(Format(Date.Today, "dd MMM yyyy")) End Sub Protected Sub ddl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl1.SelectedIndexChanged TextBox1.Text = ddl1.SelectedItem.Value End Sub End Class
•
•
Join Date: Oct 2008
Posts: 5
Reputation:
Solved Threads: 0
sir,thnx n i got output. But i wanted to display not the present date but i wanted d-m-y like calender.means,whatever the d-m-y we wanted,it will get selected by the user from drop down list. It may be today's date or previous or coming date I think i explained well.one more thing is i know only C#. u answered very patiently. i dont want to disturb u more.thnx.
•
•
•
•
pls, c the code below
aspx page
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:DropDownList id="ddl1" runat="server" AutoPostBack="True" > </asp:DropDownList> </div> </form> </body> </html>
code behind
ASP.NET Syntax (Toggle Plain Text)
Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ddl1.Items.Add(Format(Date.Today, "dd MMM yyyy")) End Sub Protected Sub ddl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl1.SelectedIndexChanged TextBox1.Text = ddl1.SelectedItem.Value End Sub End Class
![]() |
Similar Threads
- hai (Oracle)
Other Threads in the ASP.NET Forum
- Previous Thread: adding dropdownlist in calender control
- Next Thread: Load image in report in runtime in ASP.Net
Views: 590 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac chat checkbox child class compatible complex content contenttype control countryselector courier database datagrid datagridview datalist deployment development dgv dialog dropdown dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv folder form gridview gudi identity iis image javascript languages list maps menu mobile mssql nameisnotdeclared novell opera order problem profile ratings redirect refer registration relationaldatabases response.redirect rows search security select serializesmo.table sessionvariables silverlight smoobjects software sql ssl tracking treeview typeof validatedate validation vb vb.net vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment wizard xsl





