Web Forms :: DataList Pagination - Show Product Related To Selected Item From DropDownList
Aug 6, 2012
I have
1-datalist (that use pagination)
2-dropdownlist
3-button=Ibtnselect1 in my page
and these are my table in database
HOuse_info table
Id Behcode Region name
1 1115 1 Store1
2 1116 2 Store2
3 1117 2 Store3
4 1118 5 Store4
House_p table
Id Behcode Name Description Model
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,
[Code] .....
View 1 Replies
Similar Messages:
Mar 18, 2010
I have a table with product codes and items related to the codes.
TABLE 1
Product Codes | Item Number
RP WOEWPOI
Y OWRT0W
ZZ LDSFLSGKK
I have created a second table which contains a product group. This table holds information on where the Product Codes belong. I'm not sure if I have designed this table correctly.
TABLE 2
Product Group | Product Codes | Product Codes1 | Product Codes2 |Product Codes3 .........etc etc
Tin RP TL ER AS
Metal Y ZZ
Water EF TY AS
Coffee OP RC
My aim is to create a report in where I know a particular item is related to a certain Product Group. I'm not sure if I'm going about it the right way though. I need to know how to link it if it's one to many or many to many or...I really don't know.
View 5 Replies
Aug 22, 2012
these are my table in database
HOuse_p Table
Id
Behcode
Name
H_name
[Code]....
now in house.aspx page i have label
i want when users click item in index.aspx or click item from menubar in house.aspx (they bind from different table) in label show the name of item(related to users selected from index.aspx or house.aspx)
if they click item from index.aspx it show name column from House_menu tabel .
and if they click on menu bar item in house.aspx in label show classification column data from House_p table
View 1 Replies
Jul 16, 2012
I bind dropdownlist in my page
protected void Page_Load(object sender, EventArgs e) {
BindDropDownList(DDL1, "city1", "name", "ID");
DDL1.Items.Insert(0, new ListItem("select city", "0"));
}
And SP
LTER procedure [dbo].[city1]
as
begin
select id,Name
from city
end
And design code
<asp:DropDownList ID="DDL2" runat="server" CssClass="daddsd">
</asp:DropDownList>
And here is imagebutton code that when click on it update data into table
protected void ImageButton_Click1(object sender, ImageClickEventArgs e) {
string data = Server.UrlDecode(Request.QueryString["BehCode2"]);
SqlCommand _cmd = new SqlCommand("insertinfo", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
[Code] ....
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.
View 1 Replies
Aug 12, 2012
I have 2 dropdownlist in my page
1-ddlzone1
2-ddlstore1
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
View 1 Replies
Apr 5, 2010
I have created one web page in asp.net in which i have used datalist in the datalist there is one dropdownlist and one linkbutton. i have to find dropdown selected value on link buutons click events.
i tried a lot of code but i din't get i used fincontrol method. but not geeting how to get this.
View 10 Replies
Jul 7, 2010
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
[code]....
View 4 Replies
Feb 3, 2010
i use a dropdownlist in a page, with its items taken from a mysql database
i also use autopostback property...my problem here is that, every time i selecct an item, the first item in the list gets seelected
View 5 Replies
Feb 12, 2010
how to get the selected item in datalist? For eg, I'm displaying a list of food items in a datalist with food name, price, type, a button(Click to order). Now I wanted to click on the selected button and get that specific food name, price & etc from the datalist.
View 1 Replies
May 7, 2015
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.
View 1 Replies
May 7, 2015
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);
[Code] ....
View 1 Replies
Aug 10, 2010
[Code]....
show DataList Item Index when using SqlDataSource?
View 4 Replies
Jun 9, 2010
I would like to be able to pass a new value into a dropdownlist control from another webpage and cause an autopostback to occur. How can this be done?
View 27 Replies
Feb 23, 2014
based on the below image, May i know how if tick the checkbox, then will hide the selected data value only.
Example, hide "a", then will hide "a" data value only.
View 1 Replies
Aug 18, 2012
I have 2 dropdown list in my page
1- ddlzone1
2- ddldistrict1 and one button (search)
At first I select item from ddlzone1 click on search button according to below SP it search on database and show result...
ALTER procedure [dbo].[GetCustomersPageWise]
@PageIndex INT = 1
,@PageSize INT = 5
,@RecordCount INT OUTPUT
,@Region nvarchar(10)
,@District nvarchar(20)
[Code] ...
Now I want when users select item from ddlzone1 after that if they select item from ddldistict1 according to their selected item from ddlzone1 and ddldistrict1 it search in table and show result
Now how I can change my SP
I changed below code in SP but it didn't work
WHERE ([HOuse_info].Region = @Region or @Region='0') or ([House_Info] .District=@District or @District='0')
SELECT @RecordCount = COUNT(*)
View 1 Replies
Apr 22, 2013
I have dropdownlist in my page
In Page_load page I wrote below code
if (!IsPostBack) {
DDL1.Items.Insert(0, new ListItem("select city", "0"));
DDL2.Items.Insert(0, new ListItem("select region", "0"));
DdlDistrict.Items.Insert(0, new ListItem("select district", "0"));
}
And in this page I have btnInsert that when users click on it, it insert data in database
I want when users click on button all textboxs text be clear and all DDL selected Item clear so I set below code in btnInsert event
protected void imginsert_Click(object sender, ImageClickEventArgs e) {
SqlCommand _cmd = new SqlCommand("insertFreg", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@address", txtsdd.Text);
_cmd.Parameters.AddWithValue("@Aname", txtAname.Text);
[Code] .....
But here when I click on button it clear textboxs text but it didn't do any thing on Dropdownlist i.e
If I select 'Paris' from DDL1 when I click on button I want It show in ddl1 'Select city'
But it show 'Paris' again
What should I do?
View 1 Replies
Mar 4, 2013
I have one dropdownList=DDLtradeO and one button=btnsubmit In Admin.aspx page
and I have House_info table that one of column's is T_name
here I want if users select State from DDLtradeO , in House_info table in T_name column insert "STATE"
and if users select other Item from DDLtradeO in T_name column insert "STORE"
so in behind code I wrote below code
protected void btnsubmit(object sender, ImageClickEventArgs e)
{
string T_name = DDLtradeO.Text == "State"?"State":"Store"
SqlCommand _cmd = new SqlCommand("registerspecial", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@T_name", T_name);
_cn.close();
}
but here when I click on State Item or Other Item from DDLtradeO in both case it insert "STORE" in table
View 1 Replies
Aug 12, 2012
i have dropdown list in my page that bind it from database
BindDropDownList(DDL3, "Guidcenter", "Centername", "ID");
DDL3.Items.Insert(0, new ListItem(" select all", "0"));
here when users don't select any thing from dropdown list in data base insert 'select all' text but i want if users don't select any thing from DDL in database insert NULL.
View 1 Replies
Dec 2, 2010
I have a code to add item to dropdownlist but it shows the value only. I want an alternative text to appear for user. How to modify this code ?
DropDownList4.Items.Add(item:="%")
Now % is doing the job but I want the use to see the text "ALL" in the item of the dropdownlist.
I tried DropDownList4.Items.Add(item:="%,ALL") etc but failed.
View 3 Replies
Jan 23, 2010
I have a bunch of dropdowns in a gridview and I populate them through a datasource.On the databound event i need to change the selected item to the actual selected value from db.
[Code]....
[Code]....
View 7 Replies
Sep 2, 2012
i have 2 page
1-index.aspx
2-state .aspx
when users click on menubar in index.aspx they go to state.aspx in State.aspx is gridview with 6 Dropdownlist that occording to their selected item from DDL they can see result in gridview
now my problem is :
when i click item from menubar in index.aspx when it go to state.aspx it doesn't show any thing in gridview.
i want at first when users go to state.aspx page they can see all data in gridview after that they select item from DDL and see result according to their selected item
SP
ALTER procedure [dbo].[ViewEstate1]
@Type nvarchar(20)
,@Transfer nvarchar(20)
,@measure varchar(20)
,@Zone nvarchar(50)
,@City nvarchar(20)
,@District nvarchar(30)
[CODE]...
View 1 Replies
Dec 6, 2013
I use DropDownList in my page.I want when I select Item from DDL it changed selected Item's color that show in DDL..How I can do it?
View 1 Replies
Feb 20, 2011
I have one label and one dropdownlist which contain "red" and "blue". When I select "red" from dropdownlist, the label will display "You select RED" and if I select "blue", it will display "You select BLUE". The text is display immediatelly after selected without using BUTTON.
I have try to put the codes in Page_Load but not functioning, below is my code:
[Code]....
Can anyone guide me how to do this and I'm using C#?
View 2 Replies
Mar 20, 2010
i have a dropdown list control which gets data from a database. how do i assign a value to each of the item.
View 3 Replies
Feb 24, 2014
Based on the image, how to select the value from dropdownlist, then tick the checkbox and update the value ?
View 1 Replies