|
Try changing your DropDownList call to:
@Html.DropDownListFor(model => model.Category.ID, ViewBag.CategoryList, "Select Category")
The version you're using at the moment renders a list with the name "CategoryList" , which doesn't seem match any of the properties on your view-model.
Also, it's not clear how the Category property on your view model is implemented. I'm assuming it delegates to a property on the Merchandise ? If not, you'll need to connect the two objects in the POST method.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how to insert a img in database
|
|
|
|
|
By writing lots of code. Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
When your image uploads, it's usually uploaded as a base64 string that represents bytes.
You can just save the Base64 string in the database column, or convert the string to a byte.array, and save the image as bytes in the database. With bytes, you can write the byte array to the disk drive as an image. So get use to converting the data. Another cool thing about storing as bytes is that you can pump those bytes into a function to resize the images, tweak it and send it back out as bytes.
Remember in your database design, to include the filename, the url of where you would want to store the image for the browser to fetch, and the type, jpeg, png.
I have post from 3 months ago that talks about this.
|
|
|
|
|
How can i create a setup for asp.net application in visual studio 2015?
|
|
|
|
|
There are different ways to create deployment package
You can create a package in the following ways:
- Use tools in Visual Studio.
- Use the MSBuild command directly from the command line.
- Use the MSBuild command indirectly from PowerShell or Team Build.
- One-Click Publish (Click once deployment)
see below link for more details
ASP.NET Web Application Project Deployment Overview[^]
Find More .Net development tips at : .NET Tips
The only reason people get lost in thought is because it's unfamiliar territory.
|
|
|
|
|
It depends where you want to deploy. We are using publish into AWS cloud.
|
|
|
|
|
Dear members,
I worked on ASP.NET 2.0 and C# last in 2011, and after that worked on some other field. Now I have to use ASP.NET back for a website development. But i guess a lot has changed over the years.
I just need to know whether I have to get started all over again, or are there some things that I should now understand first.
Thanks
|
|
|
|
|
That is impossible to answer in a forum like this. Things change so rapidly now that 5 years worth of changes means you have a lot to catch up on. The best place to start would be the ASP.NET website[^].
|
|
|
|
|
MVC is a big addition from 2011. You can still do WebForms (I am) but I think many would argue that MVC is the current way to go. Many use angular.js with MVC.
There is also the Entity Framework which you may have not used. I don't care for it but that may be because I don't use it properly.
Lambda and LINQ are probably new to you but are not ASP.Net specific but can be very useful.
If you didn't use jQuery that has become very big.
Good luck. Lots of good articles on this site.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
2.0 was long back then after 3.0, 3.5, 4.0, 4.5, 4.5.2 was introduced each has their different features, here are listed below
for 3.0/3.5
- Windows Presentation Foundation (WPF)
- Windows Communication Foundation (WCF)
- Windows Workflow Foundation (WWF)
- Windows Card Space (WCS)
for 4.0
- Application Compatibility and Deployment
- Managed Extensibility Framework
- Parallel Computing
- Networking
- Web
- Client
- Data
- Windows Communication Foundation
.Net Framework 4.5 Features
- .NET for Windows Store Apps
- Portable Class Libraries
- Core New Features and Improvements
- Tools
- Parallel Computing
- Web
- Windows Presentation Foundation (WPF)
- Windows Communication Foundation (WCF)
- Windows Workflow Foundation (WF)
Find More .Net development tips at : .NET Tips
The only reason people get lost in thought is because it's unfamiliar territory.
|
|
|
|
|
Why can't check yourself in official ASP.NET website?
|
|
|
|
|
What the others said.
However, you should consider your own situation. WebForms still works fine. MVC is "cooler" but the transition from WebForms to MVC.NET is not easy.
If you used the AJAX Toolbox (or whatever it was called): it's been abandoned. Instead, MS chose to support the community behind jQuery.
So if you're just updating an existing site, perhaps you would get by simply making things nicer with jQuery. If on the other hand you would like to be more up to date, you should probably look into MVC.NET (and perhas some of the other things mentioned in these replies).
The problem with web development is that things move so fast that as soon as you get the hang of a language or framework, it's almost obsolete, especially if you're not working with web development on a daily basis.
|
|
|
|
|
In a vb.net 2010 web form application, I have a request from the user to be able to insert,update, and/or delete a row
in a single table. Thus I have the following questions to ask:
1. I am trying to decide if I should use a detailsviews, formview, gridview, and/or a different control for this purpose.
Thus would you tell me what control you would recommend and why you would recommend that particular control?
2. For the different options for insert, update, and delete, would I use the buttons that are on the control that you
recommend? If not would I use, new buttons that I place on the webform page?
3. For the control that you recommend that I use, should I place the sql 'embedded' in the sqldatasource, the control
you recommend and/or access the sql from a different location(vb.net code in a new location)?
Would you tell me , show me with pictures, and/or point to me to links (urls) that will show me how to accomplish
this
|
|
|
|
|
The traditional way of solving this is using a master/detail scenario:
1. Drag a gridview to the site, and bind it to the database's table. Rightclick it and choose to have a Select field shown.
2. Drag a details view to the page, and bind it as well. In its bidning window, you can graphically set a WHERE statement. Set your statement to Control, then chose your gridview as the control. Also click the advanced button to enable DELETE, UPDATE, and INSERT.
If done right, this means that when a user clicks the Select button for a particular row in the gridview, this row's data will appear in the detailsview. Then it can be updated or deleted, and more data can be inserted from the detailsview.
I don't know how much you know about binding to a database, but be sure you stay out of SQL injection trouble.
Note that searching for master/detail, gridview and detailsview you should be able to fond a lot of info on how to do this.
Good luck!
|
|
|
|
|
Hi,
I am new to ADFS SSO implementation via SAML 2.0.Could you please guide any one to accomplish below requirement.
I have requirement to implement single sign on using ADFS,once you click on sign in through adfs button it should create saml request like mydomainname/adfs/ls/?SAMLRequest="" then it will redirect to ADFS login page then after successfully validation adfs should send response to our consumer page which our back end code will validate the response if it is valid then proceed further.
It is urgent requirement.quick response will help my day simpler.It will great if some one shared related link to follow.
Thanks for your help in advanced.
Regards,
Prasanna
|
|
|
|
|
|
Hello. I have a side panel that is layed out like this:
<div class="panel panel-default">
<div class="panel-heading">
<h4>To Do</h4>
</div>
<ul class="list-group">
<asp:Repeater runat="server" ID="rptToDo">
<ItemTemplate>
<li class="list-group-item"><a href="Landing.aspx?Don=<%# Eval("ID") %>">X</a> <a href="Details.aspx?ID=<%# Eval("ID") %>"><%# Eval("ItemName") %></a></li>
</ItemTemplate>
</asp:Repeater>
<li class="list-group-item">
<asp:Panel runat="server" DefaultButton="btnAddToDo">
<input type="text" runat="server" id="txtAddToDo" class="form-control" placeholder="Add Item" />
<asp:Button runat="server" ID="btnAddToDo" Style="visibility: hidden;" OnClick="btnAddToDo_Click"></asp:Button>
</asp:Panel>
</li>
</ul>
</div>
Instead of having that text box at the bottom to add new records to, I'd like to put a good button or link of some sort to the right of my title , but still inside the gray area. I can't quite seem to get it to line up. Any help would be greatly appreciated.
|
|
|
|
|
It's looks like your using bootstrap with webforms. I haven't seen anybody do that yet. Interesting.
You would have to divide the title using the row and grid that bootstrap provides, because grids can only be childs of row.
<div class="panel-heading">
<div class="row">
<div class="col-sm-8">
<h4>To Do</h4>
</div>
<div class="col-sm-4">
<button class="btn btn-primary" type="button">Add +</button>
</div>
</div>
</div>
|
|
|
|
|
Hi All,
As per our client request, I am going to convert our MVC 4 application into ASP.Net core. What are all the common development and deployment difficulties that may occur during conversion process? Please provide your valuable suggestions on this.
Best Regards,
Simiyon A
modified 12-Jul-16 5:09am.
|
|
|
|
|
I gave it a shot over a month ago. Core is way different.
I think you have to use VS2015 to do core, and add the DotNetCore Development Kit to it.
Then you can open a new core project. I wasn't able to upgrade a project to core, but had to start a new project and build it piece by piece. I found that most of my classes were not compatible with core and had to be partially rewritten.
Plus you have to add Docker, so you can test the core and run it. Docker can be Mac, Linux and Windows based, doesn't matter.
After that, you just post the core to a server with Docker, and off you go!
I ended up postponing core development, to finish my project first, and then go to core. Maybe next year.
It's the way to go, but too much for me to chew on one time. I just adopted Node.js and Gulp, plus Sass for CSS and Bootstrap so I have my hands full at the moment.
|
|
|
|
|
I have an MSChart control on a web form that displays numerous line graphs. But I am unable to apply a text annotation. Nothing works thus far. I tried to add with VS 2013 community in both the designer and run-time code. Nothing shows up. But no errors are shown, either. Any suggestions?
Nothing from Microsoft was helpful. Or elsewhere in my search, although I noted lots of difficulties with this control.
|
|
|
|
|
what you want to do exactly with text annotation, MSCHART support shape, text, group annotation, which one you want to use ?
try with following simple snippet, see if it works
using System.Web.UI.DataVisualization.Charting;
...
LineAnnotation myLine = new LineAnnotation();
myLine.Name = "myLine";
myLine.X = 3;
myLine.Y = 3;
Chart1.Annotations.Add(myLine);
Find More .Net development tips at : .NET Tips
The only reason people get lost in thought is because it's unfamiliar territory.
|
|
|
|
|
i have class User and my object have id
user.ID = 555
the user model have property
[ForeignKey("ID")]
public virtual IList<post> PostNames { get; set; }
i have class post :
public int IdUser { get; set; }
[ForeignKey("IdUser")]
public virtual User users { get; set; }
i get user.PostName - count = 0
and i know i have something in my database in post table.
What am I doing wrong ??
|
|
|
|
|
user.PostName - count = 0
Simple question. How can you substract a number from a string.
?????
|
|
|
|