Asp.net Mvc - Drop Down Troubles In .net Using VB And View Model
Jul 12, 2010
I am new to .net, I am just taking a shot in the dark through this whole thing. I have an Addresses table with a StateID and CountryID field. They refer to the States and Countries table. I am using LINQ to SQL and Visual Studio 2010.
[Code]...
View 1 Replies
ADVERTISEMENT
Apr 26, 2009
I am wondering what I am missing in the attached code that is making it impossible for me to make the VB.NET program below work using MVC (Model-View-Controller). Right now, I am really lost despite my best efforts...
I am trying to implement the observer pattern and think that my code is getting closer to MVC but not quite there yet, firstly because it wont even run ... nevertheless I know that there is someone out there who knows what I am doing wrong and I would definitely benefit from any guidance or help that someone more experienced in MVC VB.NET implementation can give .. hence this letter.
[Code]...
View 6 Replies
Jul 3, 2009
Does anyone have a good website for the basics of using Model View Control pattern with either vb.net or C#.
View 1 Replies
Jun 22, 2011
I have a view model with a property that exposes a collection of things.I have a ComboBox whose ItemsSource property is bound to this collection.Now the user can select from the list.I want to allow the user to clear the selection, so I want to add an item (that is Null) to ComboBox. It's pretty straightforward.
I decided to try and use a CompositeCollection for the ItemsSource so that I could add the items in the existing list to the ComboBox as well as the extra Null item.After fighting with this for a while I decided to return to the documentation on the CompositeCollection Class. I copied their example and the modified it to use a view model instead of Static Resources.
I discovered that no items show up in the list when I bind the CollectionContainer to the list exposed by the ViewModel.I'm not sure how to get around this problem and I'm looking for any advice on this topic.
Here is my XAML code:
[Code]...
View 1 Replies
Aug 10, 2010
I have an MVC application where all the data is tied together by VisitDate table in my database. The home page is a strongly typed view of type VisitDate, all it does is pull up some simple data. Now, here's where I'm having a problem. I need a link that passes the current model in the view back to a separate controller action so I can render a different page with different data. Here are my two controller actions. I'm going from News.aspx to FrontPage.aspx and hopefully passing SchoolVisit. [Code]
View 2 Replies
Jun 29, 2011
I am currently developing a service using the SharePoint 2010 Client Object Model to programmatically upload Excel worksheets to a Drop Off Library and then set the properties on the file. This process is working well. However, the Drop Off Library is governed by Content Organizer Rules that aren't being applied to the uploaded file. I have examined every property I thought I could have missed: [code] What's most frustrating is that if I edit the document properties using the Web UI and check it back in without making any changes, the file is moved to its final location. What might I have overlooked that is preventing Content Organizer Rules from being applied to newly uploaded files when using SP2010 COM?
View 2 Replies
May 27, 2011
I was just wondering, if I have a list view control, with 2 columns, and insert items to those columns, ex:[code]My GOAL is to NOT use a lot of listviews controls to interact from one col to another. Like a drag and drop function between multiple columns.I have found a lot of examples but they only are between from one listview to another.Have you tried This? I want to do this in vb.net.[code]and some more for the Itemdrag and dragenter events.
View 1 Replies
Sep 3, 2009
i want to be able to drag and drop list view items
View 11 Replies
Mar 25, 2010
What I want to know now is how to drag item from list view and drop it in image box.. with drag icon.I used to use vb.6 there is a drag icon.
View 4 Replies
Sep 10, 2009
When editing a code module, any methods marked as Obsolete do not (by design) show up in the top-right hand declration drop-down. (I've rasied this as a problem on another thread since it's causing me and other colegues a head-ache. Can I propose a VS setting to include obsolte methods would be a simple and useful enhancment.)
[Code]...
View 1 Replies
Nov 18, 2009
Im wondering how would i display the dropped items directory and icon in columns.
View 3 Replies
Jul 29, 2010
i have a treeview filled with directory structure, now want to drag some file name from treeview and drop it to GridView.
i tried with the Item_Drag event it works for drag only...but GridView's DropOver event doesn't work what can do ?
View 1 Replies
Oct 31, 2010
when I got home to try out the method in the above post in my real application things did not work out.The big difference is that my main form is a MDI. When I open my edit form, it's mdiparent is set to the main form. When I click 'edit' and then disable "me" the entire application goes modal.I was expecting only the MDI child to go disabled, not the whole application..Basically, I want only the MDI child window that opens it's "edit" dialog to go disabled..
View 1 Replies
Apr 15, 2011
I am using the following code to parse a XML file of mine:
Dim xml As String = "<?xml version=""1.0"" encoding=""Windows-1252""?>" & _
"<theref:theref-msg xmlns:csr=""http://www.xxxxx.com/Schema/csr""
xmlns:theref=""http://www.xxxxx.com/Schema/theref"">" & _
[code].....
View 2 Replies
Nov 7, 2009
I need to drag and drop to textbox from tree view. Here while drag and drop to text box i need to add the dragged text to anywhere in the text box which we have already dragged some nodes here.
For example.in treeview i have "node1" and "node2"now i am going to add "node2" to textbox and in front of "node2" i need to add "node1" and then at the end of "node2" again i need to drop "node1" like that.
View 1 Replies
May 26, 2010
im making a game for my assignment of snake. Vb10 Im coding 90% by teaching myself. Was just wondering if anyone has any idea how to help me. Im stuck with the array for making new pictureboxes and moving them to extend the snake here i some of the code.
Private
SnakeHead.Left = SnakeHead.Left + xDifference
SnakeHead.Top = SnakeHead.Top + yDifference
If SnakeBody(1).Left <> SnakeHead.Left And
SnakeBody(1).Top <> SnakeHead.Top Then
[Code]...
View 13 Replies
Apr 5, 2012
I thought that creating a simple system service under VB .NET would be a piece of cake. Boy, was I wrong. First, I find general postings through Google that say you should use the Windows.Forms.Timer. Then, I found conflicting information that says you have to derive the timer from a timer class through code to make it work. Then, people are reporting all sorts of trouble using the various types of threads available. I can't debug threads using the VS 2010 Just-in-Time debugger for obvious reasons (although, I don't know if there is an alternate method to doing this).My project is an application launcher (similar to cron) that will fire off periodically within a certain amount of seconds. I am trying to use the Process.Start() method. I have a Beep() function as the first instruction, and the Process.Start, along with a Process.WaitForExit method to make it block as the last instruction. I had my code doing this through timers, but now I am starting to use threads. No difference in execution. The over-ridden OnStart method does kick off (as I am certain through debugging), but nothing ever happens when starting the service in production, as if it were ignoring all my code. Putting loops and logic in the OnStart method yields a process that won't start. I know it is a threading issue, but I also know it must be mandatory to use threads. I am now dumbfounded as to how to make this work. I am curious to know the solution.
In addition to the service class, I have a ServiceInstaller and ProcessInstaller implemented that I copied verbatim from MSDN.Here is some of the code I am trying to work with. Note that this simply reflects the current state of my code in trying to implement the logic within a thread instead of a timer (which to me would be optimal):[code]
View 2 Replies
Apr 5, 2011
Is it possible to reorder the elements of a drop down list (combobox) via drag and drop?For example, when the list is dropped down, I want the user to be able to drag the items up or down to reorder them. I tried this (and some google searching) but I'm wondering if its just not possible:
Private Sub cmbClassLists_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles cmbClassLists.MouseDown
If cmbClassLists.DroppedDown And Not cmbClassLists.SelectedIndex = -1 Then
[code].....
View 2 Replies
May 9, 2011
ComboBox drop up instead of drop down..i want to defualt for a particular drop down box to work this way how can i do it.
View 6 Replies
Sep 1, 2011
Assuming an architecture as such.MODEL > BLL > DLL
Trying to implement lazy loading in my MODEL I have run into a circular dependency between my MODEL and BLL..Basically imagine a property in my model that I want to implement as follows
Public Readonly Property ProjectCategory As ProjectCategory
Get
If Me._ProjectCategory Is Nothing Then
Me._ProjectCategory = ProjectCategoryBLL.GetProjectCategoryByID(Me._ProjectCategoryID)
End If
[Code]...
I have my MODEL, BLL and DLL in separate projects and because of the fact that my BLL references my model I can not reference my BLL from my model as this would create a circular dependency.
View 3 Replies
May 24, 2012
I'm quite new to MVC and while I've been trying to follow the best practices , I believe I may not be understanding certain fundamentals of either
-a. Using models and viewmodels appropriately
-b. Passing models into a controller for validation purposes.
The general purpose of my program is to select a stored procedure from a list of stored procedures, create a form where the user can fill out all the appropriate input variables, and then to execute that stored procedure. The tool is for non-technical people, so I'm eventually going to have to do a good deal of input validation.
As such I have four models: A Script Model, a Parameter Model, a Parameter Enum model and a Query Model, and two viewmodels: a paramviewmodel that generates the form to fill out, and a scriptviewmodel that creates a listbox filled with the possible script choices. I am using a prewritten database system to fill out my viewmodels in an init method in my controller (which I'm not sure is the proper way to do this?).
The viewmodels are as follows:
Imports System
Imports System.Collections.Generic
Public Class ScriptViewModel
[Code]....
I'm trying to work out the functionality. Also, I think this may be too much code in the view, even though most of it is display code.
Anyways, I have two main questions. One, does creating a model in my controller, calling an init method on it, and then passing it to the view make any sense in an mvc context (if not, how would I proceed?). Two, if I want to perform validation on the form I output in my htmlhelper, but I want to use my query model validation (and not my paramviewmodel), how can I do that? Most of the examples I've seen involve a controller that recieves an appropriate model variable, and the binding is performed outside the controller itself. They then just check modelstate. Is there any way I could do something similar here?
Edit: Is there any way I can make the syntax highlighting less crappy?
View 1 Replies
Feb 13, 2011
I am trying to figure out the best way to implement a certain part of my model.I have an entity named Customer which has CustomerLocations (1-*) which have SalesOrders (1-*) which have Invoices (1-*).I want to allow them to have multiple addresses (Billing and Shipping) per customer and per location. I want to store those values in the sales orders and invoices, not a foreign key, what if they delete one of their addresses later down the road.I have tried complex types, but then they can't have multiple, can they? And having an Address entity, customer --> address (1-*) is ok, but a bit clumsy. How would you have a collection of billing and shipping addresses.?
View 1 Replies
Mar 16, 2009
I have a repository class that defines some basic Get/Save/Delete methods. Inside these, I use NHibernate to do the work on my business entities. For example:
[code]...
However, on my User class I have some properties and collections of other objects that ideally I'd like to be lazy loaded. But of course, the ISession is created and disposed within the repository, which I guess is why, outside of that, when I try to access those properties I get a "Could not initialize proxy - no Session" error.Is my only option then to disable lazy loading when using repositories? Or is it possible (or just foolish) to somehow get the session into scope in the business layer?I do like the repository model, and NHibernate is growing on me (after lots of initial frustration trying to make it work), so what's the best way you gurus have found of using them together?
View 1 Replies
Mar 27, 2010
Hey I am a newcomer to Visual Basic. I am using VB 2008 Express. My problem is I have a combo box filled with model #'s and I would like to have each model # correspond with a different id #, but I have no idea on how to do this, and I have found no documentation on it.
View 8 Replies
Jun 19, 2012
how to phrase my question, but what I am trying to do is inside a for each loop set the item of a model then set the value of that item.
dim td as new project.model.mymodel create model object
For each dr as datarow in dt.rows
dim itemName as string = convert.tostring(dr("Field"))
td.itemName = "6"
next
I keep getting an error that itemName is not part of collection td
View 2 Replies
Mar 29, 2012
I have a program that prints raw code to Zebra printers. We are adding some Intermec printers. So I would like to be able to pull the Model of the Printer (selected from a standard printer dialog) and use that to chose the code that would be sent to the printer.
View 8 Replies
Jan 31, 2009
how do I load a .x model from a folder and then show it in a box(a picturebox?) on a form?
I know it would use DirectX.
I've looked all over the place for how to do it but can't find any ways
View 2 Replies
Jan 10, 2009
My name is Mal, I live in Pelican Waters, Queensland, Australia.There is an application I'd like to build and I have been tossing up between a desktop and a web model. I have been studying PHP and Javascript for the past 2 years. I was studying VB a couple of years ago and have returned to it recently.
View 6 Replies
Feb 27, 2011
Is not the @Model MyModelClass notation not supported in VB Razor Views? It's not working for me. What is the construct for it?
View 1 Replies
Dec 18, 2009
To make this easier I will use a concrete example using movies and genres. A genre can be associated with many movies. Genres can increase over time and so can movies.
The use case is as follows. The user wants to filter movies by selecting his/her desired genres.
So, I have a page where at the top there is a section where the user can pick any combination of genres to filter on using checkboxes. Below that is a list of movies that are in those genres.
In MVC I am trying to implement this using a ViewPage(of IDictionary(of Genre, Boolean)) where the boolean is whether or not a particular Genre has been selected for filtering.
I then go into loop that creates checkboxes for them to select:
<% for each genre As KeyValuePair(Of Genre, Boolean) in Model %>
<%=Html.Hidden("genre[" & i & "].Key", genre.Key.ID)%>
<%=Html.CheckBox("genre[" & i & "].Value", genre.Value)%>
[Code].....
I am aware this can be done using Ajax and I will most likely do it using Ajax but I would still like to know why this doesn't work.
View 1 Replies