r/ASPNET • • Jul 04 '13

I'm new to ASP.NET and have a membership problem, that I cannot resolve

6 Upvotes

Hi,

I am new to ASP.NET, but have some experience using MVC frameworks (CakePHP and AngularJS, if you can call it MVC). I have the following assignment - I need to create a simple site where you can create a profile, fill in some personal information and choose which of this info will be visible publicly and which not. I was thinking of associating that information with the user profile and once you create a profile you will be presented with the option to fill in those details. However I am struggling with the membership part - does a member have a unique Id number and can I use that in order to associate information with a user? Or is it better to implement custom membership user?

I really could use some pointers on that. Thanks is advance.


r/ASPNET • • Mar 13 '12

Building a Custom Login Function - Trying to use LINQ

2 Upvotes

Hello all. I am trying to build a custom login page for our applications. I have dropped a loginControl on my form, and have overridden the OnAuthenticate functionality. My problem is how to return my results from my custom Site table. I have created a EDM for my table that contains my login and passwords (Sites). I am attempting to use LINQ to return the results. I got the LINQ itself working, but I want to store the ID and Name returned to a Session Variable for use on subsequent pages. Here is my code:

Function SiteAuthentication(ByVal login As String, ByVal password As String)
    Session("SiteID") = Nothing
    Session("SiteName") = Nothing
    lblerror.Visible = False
    Dim db As New CDMSEntities
    Dim SiteRecord = From Site In db.Sites
                        Where Site.clogin = login And Site.cpassword = password
                        Select Site.clogin, Site.cpassword
    If (SiteRecord.Count() = 0) Then
        lblerror.Text = "Invalid Login and/or password"
        lblerror.Visible = True
        Return False
    End If
    If (SiteRecord.Count() = 1) Then
        '' we have logged in

'' RIGHT HERE , how do I say Session("SiteName") = field returned? Return True End If Return False End Function -----End code

How do I grab those 2 fields returned? Is there an easier way to do this? I have written lots of apps in VFP, but this is my first ASP.NET app. Am I making this too complicated?


r/ASPNET • • Jul 30 '13

Easily Integrating Github within Visual Studio

Thumbnail
rionscode.wordpress.com
6 Upvotes

r/ASPNET • • Apr 10 '12

A Guide to Getting Started With ASP.NET Web Stack Source on Codeplex

Thumbnail
blogs.msdn.com
12 Upvotes

r/ASPNET • • Jul 30 '13

Help with asp.net login page in vb

2 Upvotes

I'm trying to build a simple login page, but keep running into trouble. Here's the stackoverflow post i made

Anyone know what's wrong?


r/ASPNET • • Jul 12 '13

Windows Phone 8 Development for Absolute Beginners

Thumbnail
channel9.msdn.com
11 Upvotes

r/ASPNET • • May 08 '13

Asynchronous Streaming in ASP.NET WebApi

Thumbnail weblogs.asp.net
9 Upvotes

r/ASPNET • • Oct 25 '11

Can you recommend a good .NET VPS host?

5 Upvotes

I use Linode for Linux servers and I am quite happy with it. I am looking for a good and cheap .net equivalent.


r/ASPNET • • Apr 26 '13

MVC 4: Web.config connectionString for Firebird Database?

3 Upvotes

I've been trying to get a connectionString that works for connecting my ASP MVC 4 (.NET 4) application to a remote Firebird Database. My Google-fu is failing me!

I'm very new to ASP.NET in general, so a lot of this is diving in with my eyes closed and feeling around for some sort of solution. Is there some sort of tutorial I missed? Something I need to include somewhere? And where would I include it?


r/ASPNET • • May 10 '13

if I was looking to override the default mvc ViewDataDictionary<T>.SetModel() to allow view models to be interfaces, I would go?

3 Upvotes

I have an application who's job is to reproduce a set of paper applications for different states. For the most part the applications are the same, but have a few differences along the way.

My solution was set up generic interfaces and base classes that each application section would inherit from to be able to re-use common code and allow overriding behavior as needed. On the view level however things are duplicated to where there is a view for each section for each application where the only difference is the class specified as the view model.

public interface IPageValuesModel
{
    Guid PageId { get; set; }
    Guid ApplicationId { get; set; }
    //other stuff here
}

Each application has its own area and version of:

public class CoverPage2013Model : BaseCoverPage2013, IPageValuesModel
{
}

What I would like to do in the view is:

@model IPageValuesModel;

but I get:

The model item passed into the dictionary is of type '...CoverPage2013Model', but this dictionary requires a model item of type '...IPageValuesModel'.

I narrowed it down to the class System.Web.Mvc.ViewDataDictionary<TModel> in the SetModel(object value) :

protected override void SetModel(object value)
{
    if (TypeHelpers.IsCompatibleObject<TModel>(value))
    {
        base.SetModel((TModel) value);
    }
    else
    {
       InvalidOperationException exception = (value != null) ? Error.ViewDataDictionary_WrongTModelType(value.GetType(), typeof(TModel)) : Error.ViewDataDictionary_ModelCannotBeNull(typeof(TModel));
       throw exception;
    }
}

which is defined as:

public static bool IsCompatibleObject<T>(object value)
{
   return ((value is T) || ((value == null) && TypeAllowsNullValue(typeof(T))));
}

I would love to change it to:

public static bool IsCompatibleObject<T>(object value)
{
   return ((value is T) || ((value == null) && TypeAllowsNullValue(typeof(T))) || (typeof(T).IsInterface && value.GetType().GetInterfaces().Contains(typeof(T)));
}

don't suppose anyone knows how I would go about doing that?


r/ASPNET • • Apr 11 '13

@Html.ActionLink overload?

5 Upvotes

I know that I can do the following to create the proper pathing for ActionLinks when dealing with areas:

@Html.ActionLink("linkText", "methodName", new { controller = "controllerName", area = "areaName" })

I don't really like having that in my code all over the place. So what I'm trying to do is create an overload to @Html.ActionLink that takes 4 strings only. The function itself is trivial, it's just how do I actually hook it in to make it seamless? (@Html.ActionLink() instead of @Project.HelperClass.ActionLink())

EDIT Here's what I've found: You can use the name ActionLink for your extension class, but instead of interpreting it as (string, string, string, string), it will default to (string, string, object, object), resulting in the ?length=# at the end of the resulting link. Sad day.


r/ASPNET • • Dec 25 '11

I need ASP.NET hosting (with SQL) so I can move away from GoDaddy

11 Upvotes

I want to move all my stuff away from GoDaddy but I can't find another good host that offers SQL for the same (or better) price. Can anyone make a suggestion?

Okay, just a quick edit here... ARVIXE is a FUCKING JOKE, DO NOT BOTHER WITH THEM. Now I need to find a new host.


r/ASPNET • • Nov 22 '11

Global SEO 301 Redirects in ASP.NET

Thumbnail
alligatortek.com
5 Upvotes

r/ASPNET • • Apr 11 '13

MVC 4 model with a list question

4 Upvotes

I have a model with 3 properties: Id, Name, and Ingredients. Ingredients is a list of Ingredients. The model Ingredient has 3 properties: Id, Name, and Amount. My problem is I don't want to set a number of ingredients on my create view. I created a button that dynamically creates a new textbox for ingredient name and ingredient amount but my problem is that I can't bind the data from those textboxes to the model. I'm looking for a nudge in the right direction and would appreciate any help.

tldr: How do you bind data from dynamically created textboxes to a list?

Edit: Thanks for the help. I wont have time to look at it until tonight after work and class but I do have a second to give a little more info. My jquery handles naming the id and name attributes for the inputs when I add an Ingredient. If I add 3 Ingredients, I get 6 inputs with the names IngredientName1, IngredientAmount1, IngredientName2, IngredientAmount2, IngredientName3, and IngreidentAmount3. I can format those ids and names different if need be. I just don't know how to bind IngredientName1 and IngredientAmount1 to Recipe.Ingredients[0].Name and Recipe.Ingredients[0].Amount and IngredientName2 and IngredientAmount2 to Recipe.Ingredients[1]. Hope that makes sense.


r/ASPNET • • Dec 20 '11

Any good references for learning how to build iService and iRepository layers in ASP.NET MVC 3 using Fluent NHibernate?

10 Upvotes

Trying to learn this for my first ASP.NET MVC 3 project from scratch and I don't know much about building the service/repositories. I could use a good reference/example to help me do it right. Anyone know any?


r/ASPNET • • Nov 21 '11

A Breakdown of Document Paths for Web Application Development (x-post webdev)

Thumbnail
reddit.com
4 Upvotes

r/ASPNET • • Apr 20 '13

Need recommendations for the following

4 Upvotes

Good MVC Open source options for.. CMS, Issue Tracking, Message Boards.

If anyone could recommend some good ones for me that would be great.


r/ASPNET • • Dec 22 '11

MVC - Do you create model classes when you create an entity model?

5 Upvotes

For models in my mvc3 app, I chose to add an "ADO.NET Entity Data Model" and generate the objects from the database. Obviously I can access those objects directly from my controller class, but is it good practice? Or should I write model.cs (i.e., the "AccountModel.cs" file that's generated when you use membership) file anyways?

Thanks.


r/ASPNET • • Mar 19 '13

A tutorial on setting up your first REST service with ServiceStack

Thumbnail tech.pro
9 Upvotes

r/ASPNET • • Mar 16 '13

Voting / Repeater / JQuery Question

3 Upvotes

Hello all,

I am using a repeater to iterate over stories from a database and I dynamically create a basic upvote/downvote button with some text. I want to make it so someone can only vote once based on their IP Address.

For each story to vote on, I was going to (in the repeater) dynamically add a hyperlink to my .net literal and assign a javascript onclick function to it.

In the onclick function, I would make an ajax call to a page called Vote.aspx (passing over the ip address of the user and the story they are voting on). This page will then update the item on the backend, and then return a success code (or failure if the user with that IP already voted).

After the request comes back, I will update in real time the vote to be vote +1.

Obviously if someone just goes to Vote.aspx, and passes in random ip addresses, they can vote unlimited times for that story.

I was thinking of just passing in a token as well (maybe the MD5 of the ip address, the current year or day or something) and then on the server side just verify the token with the ip address parameter put in and the current year. Then if there is a match, great, if not, then no.

..Is this okay? It's just voting, nothing super crazy, but I did want to discourage people who could figure out to go to vote.aspx and just vote excessively on a story.

Thanks so much :)


r/ASPNET • • Sep 28 '11

SpecFlow - Behavior Driven Development (similar to Ruby's Cucumber) in .net.

Thumbnail
specflow.org
7 Upvotes

r/ASPNET • • Aug 20 '11

I am trying to decide between arvixe and powerdnn hosting for asp.net ? Penny for your thoughts?

7 Upvotes

r/ASPNET • • Sep 14 '11

ASP.NET MVC4 Developer Preview Released

Thumbnail
asp.net
26 Upvotes

r/ASPNET • • Mar 27 '13

Unmanaged dedicated hosting?

2 Upvotes

I'm asking here rather than in a hosting subreddit because I'd rather hear the opinions of the coders like me that have to deal with servers in their day to day work (and I run asp.net sites on it).

I have my own server colocated in a local facility but would like to move away from having my own hardware. I do have my own licenses for Windows, SQL etc so I just need a barebones VPS or dedicated account.


r/ASPNET • • Mar 01 '13

Question about Authorization in web.config (report from DOTNET)

4 Upvotes

I am new to maintaining a .NET project and find this in the web.config file:

<location path="AdminSecurity.aspx">
    <system.web>
        <authorization>
            <allow users =".\webdev" />
            <deny users="*" />
        </authorization>
    </system.web>
</location>

I get the allow/deny users part but what does the .\ mean around webdev? How is that different from the user "webdev"?