Last post Mar 23, 2015 03:31 AM by jassi_tkm
Mar 13, 2015 06:58 AM|jassi_tkm|LINK
I have created an ASP.NET Azure WebForms application. It has its default database and I can access it & modify AspNetUsers table using IdentityModel.cs (EntityFramework) as shown in many sites.
Now I have created other tables in the database namely "Projects", "customers", etc. and also have designed aspx forms based on those fields. Now I am not able to get, how to associate these forms wit the tables in the database. I wouldn't prefer Scafolding
as many sites show, instead I would prefer something like IdentityModel does. I can have control to retrieve data, display, show, edit, add functions based on my button clicks or so.
I read many tutorials & blogs but couldn't get how to achieve this as I want. Tutorials shows using Scaffolding & MVC. I also looked to add "Entity Data Model" in projects, but none create .cs file; so again lost their. Can anyone please help me know how
can I achieve what I am trying to.
Please any help is highly appreciated.
Mar 22, 2015 09:37 AM|Kevin Shen - MSFT|LINK
Thanks for your post here.
I am not sure what do you mean associate these forms wit the tables in the database.
If you want to bind data just like mvc,Except Scafolding ,Maybe you need to associate the elements
in html with model by yourself.
Mar 23, 2015 03:31 AM|jassi_tkm|LINK
All I was looking out for was, I had created databases & had created views (aspx) & class's for each table (normal class) files. So was looking for, using the modern technology how to link these class with DB & in views.
But as didn't receive any response from anywhere, so I just gave up and starting from scratch created the Models & Scafolded them.
Thanks for responding after so long also.
If possible, can you please assist me in these forms (I am stuck since long & can't get a solution on how to achieve it) :
This is in regard to - I have a Model scafolded. In that model I have a property of type ImageUrl. In the scafolded form I am not able to make up how to add file upload, access it in the code behind & assign the file name to the property. I tried adding
FileUpload control on the form, but then I am not able to access it in the code behind. On adding the same FileUpload control out of formView, then I can access it & it works. But I want it in the form.
This is in regards to - In a Model I have a property of List<OtherModel>. What I was looking is, in this model form, I have the OtherModel's list so can add the values in the list directly and things become more convinient rather than having other link to
add items in List<OtherModel>.
I know they are not of this forum, but if you can help would be great. If wanted, I will add that post here also and share you the link.
Please help me in the above issues, if possible.