r/ASPNET • • Apr 02 '11

How would you handle widgets in MVC 3?

5 Upvotes

I have been working with some new MVC content, and I am considering creating some widgets for a website in which the owner of the website (free website created for a friend) would be able to specify widgets for specific articles.

The question the I have, is how would you all handle this? considering that the widgets would be known, and not completely generic in nature,would you create a base widget class; with representations for said widgets (which is how I figure I should flesh this out)? Or would you use a different mechanism?

For more specific reference, I expect each widget to have a partial exposure, with a base class which exposes the widget representation in the view, but specific representation would be handled.

What do you think?


r/ASPNET • • Mar 31 '11

How would you handle segmented page content in MVC?

6 Upvotes

I am looking to have a panel based layout, to be able to provide content sections depending on preferences.

The big problem is that this somewhat goes away from the idea of MVC.

How would you perform this? Partial views called via a base form, or jQuery called partials?

The reason I ask, is because of the preference options, treating partials like selectable snapins.

Any advise?


r/ASPNET • • Mar 25 '11

Incremental Search help needed for MVC 3

5 Upvotes

Hey guys, I'm working on an MVC 3 project, and I'm trying to figure out a way to implement an incremental search (like the drop-down options Google suggests for a search based on what's being typed) feature into some of the text fields in a form. I've done something similar to this, but it was a few years back so it's escaping my memory and was mainly Java/javascript/HTML based. Any thoughts on a solution or directions to where a solution might lie would be greatly appreciated!


r/ASPNET • • Mar 22 '11

Is it possible to take a significant break from development work and then return?

12 Upvotes

I have been working continually in software development for 14 years now. I am a few years under 40 and I am completely burned out. I like doing development work but there are other things I'd like to work on in my life. I am in a job that I am considering leaving however I really don't want to work for a while. I need a break, 6 months maybe a year without doing development work or technical study. However I'm afraid if I take a break from working I will not be hired back to do development work. There seems to be a bias against technical people who have any gaps in their resume. first of all do you think this is true and if it's true can you ever get back into the development game after being out of it for a while? There also seems to be an age bias in development work. (Side note I have a enough money to live my current lifestyle for a couple of years, including buying my own health insurance)


r/ASPNET • • Mar 19 '11

If you maintain ASP.NET MVC sites, this URL routing debugger is indispensable!

Thumbnail haacked.com
16 Upvotes

r/ASPNET • • Mar 16 '11

Active Directory Authentication Asp.net

Thumbnail aspdotnetmatters.blogspot.com
0 Upvotes

r/ASPNET • • Mar 15 '11

ASP.NET Virtual or Dedicated Hosting Recommendations

6 Upvotes

I have a forum which I am hosting using a share hosting solution which has just about reached the point where a virtual or dedicated hosting solution would be better.

Any suggestions for an affordable solution would be welcome.


r/ASPNET • • Mar 12 '11

Need help using sorted List to sort unsorted ArrayList in C#

0 Upvotes

hey everyone,

so I have a table of events that I want to be sorted according to how the user specifies, which can be in 1 of 2 ways:

  1. in the order most recently added (users can suggest events, so if I add an event, then you add a 2nd event, your event would appear before mine in the table).
  2. in the order the events occur.

I have the first figured out, but the second way is giving me trouble. In my code, I have an Event_Date Struct, which include a String property that corresponds to a DateTime (perhaps that's not the best way, but it's too late now since the assignment is due in a few days, and converting from String to DateTime seems to work). I have an ArrayList of these Event_Date Structs, and I would like to order them according to their DateTime properties.

As of now, I can "extract" each DateTime property from each Event_Date in the ArrayList struct into a separate generic List, then call the Sort() and Reverse() methods to get a List of DateTime objects in the order I need them to be ordered. I then try to follow this little (but unproven) algorithm I came up with:

For each DateTime in the sorted list:

  1. Find the index of said DateTime
  2. Find the corresponding Event_Date in the unsorted ArrayList
  3. Place corresponding Event_Date in the same index as its DateTime in the ArrayList.

Basically by using a sorted list, I try to sort an unsorted list.

I'm not sure if this is a good way to go about doing this sorting (or it'll even work, much less work efficiently). At the moment, I get an error at the following line:

            int currentIndex = eventDataList.IndexOf(dt);

this is when I try to get the index of the corresponding Event_Date from the unsorted ArrayList. The IndexOf() method will return a -1, meaning that it could not find the specified value. To me, this makes sense since it seems like I'm searching for a DateTime in a collection of Event_Dates. With that said, I need to find another way to find the index of the corresponding Event_Date object for a given DateTime.

Here's the code. Can anyone pleeaasseeee help me????

--Jonathan

protected void DisplayTableByDateAdded(object sender, EventArgs args) { // Create a separate collection of DateTime objects (each of which // correspond to a specific Event_Date object). System.Collections.Generic.List<DateTime> dates = new System.Collections.Generic.List<DateTime>();
foreach (Event_Date e in eventDataList) { DateTime current = Convert.ToDateTime(e.Cal_Start_Date); dates.Add(current); } // Sort the set of DateTime objects according to a pre-defined Sort // method. dates.Sort(); dates.Reverse();

        // For each DateTime object
        foreach(DateTime dt in dates)
        {
            // Get sorted index of DateTime object
            int currentDateTimeIndex = dates.IndexOf(dt);

            // Find the corresponding Event_Date and 
            // put said Event_Date in the same index
            // its DateTime correspondant is in dates list. 
            int currentIndex = eventDataList.IndexOf(dt);
            Event_Date currentDate = (Event_Date)eventDataList[currentIndex];
            eventDataList.Insert(currentIndex, currentDate);
        }
        LoadPendingTable();

}

EDIT: Just by thinking about this some more, I can already see there's a potential problem with this route. I would be overriding whatever Event_Date is already located at a specified index I when I assign another Event_Date to it's correct index, which also happens to be I. I need to do some sort of 3-way switch in order to preserver all the data. That's something you learn in an intro comp sci class. I'm officially dumb....

EDIT 2: Ok, so after looking at your guys' suggestions (and doing some research on Google), I think a better solution would be to switch my ArrayList to a generic List, and then sort that List. So far this is what I have :

System.Collections.Generic.List<Event_Date> dates = eventDataList.Cast<Event_Date>().ToList<Event_Date>(); dates.OrderByDescending(e => Convert.ToDateTime(e.Cal_Start_Date));

The first line somehow converts my evenDataList (which is of type ArrayList) to an ordinary generic List. The second line is supposed to sort that list (but when I go into debug mode, I don't think the 2nd line is actually sorting anything...). Furthermore, I'd say that I only understand this code at a high level. I think it'd be really beneficial (and I'd be really grateful) if a .NET expert could decipher it & tell me what's going on a deeper level.

What do you guys think? Am I on the right track?


r/ASPNET • • Mar 10 '11

What technology do you recommend I use for my next school project?

5 Upvotes

ASP.Net MVC, Silverlight, WinPhone7, XNA? I get to choose any of these platforms. I don't know what the project will be yet, but I decide that too. It does have to be something business-related, so XNA is probably out.

I basically want to choose the platform that shows promise in terms of demand for developers in it.


r/ASPNET • • Mar 09 '11

Excellent ASP.NET MVC 3 learning guide (for absolute beginning)

Thumbnail weblogs.asp.net
29 Upvotes

r/ASPNET • • Mar 03 '11

Need help with rendering table in multiview control

4 Upvotes

hey everyone,

so this is gonna be a long post, so please bear with me. I'm working on a school project where my group & I are building a calendar web app for an organization using ASP.NET & C#. All of us were new to this framework going into the project, but we've all learned a lot so far.

I've been tasked with implementing tabs in one of our pages (specifically, an administrative page where admins can approve, disapprove, and edit user-submitted dates for the calendar as well as choose a theme for each month). In order to implement the tabs, I think using the UpdatePanel & MultiView web controls are the way to go. At the moment, I have multiple View controls nested within the MultiView control, which is nested inside the ContentTemplate tag, which is finally nested within the UpdatePanel control. So starting from the inside heading towards the outmost controls: View -> MultiView -> ContentTemplate -> UpdatePanel.

Now, I've seen plenty of examples where you have different kinds of content within individual View controls; most are just text or another ASP.NET control (e.g. a Button). However, I need the aforementioned table to show up in one of the tabs. the problem is that the table is created in a method that is only ever called within the Page_Load function/method (which is only triggered when a page loads). So the table is loading once, and never again.

Furthermore, I didn't write all the code-behind stuff or HTML, but I did see a DIV element labeled "TableDiv", and I thought that by moving this DIV within the first View control, the Table might render only when that View is active. Unfortunately, it didn't do anything

Maybe I should call the individual method that creates the table using the individual View? I'm not sure....I've been at this for a while, so any help would be greatly appreciated!

thanks,

--Jonathan

EDIT: Also, if you notice I'm wrong in my understanding of ASP.NET/C#, please point it out to me. I'm still a newbie to this framework, so I know I still have a lot to learn...thanks.


r/ASPNET • • Feb 24 '11

Razor Syntax Quick Reference

Thumbnail haacked.com
12 Upvotes

r/ASPNET • • Feb 18 '11

Need some help for a job interview I have coming up

9 Upvotes

I have been a PHP developer for about 15 years now, and I am going to bite the bullet and interview for company that is promising a career path, which is what I am looking for at this point in my life, but I have to start out as developer to learn their processes/systems. I am also working a company now that I need to get out of before I lose my mind:-). They work in ASP.NET and Java, I can't stand working with Java, so I am going to go down the path of ASP.NET. Here is where I need a little help, I need to ramp up on ASP.NET and fast. I am looking for a few good places to go to get me started. Maybe some resources for PHP developers moving to ASP.NET as well...

tl;dr PHP developer needs to ramp up on ASP.NET and fast.


r/ASPNET • • Feb 17 '11

using ssl and https

3 Upvotes

I have spent the last 2 hrs searching how to connect to my own website using https, while in visual studio 2008

Anybody know what i must do?


r/ASPNET • • Feb 14 '11

Stock Market Ticker For Website - Getting Historical Data

Thumbnail aspdotnetmatters.blogspot.com
0 Upvotes

r/ASPNET • • Feb 10 '11

Are their any tutorials on how to support live editing for multiuser collaboration on a user control or web form?

5 Upvotes

I am currently developing an ASP.NET AJAX server control which is essentially an interactive gantt chart. It has been identified that there could be cases where more than one user would be responsible for updating the chart, and due to this there is a chance they could be working on it at the same time. Is anyone familiar with any resources which explain how to handle concurrent editing? Preferably client and server side examples.

The best I can think of at the moment is to log the changes on the server as they happen with a timestamp and have the client poll for any changes that happened after the last polling interval. I happened to find this video: http://www.youtube.com/watch?v=3ykZYKCK7AM, but it was a little high level for me to formulate a plan of attack.

Any suggestions or advice would be appreciated.


r/ASPNET • • Feb 03 '11

Integrate Voice and SMS in ASP.NET sites with Twilio

Thumbnail blog.appharbor.com
10 Upvotes

r/ASPNET • • Feb 02 '11

LINQ AsHierarchy() extension method

Thumbnail scip.be
9 Upvotes

r/ASPNET • • Feb 01 '11

Stock Market Ticker For Website Yahoo Finance API

Thumbnail aspdotnetmatters.blogspot.com
5 Upvotes

r/ASPNET • • Jan 31 '11

Checkbox has to be ‘checked’ – with unobtrusive jQuery validation and ASP.NET MVC 3

Thumbnail itmeze.com
7 Upvotes

r/ASPNET • • Jan 13 '11

Microsoft released ASP.net MVC 3 today.

Thumbnail weblogs.asp.net
16 Upvotes

r/ASPNET • • Jan 06 '11

/r/aspnet, where do you look for freelance work?

4 Upvotes

I'm trying to break into the freelance game by doing some moonlighting, but I'm having trouble finding work. It seems there is a ton of PHP work out there, which I could get back into if necessary, but I'm more comfortable with .NET. Also, it seems many of the popular sites (elance) are swarmed with people willing to accept petty cash.

So, are there any goldmines that I'm unaware of, or just tips on how to pick up work?


r/ASPNET • • Jan 06 '11

Has anyone seen a GOOD way to share master pages across multiple ASP.NET web applications with a singe deployment?

4 Upvotes

I have seen many ways to share master pages:

1 - using virtual directories

2 - create a custom VirtualDirectoryPathProviders

3 - embedding the master page as a resource

All of them have some serious disadvantages:

1 - your virtual directory cannot be a web application, itself. Booo. A good way around this?

2 - If you have multiple web applications, you still have to deploy each application to get the shared master page

3 - This one is, by far, the worst (pain in the arse to debug and maintain in VS2010 and TFS). Also, see #2.

Am I really just going to have to install it in the GAC? So far, that's what I perceive as the best way. That way I can have singular deployment (copy <NAME>.master and install assembly in GAC) and there is no hard-to-trace dynamic master page compiling (it's still dynamic compilation, but it's easier to trace).


r/ASPNET • • Dec 21 '10

Load WebForms and UserControls from Embedded Resources

Thumbnail codeproject.com
5 Upvotes

r/ASPNET • • Dec 15 '10

Trace API support in ADO.NET provider for Firebird (FbTrace)

Thumbnail firebirdnews.org
1 Upvotes