I am very new to ASP.net and C#, so I am trying my best, but there are stille many things that confuse me, especially because when I am looking at various examples online they give me different answers to the same solution, which just makes it even more confusing.
I made a person class, with two subclasses (driver and admin), but I can not get the ArrayList to show up when I run my Index file. I only get a parse error.
Here I get the error: "An object reference is required for the non-static field, method, or property."
If I remember correctly, a solution to this would be to make a static ArrayList, but I am not sure how I can do it for this code.
Hi again and thanks once again.
I did do ask you said. The reason why I tried playing around with the ListBox line is because I am getting an CS0103 error: "The name ListBoxResults does not exist in the current context", which I don't get, because I looked in my index file.
I have migrated asp.net 2.0 VS 2005 application to VS 2015 (framework 4.5).
Site loading fine. But when i click on the menus available in the page, actually it is not adding localhost in the redirection url.
My Home Page : http://localhost:1087/CGP/Home/Home.aspx. This page is loading fine.
In this page I have side menus and each menu "Profile" will have hyperlink like : CGP/Emp/Profile.aspx
But when I click on the menu "Profile" it is redirecting to http://CGP/Home/Home.aspx.
The term localhost is missing. I am not sure how to handle this.
I've been developing in ASP.Net for over 12 years and, though it was a bit of a learning curve to start, feel the webforms environment is, for most purposes, pretty good. When MVC came on the scene (first via 3rd parties such as Castle's, then through MS's own offering) everyone pretty much jumped ship declaring it the best thing since sliced bread. As I had a commitment to supporting a number of webforms applications, I didn't initially have any need to switch; and subsequently haven't found any compelling reason to do so. I've looked (briefly, admittedly) at MVC but felt it was a steep learning curve and didn't seem to offer any advantages, and have some actual disadvantages, to what I was used to.
I answered a question in Q+A today where I mentioned Webforms, and the need to decide whether to go webforms or MVC, and a subsequent comment was "I will not recommend webforms".
So I'm curious: what is it about MVC that makes it so much better than webforms? Is it simply that it's flavour of the month and commercial requirements for webforms developers has crashed? (plug: I have a requirement for a webforms maintenance developer ... message me for more details)
Is it that MVC is a lot "better", or do people feel webforms is actively "bad"?
My applications, using webforms, successfully separate business functionality from presentation issues (and indeed database/storage access from business objects). They implement multi-level inheritance, use custom controls to implement standard functionality, incorporate AJAX-based interactive features (not using Microsoft AJAX controls); and have proven to be flexible and extensible. Not yet found anything I can't do with Webforms.
Guess I must be the biggest opponent of WebForms here, even as far as calling it stupid.
What I didn't like?
Didn't like the way they tried to make it like WinForms, in which objects create HTML. So you create all these labels which are just span tags. Then when you go to port your HTML to another framework, you have to change all the objects back to actual HTML. As a negative effect, you never really master HTML or HTML5. If you stick with WebForms and not move forward, you stay stuck in that world of objects for years, never really moving forward to support phones, tablets and desktops.
I also got burned by the Ajax Control Toolkit. It worked great locally, but failed on long distance connections. The Partial Update control worked the same way. They added so much junk that was never really stable. Perhaps a WebForms app written for in-house use might be OK, but not for world wide production use. And then all of this stuff has to play nice with the Web Server such as IIS. It seems like WebForms with it's ViewState worked tightly with IIS server in order to post data back, and IIS server would have to keep track of every session out there.
Google just didn't play nice with WebForms. WebForms had a way of placing a script on the page, and using a weird URL for it's location that Google didn't like. I think it was a query-string added to the script name. Then Google complained about other elements I had no control over. And then the single use of the Form element, and having to work within that parameter or rule.
I could name probably 10 more things I didn't like about it.
I dumped WebForms and went MVC, and loved it. After the steep learning curve, I was able to reduce the time for new projects in half. Learned how to write very effective models and are close to my database designs. With views and razor, I was able to create new UI that where more user friendly, and much more fluid. Learned Gulp to package my CSS and compress files.
Then I dumped MVC and went .Net Core MVC loving it even more. Delivering blazing fast speeds but I still didn't care for Razor much. But my SEO tests were off the charts and Google loved it.
Last, I took the Angular jump, Angular wrapped in a .Net Core project. Figured out how to pack all my stuff like SASS, and compile it into a single project that runs in a Docker container. With this technology, I can now focus on providing a great user experience, with super efficient models and database designs, with blazing fast speeds. I spend very time writing code, in which most are just a few lines. I don't have to worry about slow connections any more.
Now I can develop in 1/16 the amount of time it took me in WinForms. My website below is version 298 at the moment. I have no regrets at all about leaving WebForms, even MVC as well. The WebPack train is running and lots of people are hopping on the train.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
Maybe I spoke too soon, one of my Docker MongoDB container crashed. First time in 7 months since I figured out how to use Docker that any container has crashed. 7 months uptime is not bad.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
Didn't like the way they tried to make it like WinForms,
That was pretty much the design principal. Many people's experience with writing "rich" MS apps was WinForms so they tried to move that stateful, event-driven methodology that people were used to onto the web so there wasn't as much of a learning curve.
you never really master HTML or HTML5
Because you don't write your own input tags? Input tags are probably 0.001% of html and html5. Like any technology, you can use it in different ways. Apart from the input tag issue you still have to do all the other html and css yourself. Also you don't have to use server controls, there is nothing stopping you using html only if that's your bag, it just means having to manage the state yourself.
Perhaps a WebForms app written for in-house use might be OK, but not for world wide production use
LOL, ok. Back in the day it was webforms or nothing so trust me, many world wide production apps were using webforms.
It seems like WebForms with it's ViewState worked tightly with IIS server in order to post data back, and IIS server would have to keep track of every session out there.
You don't seem to understand webforms very well. Of course it is tied to IIS. So? And ViewState is nothing to do with sessions, it's effectively a page-level session that IIS doesn't need to track, so kind of the opposite to what you said. Also Sessions remain in MVC too, they're not a webforms thing either.
Google just didn't play nice with WebForms
Again, simply not true. Google doesn't really care about your script tags.
And then the single use of the Form element
Gee, I wonder what I'm going to say here? You can use as many forms as you want with webforms.
I dumped WebForms and went MVC...Then I dumped MVC and went .Net Core MVC...Last, I took the Angular jump
It seems to me that you just think "the latest thing" is amazing whatever that is, and the second something new comes out the thing you used to love is now garbage. A lot of your complaints aren't really webforms related, they stem from how you choose to use it, and things like gulp tasks to bundle, sass etc might make "new" tech seem better, but again that is unrelated to webforms, you can still use all of that tech on webforms projects.
As for your website, it look me about 10 seconds to put it into a broken state....
Which seems like a good idea, until you see all of the developers who've never had to understand how it works "behind the scenes", who don't know which part of their code is running on the server, which part is running on the client, or even what the difference is between the two.
A problem that isn't helped by Visual Studio, where you develop and debug your server code in an interactive process on the same machine you use as the client.
Sometimes a learning curve is a good thing.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
I agree, but we now have the advantage of hindsight. Back then they obviously thought different, and have since changed direction as web dev is now so ubiquitous there is nothing wrong with making it a completely separate discipline.
As for "why does my code work on my local machine but not after I've deployed" brigade, we had that on classic ASP, web forms and it still exists in MVC, you can still write server code where the html goes, but I think the fact that people are conditioned against writing code in the view means we see less "Why does Word not show when I click button, it works on my local machine" questions.
Last Visit: 31-Dec-99 18:00 Last Update: 13-Aug-22 15:12