Web Forms :: Load Time Vs # Items Graph For Dropdown List Boxes?
Jan 20, 2011
I've noticed that page load time increases dramatically as you load up a ddlistbox with items. 10,000 or so results in a pretty much unacceptable wait time for my setup. The dropdown I'm trying to load is Airports - like all of them. What are some alternative UI solutions that give the user the ability to easily select any (literally) airport, but without a ginormous page loading time? (Currently the dd is keyed to the airport's 3 letter code, so it's convenient for the prepared user to just type the 3-letter code and have the right airport selected. The display is then set to code, city, country.)
I have two dropdown list boxes I select the first one and I get the index value of what i selected say item number 2,Using that indexvalue I would like to acccess the second dropdown box and get the value of it Both boxes will have the same amount of items in it.
I got one web page which is developed by using Asp.net. and in that page I have got one tab control which developed by using Ajax control toolkit (tab container). In that tab container i have got three tab pannels. In the first tab pannel have got two drop down list boxes and one image control box. wat I was trying to do is that by using calendar extender control in ajax control toolkit i was trying to display a day in the first drop down list box and month and year in second drop down list box. when user click on image control during run time a small calender will pops up and then user will select the propective date according to there choice and when they have finish selecting the date from the calender a day will display on first drop down list box and month and year will display on second drop down list box.
I was keep trying to do that but i was failed. then i took one test box from the toolbox and i was got success in displaying the user selected date in the text box by using ajax calender extender. How to display that date instead of one textbox into two separate drop down list boxes from which a user can select manual date from drop down list as well and from the calendar as well also when the page loads, the two drop down list boxes must show current date ( by default)
I'm designing my own custom control that contains a .NET dropdownlist. What I'm wondering is if it is possible to populate my dropdownlist with listitems placed in a placeholder? For example:
This doesn't work because the DropDownList control only allows ListItems as child controls. But, I want to do something similar to this so when the user includes my control on a page, they can do something like this:
I have a drop down that lists all our 40+ locations.. I then have a list box with all our locations as well. The client is presented with the question which locations have you worked at before. If they pick say 3 locations, i need to remove or disable those 3 from the drop down. I have other code for creating a drop down, but not sure where to go with this.
I have a DropDownList inside the EditTemplateItem (if the user clicks edit) in a GridView.The DropDownList receives all available rows from the database. My problem is,if the user clicks Edit in the GridView to edit a row and opens the DropDownList Box the original item is not selected but the first one.That means the items are sorted. Have someone an idea how I can solve this issue that the right item / the original is selected if I change to edit mode of the grid view?
On my website, registered users can make a profile about themselves suchas name, Favoirite color, hobbies, etcI have a DataTable called User which hold this information.also there are other datatables for Hobbies and Colors which list all possible options.To let the user update their choices I have a FormView in Edit mode on the aspx page whichis binded to the UserTable with a GetProfileByUserId Method and objectdatasource.
Within the formview, i have added drop down lists that are binded to the hobbies and Colors tables so they can edit their previous selection.On clicking Uodate update formview calls an Update Method that adds new selections to the User databaseNow I have two questionsIs it possible to show in the dropdown list the selected value that the User has already made?If the user only changes hobbies and not colors when they click update will a null value be passed into the data table for colors that replaces their previous selection?
I have a page with 14 dropdown lists. In the first page load (ie. not isPostback) I set the selectedIndex of the dropdownlists individually but I find that they are all set to the value I use for the last dropdownlist set. Here is the code
comboFirstJudge1.SelectedIndex = 0 comboFirstJudge2.SelectedIndex = 0 <so on for all the dropdown lists until the last one> comboFirstJudge14.SelectedIndex = 4
The result is that all dropdown lists have SelectedIndex = 4. If I run the same code on a postback it works just fine (the first lists have SelectedIndex = 0 and the last one = 4).
I am running into some additional difficulties with dropdown lists, and I'm hoping you can correct my thinking.
I have a table populated with items; ITEM_ID, ITEM_NAME, ITEM_COST.
Here is my code:
[Code]....
With this code I get this error: DataBinding: 'ITEM' does not contain a property with the name '2'.
If I remove the assignment of DataSource to c1, the dropdown generates this error: 'DropDownList3' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
How should I code this so that the user is presented with a list of ITEM_NAMES, and that the ITEM_ID is stored in the value field so I can use it when the selection event is fired? I know I could databind the source directly to the dropdown list, but I am trying to understand the behind the scenes working of a dropdown list object.
I have a dropdown control that has a list of names in it called PlayerNameDropDownList_Insert and a textBox called PlayerName.
When I select a name from the dropdown it populates the textbox correctly.However, when the page opens the first name is selected in the dropdown but nothing in the textbox. How can I get the textbox to populate with the value of the dropdown at pageload?
We are developing our application on a 64 bit server. We are using a dropdownlist to filter and display departments in a htmltable(hide and show rows) on every selectedindexchanged event.
The issue is it is firing properly for the first time, but it is not doing a post back there after. We have even given autopostback=true. We are using AJAX for hiding and showing the rows of the htmltable.
So I have a number of dropdown select list controls populated as part of a repeater. They might contain overlapping data, meaning that the first d d list control will have selections:
a b c
Second one:
c d e
Third one:
d e h
and so on.
So what I would like to do is to srart removing the duplicate items from the reset of drop down controls once the user starts selecting those. I intend to use jQuery for this.
i have two drop down list in web form..for both of them i've used following code to bind with sql..but whenever i'm trying to bind second drop down list with same method..it's giving error.. the code i've used:
I am stuck at this point "Displaying a dropdown list of Categories with a --None -- Option. I want the gridview control to display 2 dropdown list one in read-only mode and the other in edit mode. When a record is in read-only mode, the dropdownlist's enabled property will be set to false."When it's on a read-only mode, it doesn't display the selected Category. it shows but the "No Category". When i click on edit to edit or change category, it doesn't display the selected category.
The example is given below( I am reading the book Sams Teach yourself ASP.NET 2.0 by Scott Mitchell. page 628)
<asp:Label ID="UserIdValue" runat="server" Visible="False"></asp:Label> <asp:SqlDataSource ID="picturesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Pictures] WHERE ([UserId] = @UserId) ORDER BY [UploadedOn] DESC" DeleteCommand="DELETE FROM [Pictures] WHERE [PictureID] = @PictureID" InsertCommand="INSERT INTO [Pictures] ([UserId], [CategoryID], [Title], [Description], [UploadedOn]) VALUES (@UserId, @CategoryID, @Title, @Description, @UploadedOn)" UpdateCommand="UPDATE [Pictures] SET [UserId] = @UserId, [CategoryID] = @CategoryID, [Title] = @Title, [Description] = @Description, [UploadedOn] = @UploadedOn WHERE [PictureID] = @PictureID"> <DeleteParameters> <asp:Parameter Name="PictureID" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="UserId" /> <asp:Parameter Name="CategoryID" Type="Int32" /> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="Description" Type="String" /> <asp:Parameter Name="UploadedOn" Type="DateTime" /> </InsertParameters> <SelectParameters> <asp:ControlParameter ControlID="UserIdValue" Name="UserId" PropertyName="Text"/> </SelectParameters> <UpdateParameters> <asp:Parameter Name="UserId"/> <asp:Parameter Name="CategoryID" Type="Int32" /> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="Description" Type="String" /> <asp:Parameter Name="UploadedOn" Type="DateTime" /> <asp:Parameter Name="PictureID" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource> <br /> <asp:SqlDataSource ID="categoriesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [CategoryID], [Name] FROM [Categories] WHERE ([UserId] = @UserId)"> <SelectParameters> <asp:ControlParameter ControlID="UserIdValue" Name="UserId" PropertyName="Text" /> </SelectParameters> </asp:SqlDataSource> <br /> <asp:SqlDataSource ID="maxPictureIDDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT MAX(PictureID) FROM Pictures WHERE UserId = @UserId"> <SelectParameters> <asp:ControlParameter ControlID="UserIdValue" Name="UserId" PropertyName="Text" /> </SelectParameters> </asp:SqlDataSource> <br /> <asp:Label ID="cannotUploadImageMessage" runat="server" Text="The photo could not be added to your album either because you did not specify a file to upload or the file specified was not a JPEG image with the file extension .JPG"></asp:Label> <br /> <asp:DetailsView ID="dvPictureInsert" runat="server" DataSourceID="PicturesDataSource" Height="50px" Width="125px" AutoGenerateRows="False" CellPadding="4" DataKeyNames="PictureID" DefaultMode="Insert" ForeColor="#333333" GridLines="None"> <AlternatingRowStyle BackColor="White" /> <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" /> <EditRowStyle BackColor="#2461BF" /> <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" /> <Fields> <asp:TemplateField HeaderText="Picture"> <InsertItemTemplate> <asp:FileUpload ID="imageUpload" runat="server" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="imageUpload" Display="Dynamic" ErrorMessage="There was no file selected" ValidationGroup="PictureAdd"></asp:RequiredFieldValidator> </InsertItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Category" SortExpression="CategoryID"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CategoryID") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:DropDownList ID="pictureCategory" DataSourceID="categoriesDataSource" runat="server" DataTextField="Name" DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>' Visible='<%# Bind("CategoryID") %>' AppendDataBoundItems="True"> <asp:ListItem Selected="True" Value="">-- Select Category --</asp:ListItem> </asp:DropDownList> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("CategoryID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Title" SortExpression="Title"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="you must provide a name for the title" ValidationGroup="PictureAdd"></asp:RequiredFieldValidator> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("Title") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Description" SortExpression="Description"> <EditItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Description") %>'
I am new here so I will try and give you as much detail as I can:
(C# + SQL)
I am developing a web site that has holiday prices which are taken from a different database and loaded into two SQL databases.I have two girdviews to display each of the prices data.What my issues is that I need to load an SqlDataSource on database 1,when 'Family' is selected from a dropdown list and run an SqlDataSource on database 2 when 'Themed' is selected and then run both when 'Don't Mind' is selected.