Monday 15 July 2013

c# - ASP Dropdown list not changing the value -


First of all, I still find me down my web god I so posts, blogs, newsgroups and stacks of articles I have been working through and I am unable to fix my problem. This is similar to at least 10 different positions seen by me.

I have an ASP gridview, which acts as a demonstration and a select column. When you click on the selection, it throws the data in the description view. I have a field that needs to be a drop down box, but whenever I change the value and update the value that is sent to the command The original value is

Page Markup:

  & asp: TemplateField HeaderText = "Planner Name" & gt; & Lt; ItemTemplate & gt; & Lt; / ItemTemplate & gt; & Lt; EditItemTemplate & gt; & Lt; ASP: DropDownList ID = "cboCurrentPlanner" runat = "server" DataSourceID = "plannerDataSource" DataTextField = "planner_name" DataValueField = "planner_id" SelectedValue = '& lt;% # Eval ( "planner_id")% & gt;' AutoPostBack = "true" & gt; & Lt; / Asp: DropDownList & gt; & Lt; / EditItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; Asp: CommandField ShowEditButton = "True" /> & Lt; / Fields & gt; & Lt; FooterStyle BackColor = "#CCCC99" ForeColor = "Black" /> & Lt; HeaderStyle BackColor = "# 333333" font-bold = "true" ForeColor = "white" /> & Lt; PagerStyle BackColor = "White" ForeColor = "Black" HorizontalAlign = "Right" /> & Lt; / ASP: DetailsView & gt;   

SQLDataSource:

  SelectCommand = "vendor_key, vendor, Planner_name, road, select the city, State_country, Planner_id, country V_MAP_MarkerInfo where (vendor_key = @vender_ke) "Updtkmnd =" Map_usp_vebpdteplantovendor "Updtekmmandeepe =" Storedprosedure "Onupdting =" Mpdaetalsurs_updting "& gt; & Lt; SelectParameters & gt; & Lt; Asp: ControlParameter ControlID = "GridView1" name = "vendor_key" property name = "selected value" type = "int32" /> & Lt; / SelectParameters & gt; & Lt; UpdateParameters & gt; & Lt; Asp: parameter name = "vendor_key" type = "string" /> & Lt; Asp: parameter name = "planner_id" type = "int 32" /> & Lt; Asp: parameter name = "vendor" type = "string" / & gt; & Lt; / UpdateParameters & gt; & Lt; / ASP: SQLDataSource & gt; & Lt; ASP: SQLDataSource id = "plannerDataSource" runat = "server" ConnectionString = "& LT;% $ ConnectionStrings: vendor_mapConnectionString% & gt;" Select [MAP_planners] from SelectCommand = OldValuesParameterFormatString = "original_ {0}" & gt; [planner_id] [planner_name] "; & Lt; / ASP: SQLDataSource & gt;   

I will not post the stored procedure code, I know that it is working. The original value makes it easy for the price parameter only

I have tried all kinds of combinations of and ### Bind / eval ()% & gt; Postbacks But I'm not getting the right combination.

When I click on the selection, I want the current planner to be selected in the dropdown list. When I select a new Planner and click Update, I would like Planner to update. I am not sure why this is so difficult or I have made it difficult for this, but I am at the end of my mind, if possible, I would like to know what is happening and not just that magical line code Which does this work.

There is a particular badge.

EDITS: Wustaitianbag ટેડ = "true" has been added to the dropdown list, selected index has changed event is firing

Re-edit: & lt; Asp: ControlParameter & gt; DetailsView1_OnDataBind and MapDataSource1_updating and the value is in all places but I do not know why it is being reset. Set to EnableViewState = "false"

@ Control or @ Page settings? If visibility is not enabled, the control will always be the default value as the selected value. It can be set at the ASPX level or SSCX level.



No comments:

Post a Comment