Asp.net Mvc - Multiple Dropdowns All Null Value If Value Hasnt Changed?
Oct 28, 2011
MVC 3 VB.NET razor. I have a view that has 4 dropdown boxes in it.. This is for setting up a staff member.. If that staff member is to work certain classes then that class will be set for each day. If he is not then the value needs to stay null. This is a edit view so it may have to be accessed multiple times and still keep the original selectlist values if none changed. The below is what I have right now that is working only on its face. The Old selected value is shown first. However this isnt being returned on the save. The only way that it will save correctly is if I select the value that was set in each box then click save. The next problem is that not all staff members will have classes to work on every one of the 4 days. So how do I set a value to null and keep it that way unless a class Is actually selected.
[Code]...
View 1 Replies
ADVERTISEMENT
Jul 30, 2010
I am programming something which involves certain files changing every second. Now, if the files are not changed for, say, 10 seconds it means that some error has occured somewhere, externally. So, I want the user to know about it. How can I implement this?
Sorry cant add comments due to some problem.
@Jeremy - Very small. Precisely, It wont exceed 10-15 characters.
View 3 Replies
Oct 26, 2011
Essentially, in C# the left dropdown has all the classes in a file while the right drop down has all the methods, events, properties, etc.In VB all of my controls are in the left dropdown and I have to select them if I want to go to a particular event handler for that control.I find it time consuming to navigate to my btnSave_Click method by first selecting btnSave in the left dropdown and then selecting Click in the right dropdown.Is there a setting or a plugin that can change this functionality?
View 1 Replies
Mar 18, 2012
I have about 15 text boxes and instead of going to the event handler on each one and enabling a button on a change..
[Code]...
Instead of going through each one and typing that is there a simpler way?
View 4 Replies
Jul 30, 2009
I have MDI parent and child windows that were working fine but now clicking on a dropdown doesn't do anything, also scrollbars cannot be moved. Other controls are still ok, buttons and other links are still working. I should also note that if I change the child to load in a separate window all the controls work again.
View 2 Replies
Jul 14, 2010
VS2008 .NET 3.5SP1
I've got a MenuStrip with dropdowns and a Toolstrip with buttons. I don't want the button images in the image margin of the dropdown because they are too small to read properly. I can't seem to find the ShowImageMargin property (in either the MenuStrip or the ToolStripMenuItems) to turn the margin off. I've constructed the menu items in the designer.
View 2 Replies
Feb 16, 2011
I have set it up to email me should someone submit this form and an error occur and right now should that occur for most integer or datetime fields if they fail to validate then it will show me which fields in the email failed and what was input into them.
Problem I'm having now is to validate the drop downs and the textboxs in a similar way to what I with integer and datetime fields so I can display those also in the email in case they error.
present integer and datetime validation
[Code].....
Summary:- Need vb code to validate if strings and dropdowns are valid and the use of try/catch block is another possible solution but I wasn't able to figure out how to implement validation for that either.
View 3 Replies
Jul 9, 2010
I have one page with two dropdownlists with different IDs and in my codebehind I have two distinct methods, one for each dropdownlist, with distinct names and handlers.BUT, in my codebehind, only one dropdownlist calls it's method - and sometimes it calls both methods! - while the other dropdownlist never calls its method.I tried cleaning the infamous "Temporary ASP.NET Files" folder I tried rebuilding the solution but the problem persists?
View 1 Replies
Jul 15, 2011
Any resolution to make the cascading dropdowns work as expected when used inside edit mode of AspxGridview. I am using DevExpress Controls.
My requirement is as follow:
If I select country="United States" then populate the "State" combobox and on selection of "State" populate the "City" combobox.
If I select "country" other then "United States" then populate only "City" combobox with cities of selected "country" and no need to populate the "State" combobox. Also I need to hide the "State" combobox. i.e. like
Country State City
ROW1 united states Alaska Douglas
ROW2 Canada Toronto
ROW3 Australia Sydeny
ROW4 united states California Yuba City
Same is required in Editmode also.
View 1 Replies
Oct 14, 2011
Check multiple expressions for null?I have this bit here[code]...
View 8 Replies
Apr 22, 2011
I am using KeyPressEventArgs to restrict several text boxes to numeric entries only. Rather than repeat the code, I thought I would make a "RestrictToNumeric" subroutine and call it from each "KeyPress" event. Like So:
Private Sub txt1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txt1.KeyPress
RestrictToNumeric()
End Sub
[code].....
The problem I am encountering is that the variable 'e' is used before it has been assigned a value, causing a null reference at runtime.
So I tried to add Dim e As System.Windows.Forms.KeyPressEventArgs As?to the RestrictToNumeric sub.I cannot figure out what I need to "Dim" it as...
View 2 Replies
May 5, 2012
I changed my Username on my computer from i.e. "xxxxxx x xxxxx" to "Dennis"
VB 2008 during a compile gave me the following error: Error reading icon 'C:Usersxxxxxx x xxxxxAppDataRoamingMicrosoftVBExpress9.0VSProjectApplication.ico' -- The system cannot find the path specified.
The file "VSProjectApplication.ico" is in 'C:UsersDennisAppDataRoamingMicrosoftVBExpress9.0'
Somewhere in the VB2008 "configuration" files I believe that I need to manually change the old path to the new path.
I found the old path in the ".suo" file. The ".suo" file is not a text file. How can I edit the .suo file, save it so that it will work?
View 4 Replies
Jul 16, 2009
I have a button 'start quiz' which uses the dataset to fill the quiz form - ready for the user to start answering the questions.However, I am getting a 'null reference' at the point where the 'navigate records' on the quiz form is called. Have looked up that it means I have a variable that is null. But I have declared all the variables etc. Not sure what I'm doing wrong. I am very new to programming and I have spent quite a bit of time on this already.This is the code for the student user login:
Private Sub btnLoginStudent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoginStudent.Click
FrmQuiz.Show()
[code].....
View 9 Replies
Jan 20, 2010
on my Form I have a DataViewGrid and some textboxes with a save button (they are filled with additional data of the selected row).Save is disabled first, when I change something in the textboxes the save button is enabled.When the user changes a gow in the grid, I want to ask before changing the grid row, if he wants to save (if the button is enabled).I am using RowEnter but this is too late, then the selected row already changed (and my textboxes already got new data)...What event can I use to ask if I should save stuff before the user changes a row?Something like BeforeRowChanging with a chance to cancel changing the row?
View 2 Replies
Jun 22, 2011
've got a function that takes two parameters (a delegate and an integer) and then creates a LINQ MethodCallExpression, which it uses to gets the results:
Public Delegate Function CompareTwoIntegerFunction(ByVal i1 As Integer, ByVal i2 As Integer) As Boolean
Public Function Test(ByVal pFunc As CompareTwoIntegerFunction, ByVal i1 As Integer, ByVal
[code].....
View 1 Replies
Dec 15, 2011
I have a fairly simple piece of code:
Private _PurchaseDelivery as PurchaseDelivery
Protected Overrides Sub InsertItem(ByVal index As Integer, ByVal item As PurchaseDeliveryItem)
[Code]....
Which is inside a class which overrides a custom list base. The code is occassionaly throwing an unhandled exception, System.NullReferenceException, on this line when used in production:
If _PurchaseDelivery IsNot Nothing AndAlso _PurchaseDelivery.DefaultSKUBinID.HasValue Then
DeafultSKUBinID is declared as an Integer? (Nullable Int) in the PurchaseDelivery class. I cannot see what might be causing this error, why would this be returning an error?
View 3 Replies
Jul 15, 2011
How to check whether a column is null i use the following code but I got this error "Input string was not in a correct format."
[Code]....
View 2 Replies
Aug 12, 2009
When I put a break point to the last if clause in the sub ("If (backOrder < 0) Then", see below) it runs until the break point, if I put the break point further below, I get the following error:
Cannot insert the value NULL into column 'OrderID', table 'WHM.dbo.OrderDetails'; column does not allow nulls. INSERT fails. The statement has been terminated.
I've discovered first hand that it only happens when prodqty is bigger then qtyOnStock, thus executing the if clause.
The code:
Private Sub NCOSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NCOSubmit.Click
Dim sqlText As String = ""
[Code]....
View 4 Replies
Oct 20, 2011
I am trying to create a treeview in VB.net, the data has to be loaded from MSAccess 2010 database. When I try to run this program I get error : Argument Null Exception was unhandled, 'column' argument cannot be null and the program crashes. I have pasted the code as under:
Imports System.Data.OleDb
Public Class frmRating
Private Sub frmRating_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
[code].....
View 1 Replies
Jun 24, 2010
I have some code which gets child items for a menu via the GetChildren function which takes a list of menuData: Dim builtMenu As New List(Of MenuData)(_rawData.FindAll(Function(item) item.GroupingID = 0))
For Each menuData As MenuData In builtMenu
If menuData.Children IsNot Nothing Then
menuData.Children.AddRange(GetChildren(menuData))
End If
Next
If I check if menudata.children isnot nothing, it always is nothing because the GetChildren function is yet to run (providing the child items, which do exist). If I remove this check and just have this code:
Dim builtMenu As New List(Of MenuData)(_rawData.FindAll(Function(item) item.GroupingID = 0))
For Each menuData As MenuData In builtMenu
menuData.Children.AddRange(GetChildren(menuData))
Next
Then I am presented with a Object reference not set to an instance of an object error on menuData.Children.AddRange(GetChildren(menuData))
View 1 Replies
Feb 22, 2010
To make this more simple,(as I have gone further through this project I have learned a bit more)...
[Code]...
How would I execute the above statement? When multiple dropdownlist's are handled in the same sub, how do you tell which one is actually calling the sub? The post by atconway was helpful in guiding me in a direction, but I dont understand the whole concept enough to dive into the msdn library... I would probably spend all my next 7 hours today reviewing it and still not get much further :-P
[Code]...
View 5 Replies
Oct 4, 2011
Can anyone explain exactly why Method 1 in the following code does not alter the DataTable where the other 2 methods do? It's obviously some kind of referencing issue, but why exactly?
[Code]...
View 1 Replies
Jul 26, 2011
I'm trying to write a little utility which will check periodically and tell me if/when a web page's (could be any URL) content has changed. I've read the other postings but they don't really answer my question (as far as I can tell).I know for static pages there is a last-modified header. However, what about dynamic pages? I got Oli's comment that storing a hash of the contents works but that's not really idea because the page might simply have a time stamp on it (the date-time that the page was produced). Clearly, in this case, the content would be different on every single request even though nothing significant has changed.So, now I'm thinking to tie it to a percentage of 'changedness.' Something like, more than 5% changed will cause the 'changed' logic to run.
View 3 Replies
Aug 6, 2009
Is there a way I can add an event for when a value is changed, because, I need to add an OnDisconnected() event that detects when the mobjlistener.Connected value has changed...would I have to do a timer, is there a way I can do an event for getting disonnected?
mobjClient = New TcpClient("IP", 5000)
I would rather not add a timer, I would rather have an event that fires when mobjlistener.Connected changes, but if I can't I will go ahead and use the timer instead.The problem I have that I need to detect when this changes is because sometimes I get disconnected for an unknown reason using the TCP Multi-User Chat, it has handlers for disconnected, but whatever is causing the disconnect, it is just not detecting it, so if I could make it so that it will trigger when this is changed, then I can stop the problem I have once and for all.
View 9 Replies
Apr 15, 2010
Is there a simple way of tracking the change of an Mdi's children i.e. when they are created and closed, something like an event OnMdiChildListChanged (I realise this doesn't actually exist).
I am also aware that I could have a method within my Mdi that handles the creation of child forms and logs the state of them or even create an Interface that defines that a child form has a "NotifyParent" method that is then called on close of the form, but i was wondering if there was any built in events that i could plumb into?
View 3 Replies
Apr 19, 2010
I have been re-writing an old personal application after not coding for a long time, I have a class for a custom progress bar.
I compile it then add the progress bar to the form. Then I modify the properties of the progress bar on the form. I then compile and run it .[code]...
View 5 Replies
Jun 10, 2010
Console.WriteLine("D2: " & System.TimeZone.CurrentTimeZone.IsDaylightSavingTime(d2))We parse files and put the data into a database, if I parse the exact same file with the same code (it was never changed) I get different results.
View 1 Replies
Dec 24, 2009
Using vb.net and DataGridView in Winforms. What even should I use to know when the checkbox has changed?
View 3 Replies
Jun 13, 2011
I am developing a Windows application using VB.NET. I have a datagrid control bound to a dataset which is populated from an Access database. When a user using my application clicks on a row in the grid, a triangle appears in a column on the left of the grid indicating the selected row. However, if the user does nothing, after several minutes, the selected row changes to the first row in the grid and the triangle indicating the selected row moves to the first row.
View 1 Replies
Sep 18, 2011
I've been trying to make a login system for my application. Which seems to work, but when I try to connect to the database itself, it won't work. I used this code to check the exception:
Catch myex As MySqlException
MsgBox(myex.Message)
That gives this exception:
"Acces denied for user '[my db user]'@'[My IP-Address]' (Using Password: YES)"
The code I use for the connection is:
Dim Connection As New MySqlConnection("server=[The SERVER IP]; user id=[DATABASE USER]; password=[DB USER PW]; port=3306; database=[DB NAME]; pooling=false")
Connection.Open()
MsgBox("Connected")
As you can see, I've tried to change the 'server' part, but it won't affect anything. It will just say my ip address (localhost, I assume) in the exception. Telling me that it couldn't connect to it. Which is not even what I'm wanting to do.
View 7 Replies