I want to bind a field in a View to a property in a ViewModel. The object is "Program" and has the properties "Name" and "Level". So the user should be able to set the name of a program and the level of experience he/she has with this program.Program is a table in an Sql Server database, and is accessed through Entity Framework. So it would be easy enough to bind the Level property in the ViewModel to a textbox:
@Html.TextBoxFor(model => model.Level)
But I want a dropdownlist with a limited number of levels (1-5). So how do I do this and still have the dropdownlist bind to the ViewModel property?
I want to use a Tree view with multiple check boxes in Asp.net with c#.I used "ShowCheckBoxes" properties of tree view to display node, these node are actually modules name of the project.
<b>But I have to add two more checkboxes in each node to giving Edit and Delete Permissions of the modules.</b>
I am using the cascading dropdownlist controls from the Ajax toolkit. I have everything working perfectly and all of my select changes work. I have 3 related select boxes that all work great for single item select. What I need is for my last dropdownlist to allow for the selection of multiple items. I have tried adding the 'multiple' attribute to the final dropdown list and it allows the selection of multiple items but I cannot get the items when I post back, just a single item.
I have two control page in my aspx page. first one left side "tree view",second one right side " form design".Form design will change based on tree view selected index changed.i have 4 level child node(site, master , slave, space). I have seperate forms to each level of node.
cannot update tree node when update the forms. so i reload tree view.
now i need how to auto selected index change to tree node.
ex.
1 parent node
1.1 child node
1.2 child node
i have update "1.2 child node" rename to "1.3 child node"
and reload treeview so it will chage...
how set tree node.selected index = 1.3 child node....
I have a combo box that looks great in the designer, the list of choices are perfect. But when I view the ASP code, or the published webpage the choices are seriously garbled. I have tried adding items, but it does not seem to regenerate the code. Any ideas why it happened and what I should do? I do most of my editing through the designer GUI. Note the blank items and even items mixed up together: TVCricket
asp Code: <asp:DropDownList ID="ddlFoundOut" runat="server"> <asp:ListItem Selected="True">(Pick how you found out about us)</asp:ListItem> <asp:ListItem>Another Store</asp:ListItem> <asp:ListItem>Banner at Arena</asp:ListItem> <asp:ListItem>TVCricket</asp:ListItem> <asp:ListItem>West NewsmagazineClear</asp:ListItem> <asp:ListItem>Driving By</asp:ListItem> <asp:ListItem>Friend/Co-worker</asp:ListItem> <asp:ListItem>Internet</asp:ListItem> <asp:ListItem>Mall Sign</asp:ListItem> <asp:ListItem>Online Phone Book</asp:ListItem> <asp:ListItem>Phonebook (paper)</asp:ListItem> <asp:ListItem>Radio</asp:ListItem> <asp:ListItem></asp:ListItem> <asp:ListItem></asp:ListItem> <asp:ListItem>Other</asp:ListItem> <asp:ListItem>Other Magazine</asp:ListItem> <asp:ListItem>Other News Paper</asp:ListItem></asp:DropDownList>
On this page: http://vucsyd.dk/kursus/web/TilmeldingEksamenTest.aspxe.g. student number: 10629 kan mark rows and make choices in dropdownlistsBy next visit i i would like the page to show earlier choises. Do i have to change everything or is there an easy option?Site code:
That out of the way, here's my situation: We are looking to port our existing classic ASP application to .NET, but we're unsure of what language to use for the new app.
I personally would 'prefer' C#, as I'm more familiar and comfortable with that languages way of doing things, but, the original code is VBScript, so it would possibly be easier to port to VB.NET ... One possible situation I fear would be that, because the code is so similar between the two variants of VB, that we might end up getting stuck on something that is not similar between the two, even though it looks like it would work. A shift to a wholly different language might avoid that kind of situation.
Does anyone have any practical examples of this kind of situation? Insights to illuminate the issue with? Do the potential benefits of a complete paradigm shift outweigh the gains from a high degree of 'copy-and-paste-ability' ?
I have a general question regarding usercontrols' parameters. In the built in web controls, such as the 'runat' parameter, when you begin to type 'runat' in Visual Studio, it gives you an Intellisense choice of 'server'. Or in the RequiredFieldValidator controls, the 'Display' parameter has 3 choices: Dynamic, None, and Static.
My question is, how do I incorporate this feature into my custom Usercontrols?
For instance, I created a usercontrol with a parameter called 'BorderColor'. This parameter will change a textbox's border color to the specified value. The possible values are: Blue, Red, Green, Black, Purple, etc. How do I have Intellisense display these choices when the BorderColor parameter is typed in?
I am working on an ASP.net Forms Application that keeps track of information about different offices in an organization. The offices are organized into a hierarchy.
Some users of the program will have access to certain information about all offices in the hierarchy. Some users of the program will have access to only a small part of the hierarchy.
When a user browses for information they are authorized to see, I would like to present the user with a prompt to choose which office in the hierarchy they wish to see information from.
I want to accomplish the following:
A) I want the user to be able to easily navigate the hierarchy of the organization to locate a specific office.
B) I want the user to be able to navigate the hierarchy without refreshing the page.
C) I want my interface to be able to handle a hierarchy at least four layers deep with less than 100 nodes.
I see that Microsoft includes a TreeView control in the standard collection of ASP web controls.
I am listing about 20 rows, each row represents an Order.Each row needs to have 3 buttons, each button click will perform a different action.I have 3 actions to handle each button post request, I am just unsure how to setup the Html forms for each button.
Should I create 3 forms for each button, per row in my listing?(that would mean 20 rows x 3 forms = 60 forms on a page)Is that 'ok' to do? (i.e. or is there a better way to do this?)
I have a form which inserts data in DB on Submit button click but the problem is when client click the button multiple times its sends multiple create requests means multiple button click events for the same time of same data, which must not be.
I tried to disable the button when client click the Submit button first time but after this it does not call server click event handler or not fire the server click event once it got disabled.
I'm not expecting a full solution here (unless you really want to), just some tips and pointers.
I have a User table and an Area table. The User table has userID, userName etc., and the Area table has areaID, areaName etc.
I'm binding the list of Areas to a checkboxlist where the user MUST choose between 1-3 options. I'm using a stored procedure to update the DB.
Is there a common solution to this problem that I haven't found?
I have thought about saving it as a comma separated string in a field in the user table. This looks like a temporary and ugly solution though, do you think?
A nicer solution would be to create a UserArea table where I save the ID's as foreign keys from areaID and userID. But I don't know how to write this stored procedure where I update and insert the choices made.
I am using AppCode and have 6 arrays of information I want to display on my web page. However I only want three to be visible at any one time. ________________________________ | | | | | | | | ________________________________ button button button
i.e. a table like the above.
I have created the layout and the choice buttons etc I am using querystrings to pass the changes to the webpage.
The problem comes however when trying to write the code for the table diplay. Now each has a slightly different layout.
My initial thought was to write a function within the aspx/html page for each table, then in each column of the master table one of the functions can be called to populate it. Each of the functions will contain the HTML tagging for that information. However I dont seem to be able to achieve this as when I try to right a sub or function it doesn't like it. I have also tried to write the functions into the code behing but again this didnt work.
I have an application that needs to render a page that will have multiple Radio Button Groups as well as multiple CheckBoxes. The desired layout is determined by a database table.
This table defines a "Package". The "Package" can contain many different "Items" that require different controls used in the View. The "RadioGroupName" field is used to mark which RadioButtons should be grouped together. The "ViewControl" field marks which control should be used on the View to display the field. The query in my repository will return a result set such as
Given this result set, I need to render the view as follows:
A RadioButton group with 3 options (Item1, Item2, Item3) A CheckBox (Item4) A CheckBox (Item5) A RadioButton group with 3 options (Item6, Item7, Item8)
I have read that it is possible to use "if" conditions and looping structures inside the View. I have also read that this is a bad practice. Another issue I see is knowing which Item has been selected from each RadioButton group when I hit the Controller POST function. Previously I have built a page that has a single RadioButton group. My ViewModel was as follows:
If I want to be able to have a table Consultant, which is the user and their personal information, and I want this user to be able to select their proficiency in a number of Programs (software) on a scale from 0-5 (zero being no experience whatsoever), how do I do this best?
I mean I could have a Consultant table with a one-to-many relationship to a Program table, and then have all the limited Programs availalbe loaded by an XML file or something, and for each Consultant associate all the Programs and their Levels of proficiency. But that seems very wrong and inefficient.
It seems to me I should have a table with all the (limited number of) Programs, and then by some sort of association between the two by Ids. But I can't get my head around how to do this. I'm thinking many-to-many... But first, is this correct? Secondly, how do I do this in an Entity Framework Model? I usually create my database code first, i.e. create the EF model, and then generate database from model. Will I get a junction table where I can add the Level field, because basically a Consultant HAS A Program with a Level, or actually a list of Programs each with a Level.
I'm creating my first server control, and have it working where I can set up an enum and the user can set a property's choices, based off of that enum. But I'd like it to pull records from a database and populate the list of choices for the property from a database. This would allow me to add a new "Host System" to the database, and the other designers wouldn't have to get a new copy of the dll.
Alright, I am completely baffled by this one. When filling out this page in IE8, it will SOMETIMES clear all entered data (including radio choices) when you select Yes, No, or Not sure (line 892 in the code). This is a postback question, as it should potentially show more questions. This problem does not happen in any other browser, and rarely in IE8. I have no idea what is causing it, the code I am using has been used in similar applications and I can't find any change which results in this behavior.
The full code can be found here: http://pastebin.com/a12cPzyF
I need to display multiple columns in a dropdown or gridview in a dropdown and have user select a row and retrieve its value.Does some one have ASP.net code for it?I can't use Ajax
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 requirement to allow users select multiple "Agencies" and populate the "Types" based on that selection. Cascading Drop down would have been a great fit if there is no mutliple selection involved. I am wondering if I could use a popup dropdown with chekcboxes. However, these checkboxes need to be populated dynamically by a web service. I am not very familiar with AJAX toolkit and what control would work best in this case.
I have a webpage used to document work performed on a job. There can be as many as 6 employees for every line of work documented and I have placed 6 ddl's which are all populated with the same list of employees along with 6 text boxes for the hours. I loop through each ddl in the code behind to add the work performed to the server but I'm thinking there must be a better way to do this. I'll add the code for the first two ddl's so you can get an idea of what I need to do.