|
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?
|
|
|
|
|
hi guys
please help me
i want to fetch all link in the site
do you have component for robots web ?
|
|
|
|
|
Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Use http://htmlagilitypack.codeplex.com/[^]
eg :-
HtmlWeb hw = new HtmlWeb();
HtmlDocument doc = hw.Load();
foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href]"))
{
}
Please up vote if it helped you
Thanks And Regards
Sibeesh
|
|
|
|
|
Please how can I create group box in asp.net to group controls together. Also, I want to know how to style web forms in asp.net. Thank you.
|
|
|
|
|
You would style forms using CSS.
You can use a div to group controls together.
We'll need something more specific if you are looking for a more specific answer.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi. I can't figure out how to implement this as I am new to asp.Net.
I am building a Library Management System in asp.Net using C# and SQL Server 2008 r2.
There will be a Book Issue and Return Date respectively for each book.
Now my question is How can I enable the Application to automatically add a numeric value to SQL Database on the expiration of the Return Book Date( Note that the Return Book Date will vary )
SQL Job scheduling was suggested but I think it does not meet my requirements as in my case the Date after which the job will be executed differs i.e the Book Return Date for each book.
Any suggestions will be helpful.
Thanks
|
|
|
|
|
If you're just looking to calculate the number of days the book is overdue, it would be better to calculate the value as required:
SELECT
...
CASE
WHEN ReturnDate >= GetUtcDate() THEN 0
ELSE DateDiff(day, ReturnDate, GetUtcDate())
END As DaysOverdue
FROM
Books
Otherwise, set up a SQL job to run every night to process the books which should have been returned on the current day.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|