i am porting over a website from asp.
i have one page that i can't figure out how to migrate it.
The page is dynamic in the sense that it reads in other html pages and sticks the content into the main "container" page. In the middle of the asp page it has sections like below
<%
Dim fso1, f11, ts1, s1
Const ForReading1 = 1
Set fso...
I am using aspx and c# for a setting a authentication cookie for a login. FormsAuthentication.SetAuthCookie(UserName, True)
I want to store more information in the same cookie. Can I add values to this authentication cookie or do I have to use a second http cookie?
Basically I'm looking for away to store the User's Id so I may be able ...
Does ASP.NET MVC provide any way to implement UpdateProgress WebForms control analog? Can anyone explain me how to achieve such client-side functionality with MVC?
...
i created a new class called HTMLRenderer and i am calling it from my aspx view code
namespace Golf.Content
{
public static class HtmlRenderer
{
public static void RenderHtmlPage(HtmlHelper helper_, string path_)
{
var reader = new StreamReader(path_);
var contents = reader.ReadTo...
i am trying to use this code:
<%= File.ReadAllText(Server.MapPath("Members/newsletters/welcome.html"))%>
which works great but now the welcome.html file has moved onto another server so i need to read it from an external URL .
any suggestions?
...
When using the Html helpers for ASP.NET MVC I need to wrap them in a Response.Write else they don't appear. However the samples (1&2 for example) I find online for ASP.NET MVC don't seem to do that. Did something change somewhere or am I doing something wrong?
From the samples I find it should be like this:
<div class="row">
<% Htm...
My ISP doesn't have ASP.NET MVC installed on their servers yet, although they do have .NET Framework 3.5 SP1 so they do have the new routing engine.
It occurs to me that, if I create a model using Linq to SQL, it's possible to expose parts of the model as properties in the code behind. I could then render them in the web page (my "view...
I'm trying to design a view to accept donations, sell memberships, or sell tickets to events.
I have a dropdown list that displays "Make a donation", "Purchase membership", and the subsequent options are populated from the IList<Event> Model passed from the controller. I use javascript to determine which panel (membership, donation, or...
This will be my first ASP.NET MVC application with forms authentication so I am trying to make sure I don't miss anything. The scenario is this: Public / Secured Areas.
Within the private area it is even further limited to specific areas / user. These 'Areas' are defined by customizations to the base area that is customized per user gro...
What's the best practice to share the bin folder and dlls and other resource files (like css) between multiple web applications on the same server?
I've already separated out the common code into their own assemblies, but I'm wondering about deployment, etc. I basically want to have all the common files located in ONE location on the w...
Has anyone had an experience storing user uploaded images in a MSSQL 2008 Database using Filegroups and Filestreams? I read a few articles that seemed to say they are a good idea because you get all the advantages of storing images on disk and in the db. For example
I have implemented this for my current project but it seems like I'm d...
If I have this code:
<% using (Html.BeginForm("CreateItem", "Item", FormMethod.Post, new { enctype = "multipart/form-data" })) { %>
<label for="ItemImage">Item Image:</label>
Please use JPEG file format only.<br />
<input type="file" name="file" />
<%= Html.ValidationMessage("ItemImage", "*") %>
<% } %>
And I want to ...
In ASP.NET MVC is there a way to enumerate the controllers through code and get their name?
example:
AccountController
HomeController
PersonController
would give me a list such as:
Account, Home, Person
Thanks!
...
Can i give unlimited length for maxJsonLength?
I am using the autocomplete feature of jquery. When i try to retrieve the list of more then 17000 records(each wont have more than 10 char length), its exceeding the length and throws the error:
Exception information:
Exception type: InvalidOperationException
Exception m...
I seem to be encountering some funky behaviour when tracing is enabled in an ASP.NET MVC application:
Whenever tracing is enabled, the HandleError attribute fails.
I've reproduced this on the vanilla ASP.NET MVC app, and was wondering whether anyone has experienced anything similar.
Steps to Reproduce
Step 1
Create a new ASP.NET MVC...
I have an MVC View User Control and from with Controller I would like to find out what the name of the controller that the MVC View User Control has been called from.
Hope that makes sense?
...
I would like to have the following signature of a MVC controller.
public ActionResult Create(Persons[] p)
{
}
Is it possible to have something like this?
EDIT:
Let's say I would like to obtain an array of person objects by submitting a list of names separated by a special symbol.
For example I submit a form
<form>
<input name="...
I am mocking an HttpRequest object using Moq for unit testing in ASP.NET MVC. I need to set one of the ServerVariables (LOGON_USER) in the request. Is this possible? I have tried using the following method, but I get an exception because the ServerVariables collection is non-overridable.
request.SetupGet(req => req.ServerVariables["...
is there any particular directory that i should put my code into in an asp.net mvc project
i have some extentions to the HtmlHelper class. Right now i have it sitting in the Content folder. is this correct? is there a better soluiton?
...
I currently have a list that contains the following
CountryCode (string)
CountryStr (string)
RegionStr (string)
RegionID (int)
AreaStr (string)
AreaID (int)
This is a flattened set of linked data (so basically the results of a joined search that ive stored)
The MVC route will only pass one string which I then need to m...