What I need is if I select default item i.e. 0 in Zone dropdown I need to show all items in store dropdown. Below is my stored procedure to get the stores
ALTER procedure [dbo].[selectcenter] @RegionID varchar(5) as begin select ID,Centername from Shoppingcenter where RegionID=@RegionID group by ID,Centername end
i have a web page, with some filters using dropdownlist, and when i select items from these dropdownlist, a gridview appear showing data from a sql server. The idea is that when i select an item, from the first or second drop down list, in a textbox appear for example the name of the item i choose from the dropdownlist.
1 1115 Iron Test Q2 2 1115 Vacumcleaner Test2 Cv21 3 1117 Carpet Test3 Xs23 4 1116 Furniture Test4 Df23
Region table
Id region 1 1 2 2 3 3 4 4 5 5
Here users product's information are inserted in House_p table and users inforamtion inserted on House_info table
when page is load in my datalist show all product from House_p table
and i bind dropdownlist from region table
here i want when users select their region from dropdown list in datalist show product that are in selected region according to house_info table
now when i select region from dropdown list
EX: i select 1
in my datalist in first page show all product that are in region=1
problem is :when i click on other page of my datalist it showed all product that are in House_p table but i want it showed product that related to my selected item from dropdownlist i means first page is enough i don't want after showing product related
sp
ALTER PROCEDURE [dbo].[GetProducts] ( @Region tinyint = 0 ) AS BEGIN SET NOCOUNT ON; SELECT distinct House_Info.BehCode,
I have a dropdown list which has states retrieved from a table. I want to have an option to add new states.. I have added a list item NEW in the dropdown. When I click on NEW i should get a pop up to add a new state and goes in the table.
Here when i click on button it insert all data into table but it didn't insert my selected item from dropdownlist it insert select city that i define in page_load
DDL1.Items.Insert(0, new ListItem("select city", "0"));
And when i delete this code from page load it insert in table first row of my table it didn't insert my selected item from dropdown list.
I need to add an item in a dropdownlist and also modify the value of that item, but im getting an error : "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"here's my Page load
Dim rt as new OleDbCommand("Select * from Question ", con) dim rd as OleDbDataReader rd = rt.ExecuteReader Dim a as new OleDbCommand("Select Count (*) as C from Question" , con) [code]...
I am using aspnet menu control and i want to hide the item initially on page load and show the item after an event is trigger say button lick event Can any one give me an example?
I have a project that queries a set of times from a database and uses these entries to populate a dropdownlist. Once the page is loaded, the user can select one of the items in the DropDownList. When the "Save" button is clicked, the Selected item value is returned to the [HttpPost] version of the controller action. This item is then stored into session. If the system returns to the page containing the dropdown, I want the saved Value to be selected in the DropDownList. What actually happens is that the DropDownList is always set to be the first item in the list.
Database Table: This data has been imported using Link to SQL
My DropDownList control is getting the information from an ObjectDataSource. I need the initial item showing on the DropDownList to be "Select an item" which is not in the database.
I have created some dropdownlists in the SelectedIndexChanged from another dropdownlist in a PlaceHolder1. Now I want to retrieve the value from the created dropdownlist
in the Button_Click1 method but I don't understand how I can achieve this.
The list items in lijst seem to be empty so I get an System.NullReferenceException; on line
I have items in a sql table that i populate a dropdown list with. so on page load the items are sent to dropdown list. I have a button on the page with the dropdown list that onclick it launches another page that allows more items to be added to the database table.
What I want to do is to refresh/update the list of items in the dropdown list when the second page is closed. In addition the last item added to the table will be the selected item in the drop down list.
I am inserting a new states in the table from dropdown list , the dropdown list has new in the list, clicking on new gets me a pop up which takes the new state and inserts in a table. My requirement is I want to get the last inserted state in the dropdownlist and its id to be selected as soon as insertion is done.
The second function is to insert the contact details where i have countryid,stateid,cityid
protected void stateSave(object sender, EventArgs e) { using (SqlConnection conn = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("newStates", conn); cmd.CommandType = CommandType.StoredProcedure; SqlParameter outparm = new SqlParameter("@stateID", SqlDbType.Int);
I have an optional DropDownList. If the user dosen't select any value the top most value is "0" unfortunatly the only way to send DBnull.Value to the database is check if the value is 0 and if it is then send dbnull. Is there a way you can do this within the dropdownlist without having to check for each and every dropdown?
I have a formview that when in insert/edit mode, has a dropdowlist and a linkbutton. The linkbutton opens a popup with another formview that allows the user to enter new items that are required to be added to the dropdownlist. When the popup closes, it adds any new items to the dropdownlist options (there may be more than one item added). The purpose is to prevent having to have my users partially add/update a record, go create a new item for the dropdownlist then have to come back and edit again since any new items won't be known until they are needed.
At first, I recieved the 'invalid postback or callback' warning and began reading up on the issue. Though there were several forum posts and web articles, most seemed a few years old so I thought I would find out if there were any subsequent changes that might help me out. I'm using vwd2005/ASP.Net 2.0 and do not have ajax (not available on my corporate web servers). In the page directives, I disabled EnableEventValidation but then I found that while other controls were updating, the value set in the dropdownlist was not and I had to make 2 edits anyway. Since new items in the ddl won't be around when it is rendered, i've read that I can't make use of registerforeventvalidation. ps. i have thought that i could save my viewstate, browse away from the page instead of use a popup, then restore the viewstate, but I'm concerned about being able to update the ddl while retaining the viewstate.
I have been having some trouble with dropdown lists reverting back to selecting the initial item in the list after a postback once a selection has been made from the dropdown list. I have read up on this and found out that a "if not ispostback then" is required.This works fine when I add in all the items in the dropdown list manually like:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then ddl1.Items.Add("Select...") [code]....
However, I have over 250 items and so it is far more efficient for me to load then in by using part of a multidimensional array which is created from a text file - Definitive database.txt. I have been using the following code to do so:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then 'loads the definitive database array[code]...
This loads all the items into the dropdown list perfectly, but now every time a selection is made, it reverts back to the inital item on postback even though i have included the "if not ispostback then" part.