Asp.net Mvc - Getting Number Of Connections Currently Viewing Mvc3 Application
Jan 24, 2012
MVC3 vb.net Application using built in session management. I have an mvc3 application that I would like to add being able to see the current number of users online to whether they are logged in or not. I have tried using: Membership.GetNumberOfUsersOnline.ToString But that only keeps track of current users logged in which is not acceptable in what I am trying to do. Is there any other method that keeps track of connections?
View 1 Replies
ADVERTISEMENT
Nov 22, 2009
I've been developing an export program which generate a csv file.
Column_A, Column_B, Column_C
00014, Sample, test
Now upon this data is viewed in csv the trailing zero from column_A is gone. it becomes 14.I revise the writing of data from Column_A which if the start of it is zero i insert a single quote. Upon viewing it in csv i got a '00014 which single quote is visible. how can i remove this single quote? which i expected to view it 00014 only in csv file.
View 9 Replies
Dec 14, 2011
I am working on an application that has a Winforms and MVC3 Web component. We need to be able upload large files from the desktop to the web. I have tried the various VB 2010 WebClient and FTP FileUpload alternatives but continue to run into permission issues, even though the User-ID and password I supply are the same as those used by an FTP application that successfully copies files to the same MVC3 site. In my efforts to find alternative solutions, I have looked into using WCF which also seems complicated and problematic for this particular application.
The closest I have come to a solution utilizes HttpWebRequest on the Winforms application. The following VB 2010 and C# code (MVC3) successfully passes the Filename and File data to MVC3 (the InputStream contains the references and UrlEncode data, but the class containing the fields for this data are null. (I have also passed just the file data without the filename, and the uploaded file is successfully created from the InputStream - but the method variable is still null). Although I could pick apart the InputStream, I would prefer a more elegant alternative.
VB 2010 Winforms method:
Public Shared Sub FileUpload(ByVal Filepath As String)
Try
Dim Host = System.Configuration.ConfigurationManager.AppSettings("Host")
Dim url As String = Path.Combine(Host, "UI/FileUpload")
Dim request As HttpWebRequest = HttpWebRequest.Create(url)
request.Method = "POST"
[Code] .....
View 2 Replies
Jan 30, 2009
I am totally new to socket connections, so I've pieced together code from the internet to try and start a TCP Listener object. [code] Is it possible to create a TCP listener that does not need a specific number of connections initialized? Can I just have it listen on an open port until data is received? I will be receiving a lot of data at once from many servers...
View 1 Replies
Jul 19, 2011
Using VB.Net and SQL Server 2008 R2: I have recently had a database that using sp_who2 reflects a connection ".Net SqlClient Data Provider" is still active even though the .Net application has closed and disposed of all connections.
[Code]...
View 1 Replies
Mar 16, 2012
This may have been answered but my search hasn't found what I was looking for. Basically, I am developing an application which allows the user to build a query at design time, i.e. for users with no prerequisite knowledge of SQL The application thus far allows the user to select which table(s) from the database they wish to start querying (I won't go into the details of the rest for now)
My confusion is this; I already have the connection to the database in a subroutine which obtains the schema information and filters it to display only the available tables within the database, which then compiles the data into a listbox, here is that sub:
[Code]...
View 1 Replies
Aug 17, 2010
I have a .net window application created and I wanted to see if it's at all possible to place various file dependencies off the web server. e.g. is it possible to have the connection to the database be off a web server?
I also would like to see if it's possible to place one of the .dlls off the web and have code that points to it to load.
View 2 Replies
Sep 2, 2009
a small question: what is the difference between sync and async connections in a tcp/ip client/server application?
View 1 Replies
Jun 11, 2009
I have an application which connects to a database, retrieves a username from a user's table and matches it against the username retrieved with System.Security.Principal.WindowsIdentity.GetCurrent.Name.On my localhost, everything works fine. The database exists on the development server but the application lies on my localhost. All of my authorization and authentication techniques are running smoothly.However, when I publish my application to the development server, I'm faced with the following error.Cannot open database requested in login 'databaseName'. Login fails.Login failed for user 'DevelopmentServerNameASPNET'.
[Code]...
View 4 Replies
Apr 16, 2011
With the MVC3 Razor synax, one may render a string like so
@ViewData("photo")
My problem is: How can I append a dot to the above code.The following will result in a "Public member 'jpg' on type 'String' not found.
@ViewData("photo").jpg
I've tried the following code but does not produce my intended result:
@ViewData("photo") .jpg
@ViewData("photo"):.jpg
@ViewData("photo") & ".jpg"
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
Apr 12, 2012
I'm trying to implement a file upload system and I don't really get what to do.
I'm looking for the easiest way to do it. After long researches, I've found those explanations.
forums.asp.net/t/1678157.aspx/2/10
So, here is the things I've done inside the view :
@Code
Dim fileName As String = ""
If (IsPost) Then
[Code].....
Problem : GetHtml is not a member of 'System.Web.UI.WebControls.FileUpload'
What can I do to fix this? Is it the good way to handle file uploads?
View 2 Replies
Apr 2, 2012
Function Monitor() As ActionResult
Dim db = New QuarterDBContext()
Dim items As IEnumerable(Of SelectListItem) = db.getQuarter.[Select](Function(c) New
[code].....
View 1 Replies
Nov 2, 2011
Having issues getting myself started on MVC3.Trying to define a simple route here in Global.asax [code]
View 3 Replies
Feb 3, 2011
I am using ASP.Net MVC3 with MySQL Trying to figure out beast way to return sql result from controller to view and display output using webgrid help class.
tried following its not working.Controler code
data = New DataTable
da = New MySqlDataAdapter("SELECT * FROM " + tables.SelectedItem.ToString(), conn)
cb = New MySqlCommandBuilder(da)
da.Fill(data)
ViewData("grid") = data
[Code]...
View 1 Replies
Nov 16, 2011
I have a MVC application, which creates a Chart in the business logic like this:
StatisticsModel.Chart.Width = 150
StatisticsModel.Chart.Height = 300
StatisticsModel.Chart.Attributes.Add("align", "left")
StatisticsModel.Chart.Titles.Add("Statistics for: " + StatisticsModel.ProductNumbers)
StatisticsModel.Chart.ChartAreas.Add(New ChartArea)
[Code]...
View 1 Replies
Apr 19, 2012
So, I don't get what I still should to to make a file downloadable within the action.
So, here is the controller that I have. Everything seems to work fine, except that I never receive any file to download client-side.
<HttpPost()>
Function meetingCP(idCont As Integer, idOpp As Integer, schedule As String) As FileResult
[Code]....
View 3 Replies
Apr 14, 2011
Function Monitor() As ActionResult
Dim db = New QuarterDBContext()
Dim items As IEnumerable(Of SelectListItem) = db.getQuarter.[Select](Function(c) New
[code].....
View 36 Replies
May 30, 2012
I've the following code for a DropDownListFor and is working ok
@Html.DropDownListFor(Function(model) model.Habilitacoes, New SelectList(ViewBag.Habilitacoes, "KeyHL", "DescricaoHL"), New With {.class = "FillHSpace"})
[code].....
View 2 Replies
Mar 22, 2012
I have table with date/time column and person column. Each person has multiple records for each day. What I need to do is next: I need to get first record for each person for each day... Can this be done in MVC3 Visual Basic and Entity framework?
View 2 Replies
Jun 21, 2011
How do I modify or create my own Html.ActionLink helper to accept and handle the first parameter (linkText) passed in as an empty string / nothing?Details: I currently have a strongly typed view that's passed a model which contains search results. My view loops through each item in the model and attempts to display a link to a contact with the following code:
@Html.ActionLink(currentItem.ContactName, "contact", "details", New With { .id = currentItem.ContactID }, Nothing)
Normally this would work just fine, but not every item in my search result has a ContactName. The Html.ActionLink helper errors when this first parameter is empty. In case it helps, here's the model property for ContactName (which is generated from a template due to Database First, so I don't believe it can be modified):
Public Property ContactName As String
I'd like to have a helper function that simply returns nothing if the ContactName is an empty string / nothing.I'm guessing I need to extend this helper, and I've struggled to find any good, up-to-date resources in VB.net for extending helper functions. Other approaches are more than welcome if they're considered best practice. I'm working in VB.net, MVC3, and Razor in the ASP.net 4.0 framework.
View 2 Replies
Feb 18, 2011
I'm trying out MVC Scaffolding in a VB.NET MVC3 project and running into an issue with late binding with Option Strict set on (and I want it on).
This works in C#:
public ActionResult Create()
{
ViewBag.PossibleTeams = context.Teams;
[code].....
causes the compiler error Option Strict On disallows late binding. I took a look at the documentation here: [URL] but it wasn't very helpful.
I notice that a new empty application in C# uses the ViewBag in the HomeController but the VB.NET version uses ViewData, so maybe this is a VB.NET limitation.
View 2 Replies
Jan 25, 2011
How do I reference a Namespace in .NET MVC3 with the Razor view engine?
I understand this can be done in C#:
@using Namespace;
However in VB this doesn't seem to work:
@Imports Namespace
(i'm talking about inside a .vbhtml file)
View 1 Replies
Apr 7, 2011
I got a stored procedure that reads a table and insert those data to antoher table. That's the way how it works because the first table imports data from excel using a package with SSIS.In EF4 I imported the SP and create function import:This SP has 2 IN variables and 2 OUT varibales.The IN varibales are parameters and OUT variables are a message and the number of records created.[code]
View 1 Replies
May 1, 2011
i have a pretty simple registration wizard form. this is an mvc3 azor project written in vb.my last step displays a partial view with the user's entered details. since the partial can take a split second to load, the form looks odd until it does - a blank form with a couple of buttons. is there a clean, proper way to display a little loading image/message while the partial is loading so it's obvious to the user he/she needs to hold on a sec.
my code for the register view:
$(function () {
$(".wizardstep:first").fadeIn(); // show first step
// attach back button handler
[code]....
the partial view for now is just a dummy display of the model elements.
View 1 Replies
Apr 12, 2012
I'm trying to build a web application that uses an SSL connection. So I did some research and found out that I could use the RequireHttpsAttribute class to achieve what I needed. Thing is that when I use it, the execution of the application results in an 310 error(too many redirections). I even built a custom class to handle the switch from http to https. [code]
View 2 Replies
Sep 3, 2011
I have a problem with the Telerik grid that I can't seem to find quite the exact problem anywhere. I'm following the demo from their site for Client Side Edit Templates. When going into edit mode it immediately dies saying select method is undefined from this js statement:
[Code]...
View 2 Replies
May 13, 2011
I am using Entity Framework 4.1 code first+MVC3 and the inheritence stratagy that I use is TPC
I have the following classes
Public Class ObjectBase
<Key()>
Public Property Id As Integer
Public Property Description As String
End Class
[Code]...
Question 1 (and question 2) should be very simple, but I have allready spent hours on Google to find an answer with no result at all. The only thing I have found is that you can get all computers in ObjectBase by writing context.ObjectBase.OfType(Of Computer), and that does not help since you cannot write context.BorrowObjects.ObjectBase.OfType(Of Computer) code samples in VB.NET (if you can), but more importantly: Please ensure that the codesamples you supply work without hours of modification!
View 2 Replies
Sep 21, 2011
I am working on MVC3, i have a situation where i want to do something like this:
<Div>
@Code
Dim i = 1
[Code]....
but razor is throwing wrong syntax error message. how to do this properly in side razor code.
View 1 Replies
Mar 14, 2012
MVC3 vb.net. In my app I have a point where 500+ emails with attachments are sent out using a for each loop to accomplish this.. Nothing is returned to the browser the entire time this is running so eventually the browser think it has timed out... I tried just having it redirect to another actionresult function after every email and that function just passes it back to the email function. This is not working and I feel the reason is that nothing is actually being sent to the browser window its self.. Is there a way to fix this issue??
[Code]...
View 3 Replies