|
You're using ASP.NET Core. Instead of:
var events = @Html.Raw(Json.Encode(ViewBag.ListaEventos)); use:
var events = @Json.Serialize(ViewBag.ListaEventos);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hello , guys I am working on hotel system can any body share source code with me please, its very important!
this's my email "showmore5@gmail.com"
thanks very much
|
|
|
|
|
No, nobody here is going to do your work for you.
And it's not "very important" to anyone other than you.
If you want to hire someone to write some code for you, there are sites where you can do that. This isn't one of them.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I worked on a booking system in the 90s, it took approx 18 months to build, not test just build. Mind you it is in SuperBase!
I can send you that code for a small recompense.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I did laugh out loud at that!
I think I can probably find mine from the 80's - developed for C/PM though so probably a bit more expensive than yours
|
|
|
|
|
HAHAHAHA
Member 14921707 wrote: its very important!
If it was, you'd be paying and not begging.There's free solutions available. What makes you think I take the time to build you a new one, without pay?
How much time (aka money) do you think one needs to put into building one?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I'm sort of fuzzy on this here. So I have a HttpPost operation that ends with return Ok(result). I remember reading that I have to add a route to GetOrder in order for CreatedAtRoute to work. I sort of did something stupid and named that api GetAdminOrders so I can secure it with JWT, but added a Route decorator to it so CreatedAtRoute would work.
var result = CreatedAtRoute("GetOrder", new { order.Id }, order);
return Ok(result);
So this didn't work, it didn't return the order back to the client making the call. I just need the order number or Id of the order and not the whole order. Now I'm wondering if I should refactor all of these that I created. I'm really wondering if I got this all wrong here.
[HttpGet("GetAdminOrder/{orderId}"), Authorize(AuthenticationSchemes = AuthSchemes, Policy = AuthPolicies.Admin)]
[Route("{orderId}", Name = "GetOrder")]
public async Task<GetAdminOrder> GetAdminOrder(string orderId)
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I flipped the 2 around, and changed the route to include the route decorator at the top of the controller.
I guess this route decorator wiped out the first route decorator.
[Produces("application/json")]
[Route("api/[controller]")]
[ApiController]
public class StoreController : ControllerBase
[Route("{orderId}", Name = "api/[controller]/GetOrder")]<br />
[HttpGet("GetAdminOrder/{orderId}"), Authorize(AuthenticationSchemes = AuthSchemes, Policy = AuthPolicies.Admin)]
public async Task<GetAdminOrder> GetAdminOrder(string orderId)
On this, it worked before, but since the .Net Core upgrade, it has changed. Now it sends the order wrapped in Url and Value. So I changed my client to expect a value of "any", and coded the expected order number and token as result.Value.OrderNumber
var result = CreatedAtRoute("GetOrder", new { order.Id }, order);
return Ok(result);
It works, not sure if it's fixed.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
jkirkerx wrote:
CreatedAtRoute("GetOrder", new { order.Id }, order)
...
HttpGet("GetAdminOrder/{orderId}") IIRC, the parameters passed to CreatedAtRoute need to have the same names as the route parameters.
Your route has orderId , but you parameters has just Id .
Try changing the parameters to match.
You don't need to add both HttpGet and Route attributes.
You should also return the CreatedAtRoute result directly, rather than wrapping it in an Ok result.
return CreatedAtRoute("GetOrder", new { orderId = order.Id }, order);
[HttpGet("GetAdminOrder/{orderId}", Name = "GetOrder"), Authorize(AuthenticationSchemes = AuthSchemes, Policy = AuthPolicies.Admin)]
public async Task<Order> GetAdminOrder(string orderId)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I didn't think of it like that.
At the beginning before I wrote the JWT auth policies, I tried to make the app really code compact. It was just "GetOrder", then I renamed it to "GetAdminOrder" to reflect JWT Auth. I really need to streamline this naming.
return CreatedAtRoute directly? No need to return Ok. I wonder if using Ok wraps the JSON result in that extra envelope. I'll find out here, takes 10 mins to test it.
I made the code changes, and will give it a try, I'm sure it will work fine. I really don't want the extra route decorator anyways, it was just part of an example of using CreatedAtRoute I picked up over a year ago. I must admit that using CreatedAtRoute is pretty handy.
var result = CreatedAtRoute("GetAdminOrder", new { orderId = order.Id }, order);
return Ok(result);
[HttpGet("GetAdminOrder/{orderId}", Name = "GetOrder"), Authorize(AuthenticationSchemes = AuthSchemes, Policy = AuthPolicies.Admin)]
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
That worked out really well!
Thanks Richard
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
kindly help me to solve this issue.....i have Created a Login website - Validation Controls Registration Page but my submit button doesn't show message code i wrote which was:-
Response.Write("YOU HAVE SUCCESSFULLY REGISTERED...!!!!");
|
|
|
|
|
Please edit your question and show the code that has the problem. Without it it is impossible to guess what may be wrong.
|
|
|
|
|
button code was one line code and here it is,
Response.Write("you have successfully registered!!!");
once i fill out my web form registration form and i click on submit button nothing is displayed from what i wrote on button code(submit)
|
|
|
|
|
Please read my suggestion again.
|
|
|
|
|
but i didn't understand ..kindly break it for me
|
|
|
|
|
In addition to what Richard said, asp.net doesn't work like that, response.write is useless in 99% of occasions. If you view the source of your page you'll probably see your message right at the very bottom where it is no use at all. If you want to show a message in a particular place use an empty asp:Label or asp:Literal and when you want the message to be there set the Text of the label\literal to your message, you can also use the Visible property to show\hide it.
|
|
|
|
|
Kindly where can i find asp:label? or literal and how am i going to use it? kindly direct me
|
|
|
|
|
|
Just the same way you used to add the button control, same way you will find the Label control and add it.
Or just copy this
<asp:Label ID="Label1" Text="Label1" runat="server"/>
Then from codebehind, enter this code on your submit button event.
Label1.Text = "You have successfully registered";
|
|
|
|
|
How can anyone help you without seeing what you did?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
In researching my options for a new development endeavor based on my current, desktop, document management system for individuals, I once again turned to the ASP.NET MVC paradigm as consideration.
Having worked on a very large ASP.NET MVC application a number of years ago, I was already quite familiar with the general foundations of the MVC paradigm within the ASP.NET development environment. Thinking that this environment is the way to go for new web application, I began to re-familiarize myself with the technologies involved since I have been primarily working in WPF for the past several years.
After spending several weeks relearning these technologies I came to the same conclusion I did those years ago that the ASP.NET MVC paradigm is nothing more than an overly complex, inefficient way to build database intensive applications. The moment one needs to include complex, interface components, ASP.NET MVC provides little efficiency in doing so.
As a result, to do this, one has to turn to large amounts of JavaScript frameworks and control suites to support such interfaces along with all the arcane techniques in coding the support for such interfaces.
Currently, the ASP.NET MVC\Core tools environment has exploded from a limited set of useful adjunct tools (ie: jQuery) to such a plethora of such tools that one new to this type of development would have a very difficult time in attempting to understand where to start.
As one who has done an extensive amount of ASP.NET WebForms development, I often wonder what drove our profession to turn to such a complex architecture as ASP.NET MVC and now ASP.NET Core (which is just another name for MVC).
It seems to me, that my colleagues, young and old, were complacent enough to allow our primary development tools vendor, Microsoft, to set the conditions and terms of our development futures by simply accepting their technology roadmaps for the future. So how's that been working out for everyone? In a recent announcement, Microsoft has stated that both WebForms and Windows Communication Foundation will not be supported in the newer releases of the .NET Core Frameworks. Refining the .NET Framework is certainly understandable but eliminating core technologies which has thousands applications relying on the original technologies is certainly draconian to the companies that require such ongoing support. And what are they to do; invest hundreds of thousands of dollars to rewrite applications that are working well enough to be maintained in their original form simply because Microsoft no longer wants to support them. That's their job!
When Bill Gates was the CEO of Microsoft, we had a person who more or less was committed to the development community's needs and requirements.
To be sure, he wasn't perfect but for the most part he fell in line with the overall needs of our profession.
In 2010, when Stave Ballmer was starting to take the reins of Microsoft, ASP.NET MVC was introduced to the surprise of many of us ASP.NET WebForms developers who had experience with the Classic ASP development environment. Practically to a person, the reaction to this new paradigm was that of a giant step backwards. Little did we know at that time how truly backwards MVC was considering that its foundations were designed in the 1970s.
The Castle Project for quiet sometime had been freely offering its own ASP.NET MVC Open Source project, MonoRails, but it never found much interest in the Microsoft Development Community. ASP.NET WebForms, even with all its inefficiencies and issues, was still an environment where complex web applications could be easily developed and tested.
But the naysayers for this environment quickly enough got their voices heard and for some reason, many professionals began to listen. The claims by these professionals was that ASP.NET MVC offered developers a brand new environment with much greater control over their interface development processes. But in terms of efficiency and accomplishing actual development, such control was in reality a mirage.
So we gave up easy to implement server controls for either JavaScript equivalents along with whatever standardized HTML offered in this venue.
We gave up easy to develop n-tiered application development for a range of technologies that in reality didn't really offer anything that we already had. Was it the fault of ASP.NET WebForms that many developers chose to implement massive amounts of code in the web page code-behind modules when most of it should have been placed in tiered libraries?
Certainly with the complexities of ASP.NET MVC and now Core, poor application development was just as much a danger to software quality as the original environment was. But wasn't that supposed to be the choice of the developer?
And what about this nonsense, which everyone touts as "a separation of concerns"? What, developers cannot understand how to do this without a new paradigm to help them along!?
Of course we have the claim that ASP.NET MVC allows for Test Driven development. So what? What type of tests is anyone going to write for a database intensive application where the majority of such work will be the correct updating of data or its retrieval? Developers can no longer understand their own results? Has anyone considered that try-catch blocks are the best way to capture erroneous processes? And what other way would one do so in the event?
In the 1990s a former chemical engineer turned software engineer wrote an excellent manual for developing top performing client-server and web applications. He demonstrated the correct way to create such applications all of which was based on efficient n-tiered architectures with all of his work bench-marked to demonstrate its credibility. To this day, I have not come across a single organization that actually implemented any of this person's constructs.
Lets take a single example from this man's work to demonstrate this. To increase application performance at the very least by 50%, one should divide their database systems to handle both OLTP transactions for updating and OLAP for data retrieval. This way, two sets of database servers (clustered or not) divide divide the work so that the data access type benefits from the most efficient way of processing them.
Too much work (and costs) for organizations to consider was the basic, unstated reason for ignoring such a design.
So the propagandists in our profession decided that manipulating all of the code would be better way to achieve such performance. Well, guess what? Hardware engineers and specialists in the 1990s also demonstrated that this was and still is complete nonsense. Developing high performance web applications is completely reliant on quality hardware that can perform well. No amount of code manipulation will make a web application work better if the underlying hardware is not there to support it. Of course, with bad code one can certainly make a web application perform poorly but with good code, the benefits to speed can only be maximized so much. Remember that the underlying architecture and protocols of the Internet are still the original ones designed in the 1970s.
In 2005 or a little later another book was produced by a Silicon Valley software engineer, entitled, High Performance ASP.NET Applications. This book corroborated the earlier hardware engineer findings by demonstrating that not only was proper hardware necessary for good performance but that its configuration (both hardware and software) was vital as well, which this book showed one how to do.
This book hardly made a ripple on our profession since most such implementations were handled by teams that had little to do with actual software development.
Over the years we have gone from one ridiculous, development paradigm to another, none of which really abided by classic and well researched software engineering standards. Instead it became the tools we used instead of how we actually developed our applications.
Just a few years ago, another software engineer took a medium sized ASP.NET WebForms application and converted it to the ASP.NET MVC environment to understand the performance differences since there has been really very little such research done in our profession (Unfortunately, I have since lost the link to this engineer's findings.) What this engineer found was that there really wasn't a significant difference between a decently written WebForms application and that of an MVC one.
I doubt that with all the latest tools from Microsoft and other third-party vendors this difference has really been greatly changed. Again, it goes back to the hardware for which recent years have seen great strides in the internal workings of the various chip-sets and disk drives.
So why ASP.NET MVC\Core???
Younger generations of developers really do not have the experience to make such comparisons while the older developers, of which there are really few of us left any longer, should have known better.
It seems to me that the real reason for the growth of the MVC paradigm had nothing to do with any significant increase in developer productivity or application performance. How could it be with the massive complexities that have become part and parcel to such development. As a result, this smacks of a foundation for job security more than anything else. The more complex a skill is, the fewer people can master it. And that means fewer quality developers for the hiring.
I mean, who in their right mind would use ASP.NET MVC\Core and then tout its benefits? And for whom by the way? Certainly it is not the corporations who allow its implementation since there isn't a single reason that anyone has espoused that provides for better development efficiency that a corporation could take advantage of. Does one really believe that a few saved milliseconds actually enhances a corporation's operational efficiencies?
In my long career, I have developed just about every type of application there is to develop within the business development environments with the few exceptions of such applications such as trading applications or the like. Nonetheless, using our original tools at the time, I and my fellow colleagues were able to produce high quality software that rarely if ever produced issues for our users.
And yet today, with all the wonders of software, technological advances, many web sites do not operate properly and many are increasingly being breached with huge amounts of critical data being appropriated. Any security specialist could tell you that part of this rampant criminality is the construct of the Cloud but also, simply the inherent complexity of what we use to develop, which provides fertile ground for increased defects and vulnerabilities for our applications.
ASP.NET WebForms may be dead and of course now shunned. However, had the professional development community insisted that Microsoft rectify its flaws, the company would have done so and was doing so until its shunning became too much of a burden for Microsoft to credibly maintain.
I believe that my profession has bet on the wrong horse. And with the stresses and complexities in web development today, it appears that this bad bet is causing us a lot of issues. From dissatisfaction in our work to contending with increasing amounts of defects, it may be time that my colleagues reconsider their decision to support such a cantankerous, development environment. Or maybe too many of you are simply to heavily invested to do so.
Sometimes, returning to the old ways is the best course of action for the future. And with the technological quagmires we have in our lives today, maybe overall simplicity should be the overriding concern for deciding upon a development technology.
Whatever the critics of this piece may say, they simply cannot deride the overall simplicity in development efficiency and the greater compartmentalization of such development that ASP.NET WebForms provided.
Who are you going to listen to; some engineer who is promoting a paradigm, an ideology, or someone who is promoting a tool that just got the job done and done well...
Steve Naidamast
Sr. Software Engineer
Black Falcon Software, Inc.
blackfalconsoftware@outlook.com
|
|
|
|
|
Thank the great Ghu I retired before I had to get involved with the current kludge of web tech. I still have not forgiven them for the death of Silverlight! I did think I would take the time to learn new tech out of interest but anything to do with the web just fells so 80's.
Marketing, especially well funded and supported marketing will always triumph over good product and when your primary tool supplier decides on a technology there are not many who will be able to break away from that supplier.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Mycroft...
A fan of the great detective are we?
In any event, I completely agree with you regarding the ASP.NET MVC environment and all the other subsequent tools that developers apply to it.
It did not encourage me to retire when I did in 2014 but I was seeing the writing on the walls.
As I believe I mentioned in my original post, most developers were actually aghast at the basis for the ASP.NET MVC paradigm as most remarked that it returned our development backwards to the 1990s and Classic ASP.
To date, this is exactly what the new Razor Pages software provides; files mixed with markup and C# code (instead of VBScript).
I cannot for the life of me understand why so many developers turned against ASP.NET WebForms when it was capable of so much.
The only additional tools we required to work with WebForms was a good foundation in JavaScript and jQuery and possibly a good third-party tools provider. That was it... And still is.
It appears that when dealing with the younger generations in general they are no longer capable of understanding anything that is beyond their scope of perspectives. But they are sure fast to adopt whatever the technical vendors provide them.
Maybe I am getting too old but there is fight left in me yet.
Steve Naidamast
Sr. Software Engineer
Black Falcon Software, Inc.
blackfalconsoftware@outlook.com
|
|
|
|
|
Steve Naidamast wrote: A fan of the great detective are we No that was the name of the computer in The Moon is a Harsh Mistress
Steve Naidamast wrote: but there is fight left in me yet Tilting at windmills more likely!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|