r/ASPNET • • Nov 15 '13

Geotagging in ASP.NET - Resources and attn. programmers with experience

2 Upvotes

Does anyone know of a great place to pull existing geotagging code from on the net for ASP.NET, or know anyone proficient in programming this in ASP? We are hiring someone to update this portion of our site and make the geotagging area sleeker, so please PM or comment if your interested. Thanks.


r/ASPNET • • Oct 09 '13

ASP.Net Nightly Build

Thumbnail
myget.org
2 Upvotes

r/ASPNET • • Oct 07 '13

Multiple views per one action method

2 Upvotes

Hey folks,

Quick question:

I know that you can have multiple Action methods that returns the same view .........but can you do it the other way around ? (multiple views per action method)..and is that ideal ? (as in, you know how Viewbag is generally frowned upon, is having multi-views per action method bad? )

THNKS IN ADVANCE!


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 30 '13

.NET e-commerce/CMS UI-only options

2 Upvotes

I have an e-commerce "platform" thats made up of various components. From a business POV we run a single warehouse/distribution that has multiple sites targeting specific industries. Each site is its own business unit and has silo'd data.

A quick explanation of what each component is would be;

Logistics: A WCF project that contains all the logic and data storage for our warehouse to accept new shipments, print customer orders, dispatch them out the door, etc.

Site Application: A WCF project that contains all the logic and data storage specifically for that sites audience. It receives a product feed from the Logistics component about what it's allowed to sell (and price, etc). Customers view those products, submit an order and the order is sent to the Logistics layer to be dispatched.

Admin App: An MVC project that communicates with both projects based on user permissions to manipulate the data across each system (customers, orders, products, etc).

Web UI App: This needs to communicate with the site app system to retrieve customer, product, order, etc data.

Now where I need some suggestions is how to implement the web UI. I want it to run on a CMS-framework so that our marketing guys can manipulate the pages themselves without needing IT help, etc.

After looking at Orchard, Umbraco, Sitefinity, Kentico and Sitecore I'm wondering if what we need is more of an e-commerece frontend like nopCommerce or Virtocommerce. However both of these are the full package which include inventory management, customer management, order management, etc which in our situation is controlled within the site app component.

If I could sum up the requirements of the web UI it would be that it needs to support a templating system for layout, page/blog management and plugin support to communicate with our app.

My question is; Is there a solution available that matches my requirements or should I pick a CMS like Umbraco that we can customise heavily to support that need?

Thanks!


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

JetBrains .NET Tools Blog » AngularJS support for ReSharper

Thumbnail
blogs.jetbrains.com
2 Upvotes

r/ASPNET • • Dec 03 '12

Introduction to SignalR - Creating a Cross-Platform game

Thumbnail
blog.filipekberg.se
2 Upvotes

r/ASPNET • • Nov 29 '12

Masterpage not displaying in ie

2 Upvotes

I have an internal asp.net site and after a recent change (changed the title of a couple pages) the master page is no longer displayed when viewed in ie. firefox is still working fine. I am pretty brand new to this so any suggestions would be appreciated


r/ASPNET • • Oct 17 '12

Looking for some help figuring out what some code does. I think it's "classic ASP" so forgive me if there's a better place to ask.

2 Upvotes

Background: I run a small computer shop and we use a web based service ticket system. It runs on Windows Server 2003 IIS, the pages are .asp, and it saves to a MS SQL database.

Over time I've done a handful of additions and subtractions to the code/database. I can follow the code enough to copy and paste and modify code to suit my needs. (Example: Added a yes/no for if the power adapter is included, and added a notes section that can be updated)

Now, I'm trying to replicate some parts of this for a new type of system, but using a different database because I want it to query information from another program (sales system).

Question: Can you tell me how this code works together? If it even does? I can provide other information if needed.

Code:
This is from the "AddNew.asp" where it adds the new service ticket into the database (then displays that info so we can print it)

    Set DataConn = Server.CreateObject("ADODB.Connection")
    DataConn.Open Session("DataConn_ConnectionString")
	Set RS = Server.CreateObject("ADODB.RecordSet")
	
    RS.Open "tbService", DataConn, adOpenKeyset, adLockOptimistic 
    RS.AddNew
	  RS("Phone_1a") = UCase(Request("Phone_1a"))
	  RS("Phone_1b") = UCase(Request("Phone_1b"))
	  RS("Phone_1c") = UCase(Request("Phone_1c"))

This is a file called "global.asa" which is in the same directory as the other .asp files (also it's the only file with the database password in it).

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
   '==Visual InterDev Generated - DataConnection startspan==
   '--Project Data Connection
     Session("DataConn_ConnectionString") = "DSN=webtech;UID=dbuser;PW=[removed];Pass=[removed];PASSWORD=[removed];"
     Session("DataConn_ConnectionTimeout") = 15
     Session("DataConn_CommandTimeout") = 30
     Session("DataConn_RuntimeUserName") = ""
     Session("DataConn_RuntimePassword") = ""
   '==Visual InterDev Generated - DataConnection endspan==
End Sub
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
   '==Visual InterDev Generated - startspan==
   '--Project Data Connection
     Application("DataConn_ConnectionString") = "DSN=webtech;UID=dbuser;PW=[removed];Pass=[removed];PASSWORD=[removed];"
     Application("DataConn_ConnectionTimeout") = 15
     Application("DataConn_CommandTimeout") = 30
     Application("DataConn_CursorLocation") = 3
     Application("DataConn_RuntimeUserName") = ""
     Application("DataConn_RuntimePassword") = ""
   '-- Project Data Environment
     'Set DE = Server.CreateObject("DERuntime.DERuntime")
     'Application("DE") = DE.Load(Server.MapPath("Global.ASA"), "_private/DataEnvironment/DataEnvironment.asa")
   '==Visual InterDev Generated - endspan==

End Sub </SCRIPT>

Here's what I get out of all this:

AddNew.asp pulls the connection information (user/pass/db) from global.asa using DataConn_ConnectionString
It creates a new row and inputs all the information (all this I've replicated and added to, so I understand it for the most part)

What I don't get:

How does AddNew reference global.asa? The word global isn't in the asp page at all.
What is ADODB.Connection and ADODB.Recordset? They're only referenced once each on the asp page and nowhere in global.asa

Also, if there's a better (not harder) way to do this, I'm open to suggestions. As I said before, I'm good at following code for the most part, just not writing it just yet.

Thanks in advance for reading!


r/ASPNET • • Jul 09 '12

Web Form, EWS, and Impersonate User issues

2 Upvotes

I have a ASP.NET application I am working on that I would like to interface with Exchange using EWS to retrieve Calendar items using the credentials of the currently logged in domain user.

In my test environment using the UseDefaultCredentials setting gives me the following error.

"When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids."

I am under the impression that this is because EWS is getting the credentials from the service account and not the default credentials for the logged in user.

I was wondering if there was a way to get around using Impersonation or if there is not what the security concerns are for setting a service account to be able to impersonate any user.

Thanks


r/ASPNET • • Mar 19 '12

[Question] Is there a better way to do autopostback="true"

2 Upvotes

I'm using VB in the code behind to calculate a total. Right now there is a text box for the quantity and then the math is all hard coded. In order for the event to fire without needing the enter key I added autopostback="true" to the quantity text box, but it causes the whole page to reload when the values change. Is there a better way to get the same results without reloading the page?

I'm super new to .net and have never worked in vb before, so my boss wants me to do simple stuff like this with just vb to practice and to get me familiar with it.

Edit: clarity


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 • • Feb 10 '12

Can someone talk to me about .ASP , I would be interested in knowing real world examples about how this software is useful ...

2 Upvotes

I just stumbled upon web matrix the other day thinking it would be another text editor ... its not ... this software has @symbols all up in it and apparently it can access database work , is ASP easier or more difficult than PHP to learn and more or less useful than PHP or just different? I know HTML and CSS and am branching into Jquery but this came up and I want to know if I should put it on my schedule of things to know in depth about because just when I thought I found the holy trinity of web design along comes this ASP.net and makes me think that I could write dynamically generated websites. I checked out the tutorials on microsoft's website and I am going to be going through them but to give me a frame of reference for what I am working with here can you answer a very simple question?

What do I use asp and is the answer ... well you dont have to fuck with PHP? Is that what this is because I can fucking read ASP, PHP makes sense to me but its a bitch to learn how to read. Am I wrong? I could use some help.


r/ASPNET • • Feb 02 '12

ASP.NET CSV File Export issue

2 Upvotes
            Context.Response.Clear();
            Context.Response.ClearContent();
            Context.Response.ClearHeaders();
            Context.Response.ContentType = "binary/octet-stream";
            Context.Response.AppendHeader("content-disposition", "attachment; filename=FILENAME" + DateTime.Today.ToString("MM-dd-yyyy") + ".csv;");
            Context.Response.Flush();
            

            StreamWriter sw = new StreamWriter(Context.Response.OutputStream); //writes the stream to the HTTP response object.
            sw = ExportResultsToCSV((int)this.assessmentYear_Box.Value, dt, sw); //build our lines.
            sw.Close();

            Context.Response.Flush();
            Context.Response.Close();

So this works fine from the localhost V.S. 2010 debugging, however when the project is moved to a staging/production site the file downloads as expected, but instead of data it is filled wht the markup from the actual page calling the above code. The site is ajaxified, but the button that triggers the follwing statement has been taken out of the ajax cycle, so it is not that.


r/ASPNET • • Jan 23 '12

[ASP/VB.NET] GridView - DetailsView Question

2 Upvotes

I am working on my first ASP.NET web application with SQL server data sources. I am very new to .NET, but have been a VFP programmer for 11 years. I have a basic search engine with a GridView of the results on my main page (Default.aspx). I have the AutoGenerateSelectButton="True" in my GridView. I would like the DetailsView displayed on a subsequent click of the select button (DetailsView.aspx). I am having trouble conceptualizing passing the parameter (my unique identifier is faccode) to the datasource in the DetailsView on the next page. Thanks for your input.

Edit: I know I sound like a complete noob. I have a progress meeting on Thursday and I feel like this.

Edit #2: I got it. I did not have the DataKeyNames set on the GridView, and I did not have a prime key on my table. I added these two line to the SelectedIndexChanged event:

   Dim selectedfacility As String = PFSResultsGridView.SelectedDataKey.Value.ToString()
    Response.Redirect("DetailsView.aspx?id=" + selectedfacility)

Then added my @id on the Page_load of DetailsView.aspx


r/ASPNET • • Jan 23 '12

Dynamic ViewState in ASP.Net Webforms using DynamicObject

Thumbnail
aboutmycode.com
2 Upvotes

r/ASPNET • • Jul 27 '11

Using procedures to set variables

2 Upvotes

I'm using ASP to create a system for some schoolwork, and part of the system is sending an email notification - I'm using the following code to do this:

Set AbsenceNotification=CreateObject("CDO.Message")
AbsenceNotification.Subject=call AbsenceReasonVerbose(AbsenceType)
AbsenceNotification.From="Cover System <[email protected]>;"
AbsenceNotification.To="Me <[email protected]>;"
AbsenceNotification.To=call find_emailaddress_string(Subject,AbsenceType)
AbsenceNotification.TextBody="Message, Message, Message"
AbsenceNotification.Send
set AbsenceNotification=nothing

However, I get a syntax error on the lines which call procedures, i.e., AbsenceNotification.Subject=call AbsenceReasonVerbose(AbsenceType)

Am I doing it right?

Thanks in advance reddit :)


r/ASPNET • • Jun 01 '11

What ASP.NET MVC Could Learn From Rails

Thumbnail
codethinked.com
2 Upvotes

r/ASPNET • • Oct 08 '10

WEB Metrix

Thumbnail
simple-talk.com
2 Upvotes

r/ASPNET • • Oct 08 '10

webmatrix

Thumbnail
simple-talk.com
2 Upvotes

r/ASPNET • • Oct 07 '10

Under the ORM Hood: Revealing the SQL

Thumbnail
simple-talk.com
2 Upvotes

r/ASPNET • • Aug 11 '10

Using Areas in ASP.NET MVC1

Thumbnail thewaffleshop.net
2 Upvotes

r/ASPNET • • Jul 19 '10

What am I not getting about Ajax.ActionLink?

2 Upvotes

Here's my code, I'm trying to emulate the nerddinner thingy and having a partial update with a partial view that updates itself. I should note here that the action works fine and the results are stored in the db, but the partial update never happens. If I refresh the page I'm getting the result I should have had without refreshing. Tested in all relevant browsers.

Context: <h4>Commentaren:</h4> <% if (Model.Comments.Count > 0) %> <% { %> <% foreach (var comment in Model.Comments) %> <% { %> <% Html.RenderPartial("CommentUserControl", comment); %> <% } %> <% } %>

Controller: [UserAuthorize] [Authorize] public ActionResult VoteComment(int id, bool up) { Comment comment = crep.GetComment(id); CommentVote vote = new CommentVote(); vote.isup = up; vote.user = (Guid)Membership.GetUser(User.Identity.Name).ProviderUserKey; comment.CommentVotes.Add(vote); crep.Save(); return PartialView("CommentUserControl", crep.GetComment(id)); }

        [UserAuthorize]
    [Authorize]
    public ActionResult ChangeCommentVote(int id, bool up)
    {
        Comment comment = crep.GetComment(id);
        CommentVote vote = comment.CommentVotes
            .Where(v => v.user ==     (Guid)Membership.GetUser(User.Identity.Name).ProviderUserKey
            && v.comment == id).SingleOrDefault();
            vote.isup = up;
            crep.Save();
            return PartialView("CommentUserControl",      crep.GetComment(id));
        }

Partial View: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Ideas.Models.Comment>" %>

<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>

<script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>

<script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>

<script type="text/javascript"> function AnimateVotebox() { $("#commentbox").animate({ fontSize: "1.5em" }, 400); } </script>

<div id="commentbox"> <div class="display-label"> <i><%: Html.ActionLink(Model.User1.UserName, "Details", "User", new { id = Model.User1.LoweredUserName.Replace(' ', '-') }, null)%> zegt:</i> </div> <div class="display-label"><%:Model.text %></div> <% bool canPost = Ideas.Helpers.UserHelper.CanPost(HttpContext.Current); %> <% if (Model.CommentVotes.Count != 0) %> <% { %> <div class="display-label"><%= Html.Encode(Model.UpVotes)%> van de <%= Html.Encode(Model.Votes)%> gaan akkoord.</div> <% if (canPost) { %> <% if (Model.HasVoted((Guid)Membership.GetUser(Context.User.Identity.Name).ProviderUserKey) < 0) %> <% { %>Stem: <%= Ajax.ActionLink("-", "VoteComment", "Votes", new { id = Model.id, up = false }, new AjaxOptions { UpdateTargetId = "commentbox", OnSuccess = "AnimateVotebox" }, null)%> <%= Ajax.ActionLink("+", "VoteComment", "Votes", new { id = Model.id, up = true }, new AjaxOptions { UpdateTargetId = "commentbox", OnSuccess = "AnimateVotebox" }, null)%> <% } %> <% else %> <% { %>Wijzig stem: <% if (Model.HasVoted((Guid)Membership.GetUser(Context.User.Identity.Name).ProviderUserKey) == 0) %> <% { %> <%= Ajax.ActionLink("-", "ChangeCommentVote", "Votes", new { id = Model.id, up = false }, new AjaxOptions { UpdateTargetId = "commentbox", OnSuccess = "AnimateVotebox" }, null)%> <p style="color:gray; font-size:20;"">+</p> <% } %> <% else %> <% { %> <p style="color:gray; font-size:20;"">-</p> <%= Ajax.ActionLink("+", "ChangeCommentVote", "Votes", new { id = Model.id, up = true }, new AjaxOptions { UpdateTargetId = "commentbox", OnSuccess = "AnimateVotebox" }, null)%> <% } %> <% } %>

            <% } %>
        <br />
    <% } %>
    <% else  %>
    <% { %>
        <div class="display-label">Nog geen stemmen</div><br />
        <% if (canPost)
               { %>
     
                Stem: <%= Ajax.ActionLink("-", "VoteComment", "Votes",
                    new { id = Model.id, up = false },
                    new AjaxOptions { UpdateTargetId = "commentbox", OnSuccess = "AnimateVotebox" }, null)%>
                <%= Ajax.ActionLink("+", "VoteComment", "Votes",
                    new { id = Model.id, up = true },
                    new AjaxOptions { UpdateTargetId = "commentbox", OnSuccess = "AnimateVotebox" }, null)%>
            <% } %>
    <% } %>
    <% if (HttpContext.Current.User.IsInRole("Moderator") || HttpContext.Current.User.IsInRole("Administrator"))%>
    <% { %>
        <%: Html.ActionLink("Geef probatie...", "ProbateUser", "Mod", new { comment = Model.id }, null) %>
        <%: Html.ActionLink("Verwijder...", "BanUser", "Mod", new { comment = Model.id }, null) %>
    <% } %>

    </div>

r/ASPNET • • May 18 '10

Classic ASP on IIS7

Thumbnail blogs.iis.net
2 Upvotes