|
Hello !
I want to create a MVC 5 application using Visual Studio 2013 .
I have the following problem :
I created a controller to display data from a table and then created a view using Add View for the
return View(); method . The view is created , but when I try to go to the view from the controller , the "Unable to find a matching view" error is shown . How can I link the view to the controller ?
Sorry if this question was asked before .
|
|
|
|
|
Problem solved , apparently my view wasn't named properly .
|
|
|
|
|
Hi,
Your View Name is same as controller Method Name and also in correct folder as per Controller Name ?
Thanks
Raviranjan
|
|
|
|
|
I created the view , but renamed it , so the controller didn't recognize it . Thanks !
|
|
|
|
|
Hi,
I want to develop a Survey module using MVC4, for that i have a set of questions for each questions i have 4 options & these options should be radio button in the application and all questions will be having same options
EX, Agree,Disagree, Strongly agree,Strongly Disagree.
How can i achieve this using MVC4. I tried several links but no link is helping out
EX: Tried This[^]
NOTE: I am a beginner in MVC
|
|
|
|
|
Hi Vishal,
So you mean that, let say Quetion1, Question2, Question3,... and for each question you will have Option1, Option2, Option3, Option4 and for each question you will have - Agree,Disagree, Strongly agree, Strongly Disagree,
Like
Question1
Option1, Option2, Option3, Option4
Disagree, Agree, Strongly Agree, Strongly Disagree
Question2
Option1, Option2, Option3, Option4
Disagree, Agree, Strongly Agree, Strongly Disagree
.....................
Right?
Thanks
Raviranjan
|
|
|
|
|
Hi Raviranjan,
Thanks for the reply,
Ya exactly i wanted and achieved it,
Thanks
Vishwa
|
|
|
|
|
Hi Vishwa,
Below i am giving idea how you can do it.
In View on top
@model IEnumerable<question>--> This is basically the list of Question that you have to return from controller method
Then HTML Code for Displaying the Question and their option
@foreach (Question question in Model)
{
@Html.DisplayFor(modelItem => question.QuestionText)
foreach (Option option in question.Options)
{
option.OptionText : @Html.RadioButtonFor(opt=>option.OptionID,option.OptionValue)
}
<HTML for like> Agree, DisAgree,...
}
The Class of Question and Option will be like below
public class Option{
public int OptionID{get;set;}
public string OptionText{get;set;}
public string OptionValue{get;set;}
}
public class Question{
public string QuestionText{get;set;}
public List Options{get;set;}//This will contain all 4 option
}
Class name and properties you can put whatever you want, i have just wrote sample.
Let me know if you have any doubt.
Thanks
Raviranjan
|
|
|
|
|
Thank you so much for the help.
I was trying something and achieved it.
|
|
|
|
|
Hi everyone.
I'm looking for the solution of Add New Row on ADO.NET
Currently, I'm using ADODB.Recordset to insert / update the Value.
Ussually, my code is
Dim rstDB as ADODB.Recordset = new ADODB.Recordset
rstDB.Open("Select * From Test Where 1=2" , MyConnection, 2,3)
With rstDB
.AddNew()
.Update()
End With
rstDB.Close
So, if I want to insert into another Table, what i need to is change my Query and reuse "rstDB" again.
My Question is,
Is there any way to do that on ADO.NET with SQLDataAdapter ?
I appreciate if you can give me sample code.
Thank in advance.
Thomas from Vietnam
|
|
|
|
|
Hello,
I am a new to MVC and I am tasked to develop a role based security portion of our current MVC razor application having the user authentication done via AD then once authenticated determining authorization via our entity framework model. Now, once the user navigates through the application MVC Views, menu and button controls on each View are hidden or shown based on their permissions.
Currently, the application controllers return a single MVC model object with all of the current required values contained in it (i.e. m.EmployeeName, m.CustomerName, etc.) but as you know no user or role information.
At this point I really don't know the best way to implement this. What do I add to the entity framework model. Next, from the controller GET only a single model object is returned in the view(model). How would I return the user's name and roles information along with the main model object? Also, any ideas on how the user/role admin view should work would be great. Anyone, please help!
modified 14-Jun-14 15:12pm.
|
|
|
|
|
I do think I found a very good solution for implementing the MVC Role manager functionally managing active directory roles via ASP.NET Identity System and using Entity Framework for maintaining state. I am going to refer to this article:
http://typecastexception.com/post/2014/02/19/ASPNET-MVC-5-Identity-Implementing-Group-Based-Permissions-Management-Part-I.aspx
for my solution. Because I am new to MVC, if anyone sees a problem with this functionally please let me know and correct me as necessary.
Thanks to everyone!
Steve Holdorf
|
|
|
|
|
Hi all,
I am using bootstrap with asp.net c# website, every thing is fine. but postback event of radio button and checkbox is not working.
can any one help me , how to do this. or how we can remove css/jquery for the radio button/ checkbox.
code used : <asp:radiobutton id="rdbtn1" runat="server" text="Check me" autopostback="true" oncheckedchanged="radio_checked">
<asp:checkbox id="chk1" runat="server" text="radio button" autopostback="true" oncheckedchanged="chk_checked">
please help.
thanks
|
|
|
|
|
is your page load event called ? please check.
if yes then please check have you set any default check for checkbox/radiobutton in page_load ? because checkbox/radiobutton server side event not fired when checked property is set to true
Or you can Get it inside an update panel, with property "ChildrenAsTriggers" on true
|
|
|
|
|
Hello thanks for you response,
i checked your suggestion but this is not working.
|
|
|
|
|
Hey There!
I'm new to ASP.Net I want to build a web site for school. I want to make an admin panel by which I may update my site i.e. upload .pdf files, picture gallery, news-update etc. How can I manage all these things with Admin Panel and from where I will have to start.
Reply me with details
Thanks who share there knowledge not for money but for Happiness.
|
|
|
|
|
|
|
Hi
I want to get resolution of client (width,height) and get it in page load of master page
I get resolution with javascript but it runs after page load event so pass it null value
so any one help me to solve this problem
Thanks all.
|
|
|
|
|
Hi all,
Can somebody help me to know when click Ctrl+N event in Asp.net website then which event is fired at page level.
I just want to implement bank like security. but don't applying the [Right Click Disable] or [Ctrl/Shift key] functionality.
Kind regards,
shiv
|
|
|
|
|
Nothing. The browser should intercept this key code and open a new tab/window as the case may be.
|
|
|
|
|
so if any one want to identify this event using c# or any median. what is the procedure. actually i just want to identify this event and prevent user to open a window in new tab. many people suggest me to add javascript to disable ctrl, but i dont want. becoz the requirement to open the cut, copy, paste option but prevent user to opening new window in new tab or new browser window.
|
|
|
|
|
shiv shanker 7 wrote: so if any one want to identify this event using c# or any median. what is the
procedure. actually i just want to identify this event and
I do not think there is a dependable way from a plain vanilla scripting to interfere with the browser's engine itself.
shiv shanker 7 wrote: and prevent user to open a window in new tab. many people
If your application itself is running in a popup window then you can control the key sequences. Then you may need to provide CTRL+C and CTRL+V yourself as the case may be appropriate.
|
|
|
|
|
If your application itself is running in a popup window then you can control the key sequences. Then you may need to provide CTRL+C and CTRL+V yourself as the case may be appropriate.
if possible, please provide me the code example or URL links for this functionality.
|
|
|
|
|
I have an aspxGridView which it's datasource is a datasource with some data from a table in my db. I want to put an external aspxComboBox and show 3 fields(columns) from datasource. When user starts typing in aspxcomboBox automatically open 3 selected fields and filter the aspxGridView. Can can anyone help me?
|
|
|
|