|
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
|
|
|
|
|
I wrote a simple ASP/C# website using dynamic creation of controls, but when I updated VS2013, my project started having problem with displaying controls.
The problem is as follows:
http://i.imgur.com/KAwTy3e.jpg[^]
-On start, the page looks ok, but when I press any button (postback), the table on may page disappears, but the controls in cells are staying, but not in place because table disappeared, but one under the another. So the page breaks in half in my case.
It looks like this:
My Code:
public partial class _Default : System.Web.UI.Page
{
Table TblMainTop = new Table();
TableRow TblRow_Top = new TableRow();
TableCell TblcT_Logo = new TableCell();
TableCell TblcT_Status = new TableCell();
Table TblMainCenter = new Table();
TableRow TblRow_Center = new TableRow();
TableCell TblcC_Control = new TableCell();
TableCell TblcC_Source = new TableCell();
PlaceHolder PHolder = new PlaceHolder();
Control LOGO;
Control STATUS;
Control CONTROL;
private void Create_MainTable()
{
LOGO = LoadControl("~/LOGO/Logo.ascx");
STATUS = LoadControl("~/STATUS/Login.ascx");
CONTROL = LoadControl("~/CONTROL/Navigation.ascx");
TblcT_Logo.Controls.Add(LOGO);
TblcT_Status.Controls.Add(STATUS);
TblcC_Control.Controls.Add(CONTROL);
TblRow_Top.Cells.Add(TblcT_Logo);
TblRow_Top.Cells.Add(TblcT_Status);
TblRow_Center.Cells.Add(TblcC_Control);
TblMainTop.Rows.Add(TblRow_Top);
TblMainTop.Rows.Add(TblRow_Center);
TblMainTop.BorderWidth = 5;
PHolder.Controls.Add(TblMainTop);
PHolder.ID = "Test";
UpdPanel_Main.ContentTemplateContainer.Controls.Add(PHolder);
}
protected void Page_Load(object sender, EventArgs e)
{
this.Create_MainTable();
}
}
That’s how it looks in browser before postback:
<div id="UpdPanel_Main">
<table id="tojeID" border="0"
style="border-width:5px;border-style:solid;">
<!--
</table>
</div>
That’s how it looks in browser after postback:
<div id="UpdPanel_Main">
<style type="text/css"></style>
<div id="ctl03_PnlMainLogo"
style="height:221px;width:1171px;"></div>
<style type="text/css"></style>
<div id="ctl04_PnlMainLoginState"
style="height:221px;width:529px;"></div>
<style type="text/css"></style>
<div id="ctl05_PnlMainNavigation"
style="width:301px;"></div>
</div>
Here you can download light version of my project:
http://ge.tt/6xSPKBj1/v/0
Can someone gave me any advice ? I don’t know what is going on.
|
|
|
|
|
|
It is no use to me becouse i want to update my page all the time and it was working before as intended, and now it is not with no reason.
|
|
|
|