<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[ASP.NET] DropDownList (Selected Value)]]></title><description><![CDATA[<p dir="auto">Ciau a tutti....<br />
sono dinuovo qui per chiedervi aiuto ...vi espongo il mio problema.....<br />
In una pagina web in aspx visualizzo dei dati presi da un db , questi dati li visualizzo in base al mese di riferimento e permetto di sceglierlo....con una<br />
DropDownList ...vi posto il codice presente nell'aspx:<br />
&lt;asp:DropDownList EnableViewState=True id="DropDownList1" runat="server" style=" MARGIN-LEFT:65px;margin-top:50px;"&gt;<br />
&lt;asp:ListItem Value="1"&gt;Gennaio&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2"&gt;Febbraio&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="3"&gt;Marzo&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="4"&gt;Aprile &lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="5"  Maggio&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="6" Selected="True"&gt;&gt;Giugno&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="7"&gt;Luglio&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="8"&gt;Agosto&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="9"&gt;Settembre&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="10"&gt;Ottobre&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="11"&gt;Novembre&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="12"&gt;Dicembre&lt;/asp:ListItem&gt;<br />
&lt;/asp:DropDownList&gt;<br />
&lt;asp:DropDownList id="DropDownList2" runat="server"&gt;<br />
&lt;asp:ListItem Value="2004"&gt;2004&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2005"&gt;2005&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2006"&gt;2006&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2007" Selected="True"&gt;2007&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2008"&gt;2008&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2009"&gt;2009&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2010"&gt;2010&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2011"&gt;2011&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Value="2012"&gt;2012&lt;/asp:ListItem&gt;<br />
&lt;/asp:DropDownList&gt;</p>
<p dir="auto">dove seleziono a true il mese e l'anno che voglio che venga visualizzato per primo....<br />
il mio problema è il seguente.....:<br />
voglio fare la stessa cosa da .cs ossia non mettere Selected="True" nell'aspx ma farlo da cs come posso fare....non ho trovato da nessuna parte l'istruzione esatta  con la seguente :<br />
DropDownList1.SelectedItem.Value<br />
selezione un mese già settato....ma io voglio settarlo in cs come posso fare qual'è l'istruzione esatta ....<img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--cry" style="height:1.4em;width:auto;vertical-align:middle" title=":cry:" alt="😢" />aiuto<img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--cry" style="height:1.4em;width:auto;vertical-align:middle" title=":cry:" alt="😢" /></p>
]]></description><link>https://dev.connect.gt/topic/37712/asp-net-dropdownlist-selected-value</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 09:51:18 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/37712.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 Jun 2007 08:46:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [ASP.NET] DropDownList (Selected Value) on Fri, 08 Jun 2007 16:41:08 GMT]]></title><description><![CDATA[<p dir="auto">Impossibile, deve funzionare per forza. Forse hai usato nomi diversi.</p>
<p dir="auto">Se la dropdown si chiama id="drop1" allora nel pageload devi mettere drop1.selectedvalue=tuovalore. Dove, ovviamente, "tuovalore" è un numero che corrisponde al mese (1 o 2 o 3...etc. etc.)</p>
]]></description><link>https://dev.connect.gt/post/529373</link><guid isPermaLink="true">https://dev.connect.gt/post/529373</guid><dc:creator><![CDATA[fusionman]]></dc:creator><pubDate>Fri, 08 Jun 2007 16:41:08 GMT</pubDate></item><item><title><![CDATA[Reply to [ASP.NET] DropDownList (Selected Value) on Fri, 08 Jun 2007 13:50:16 GMT]]></title><description><![CDATA[<p dir="auto">ho provato a inserire l'istruzione nel pageLoad ma mi da errore.....:<img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--cry" style="height:1.4em;width:auto;vertical-align:middle" title=":cry:" alt="😢" /><br />
<em>Method not found: Void System.Web.UI.WebControls.ListControl.set_SelectedValue(System.String).</em><br />
<strong>Description:</strong> An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
<p dir="auto"><strong>Exception Details:</strong> System.MissingMethodException: Method not found: Void System.Web.UI.WebControls.ListControl.set_SelectedValue(System.String).</p>
<p dir="auto">**Source Error:**An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.<br />
<strong>Stack Trace:</strong></p>
<p dir="auto">[MissingMethodException: Method not found: Void System.Web.UI.WebControls.ListControl.set_SelectedValue(System.String).]   xenia.tabella_spons.Page_Load(Object sender, EventArgs e) +0   System.Web.UI.Control.OnLoad(EventArgs e)   System.Web.UI.Control.LoadRecursive()   System.Web.UI.Page.ProcessRequestMain() Cos'ho dimenticato...devo ancora mettere qualcosa????io ho scrittoDropDownList2.SelectedValue="2007";<br />
<img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--cry" style="height:1.4em;width:auto;vertical-align:middle" title=":cry:" alt="😢" /></p>
]]></description><link>https://dev.connect.gt/post/529375</link><guid isPermaLink="true">https://dev.connect.gt/post/529375</guid><dc:creator><![CDATA[manuminu]]></dc:creator><pubDate>Fri, 08 Jun 2007 13:50:16 GMT</pubDate></item><item><title><![CDATA[Reply to [ASP.NET] DropDownList (Selected Value) on Fri, 08 Jun 2007 13:28:52 GMT]]></title><description><![CDATA[<p dir="auto">DropDownList1.selectedValue=tuovalore</p>
]]></description><link>https://dev.connect.gt/post/529374</link><guid isPermaLink="true">https://dev.connect.gt/post/529374</guid><dc:creator><![CDATA[fusionman]]></dc:creator><pubDate>Fri, 08 Jun 2007 13:28:52 GMT</pubDate></item></channel></rss>