Component Versus Action/Request Based Frameworks
Jul 8, 2010
Probably one of those things you know and use every day without thinking what it is:
Do you think Component based frameworks are better than Action/Request based web frameworks?
From the naming I think I'm using both (of course, I must be wrong if things are asked like this).
My web front-end (Pages and Code behind / Views and Controllers) are Request/Action while my other layers are Component based...no?
Or does this apply to specific frameworks or ways doing things?
View 4 Replies
Similar Messages:
Jan 7, 2010
What is the difference between Request.RawUrl and Request.Url in ASP.NET?
View 3 Replies
Feb 2, 2010
What are the differences (behind the scenes) between Page.User.Identity and Request.LogonUserIdentity? Not the differences in type, name, etc but the differences in how they're implemented behind the scenes (i.e. one calls windows xxx api and the other calls asp.net xxx api...).
View 1 Replies
Feb 19, 2010
1. Can you explain me what is component based development ? What I am already doing is using layers (user interface, custom types, data access layer and busines logic layer). For example for filling a drop down list with countries what I do is getting data from DAL using custom types in my BLL and BLL return a list of countries to user interface. Now in my opinion it is a plug-able component that I can use anywhere. Should it be called a component ?
2. What is a component a method ? or class or a assambly ?
3. Can components be like that (methods and assemblies) or they are services to embed ?
4. Actually I never have used services, if component can be in both ways (services & classes and assemblies) than what approach is better, should component be made in form of assemblies or services ?
5. Without being so technical any general rules on making re-usable components ?
View 2 Replies
Sep 6, 2010
I am starting to design my own CMS , and i want it to be modular to add more functionality later by me or by any other developer I put my eyes on joomla CMS (very popular ,robust and extensible) I want to make a CMS with asp.net to be just skeleton and all functions are done through components
Functions like :-
User management
Content Management ,editing and display etc.
My main idea is to let the skeleton to know from the query URL the required component and pass all other parameters to it and the component do the rest (parse parameters display results etc.)
the problem is how to achieve this how to call the component and and how to let it render its UI and pass it to the skeleton to put it in the appropriate place in the main site template
View 4 Replies
Jan 15, 2010
I'm making a urlrewriter component and I need to set the action attribute of the html form tag to the virtual url. This is easy to do in the page that has that tag but I want to do it from within the component. I have a class called UrlRewriterModule which inherits from IHttpModule and in the OnPagePreInit method I run the code:
[Code]....
This actually works... but... this code presumes that I have a page which has a masterpage where the form tag is located.
How can this be done so that it will work with any hierarchy? I want to access the form tag wherever it is located.
View 1 Replies
Sep 16, 2010
What is the difference between; Deploying an application Releasing an application Implementing an application
View 1 Replies
Aug 3, 2010
I am trying to stop the data flow when certain conditions happen in the script component. Like if a row in the data set has an invalid date, I dont want that dataset to be inserted in the tables or go through OLEDB Destination, rather I want the entire data flow for that dataset to stop and go back to the control flow page.
I have tried mulitple solutions but nothing worked. Conditional Split ends up inserting the correct rows, but I just dont want anyting to be inserted when one row is bad, where as I do want the entire dataset to be inserted if all rows are good.
How can I fail the component when certain conditions happen int eh script component.
View 1 Replies
Mar 14, 2011
Well I have a web page asp.net(page1.aspx) amm user can choose two options A/B if user chooses a when he is in page2.aspx i want a javascript was execute
function(receive parameter)
{
}
But if he chose option B function never will be executed. I want to do, if user chooses A will see a asp button, but if he choose option b he is not going to be the button
View 2 Replies
Mar 29, 2011
I currently have a project that I seem to have ran into an issue regarding Roles and thought I would get some opinions on how to best handle the problem. The system will require editable, flexible roles that control not only the access of specific areas, but also the use of system functions (Adding Users, Editing Users, Viewing Reports etc.)The system currently allows users to have multiple roles, each of those roles has explicitly defined areas of access/actions, for example:
Role A can access areas 1,2,3 and can Add Users.
Role B can access areas 1,5,7 and can Modify Users.
Role C can access areas 4,6 and only View Users.
so a User could be in Roles A and C, and thus access : 1,2,3,4 and 6, and could Add and View Users.My first solution was to create a dictionary that would store all of the possible areas of access/access options into a Dictionary like so:
Dictionary<string,bool>
then when it is instantiated it pulls all of the properties from the database and then iterates through the roles to determine if they are accessible.All of that currently works just fine - however the project is quite Javascript/jQuery intensive so many of these options are called by client-side functions. I am trying to avoid having to wrap all of these client side functions with:
<%if(AccessDictionary[key])
//Enable or Disable Action
<%}%>
I am wondering about the following things: After a user logs in, what is the best way to store this Dictionary? Statically? In the Session?What would be the best method of storage such that the Dictionary will be easily accessed in the View? (As I currently see no way around wrapping my client-side functions)!
View 1 Replies
Jun 29, 2010
Is there a way to control when a data annotations validation is performed based on the actionmethod that you are in? For instance I have a model that I have decorated with a custom validation attribute that checks to see that at least on of three properties has a value. The current view does not contain a way for the user to assign a value to those properties the next view in the workflow does. When I submit the first view and check that the model state is valid I am returned false since the three fields that should be filled on the next view have not been assigned a value, and I get stuck on the first view in the process.
View 1 Replies
Jun 29, 2010
In the create aspx page i have 2 buttons. One for creating the new customer and another one for searching the customer based on the customer last name. Now the issue is when i try to search the customer based on the last name the page is calling the create action method only, not the search action method. how to call a spicific action method from the buttons. I know it can be done using ajax post back but what i am looking at is to achive this in the normal post back itself.
View 3 Replies
Feb 7, 2011
While retrieving table data in grid view. How can I particularly select a row and perform any button action on that selected row. I'm new to asp.net.
View 2 Replies
Jul 23, 2010
I've gone rounds with this ever since I started programming classic ASP 12 (or so) years ago and I've never found a great solution because the architecture of ASP and ASP.NET has always been a swamp of bad practices, magic shared singletons, etc. My biggest issue is with the HttpApplication object with its non-event events (Application_Start, Application_End, etc.).
If you want to do stuff once for the entire lifespan of an HTTP application, Application_Start is the obvious place to do it. Right? Not exactly. Firstly, this is not an event per se, it's a magic naming convention that, when followed, causes the method to be called once per AppDomain created by IIS.
Besides magic naming conventions being a horrible practice, I've started to think it might be a reason there exist no such thing as a Start event on the HttpApplication object. So I've experimented with events that do exist, such as Init. Well, this isn't really an event either, it's an overridable method, which is the next best thing.
It seems that the Init() method is called for every instantiation of an HttpApplication object, which happens a lot more than once per AppDomain. This means that I might as just put my startup logic inside the HttpApplication object's constructor.
Now my question is, why shouldn't I put my startup logic in the constructor? Why does even Init() exist and do I need to care about Application_Start? If I do, can anyone explain why there is no proper event or overridable method for this pseudo-event in the HttpApplication object?
And can anyone explain to me why in a typical ASP.NET application, 8 instances of my HttpApplication are created (which causes the constructor and Init to run just as many times, of course; this can be mitigated with locking and a shared static boolean called initialized) when my application only has a single AppDomain?
View 2 Replies
Apr 4, 2011
I have an existing asp.net mvc website that uses basic forms authentication. The site has a login page that posts back to a login action, which logs the user in via FormsAuthentication.SetAuthCookie(). I am looking to add an api to the site, as an mvc2 area, where users would be authenticated based on a token passed as an http header. This area will consist of only json actions, so redirecting the user to a login page doesn't make sense. Instead, I want the users to just pass a token along with each request. That token is mapped to each user account and the user would be authenticated automatically.
I'm struggling with where to put this logic. At this point, the best choice seems to be adding the header lookup logic and authentication to the Global.asax in the Application_AuthenticateRequest method. I want to avoid needing to redirect the user after calling FormsAuthentication.SetAuthCookie(), though. I want the login action to be transparent to them. Am I approaching this the wrong way? As a side note: Requiring a username/password for api requests is not possible, as the site has a mix of users. Some joined using OpenID while the rest joined with a username/password.
View 1 Replies
Apr 2, 2010
I have to call functions in dataaccesslayer depending on the type of xmlrequest
xmlreq.loadXml(<Request><UserName value=""UserName""></UserName><Password value=""Password""></Password></Request>)
msg.Request=xmlreq
how would I call dataAccessLayer.Function1() if xmlreq looks like above (username and password)else call function2()
View 1 Replies
Mar 18, 2010
In one web page we use a flash upload control but becouse a flash bug in the upload event the session is lost as its posted back with a new session.
We have tought of using a table with ip and old session id or a query string with the old session id in order to reassing it in the uploaded event...
Knowing the old session id how can i reassign it to the client? (In C#)
View 2 Replies
Aug 11, 2010
I have a requirement whereby I need to be able to change the controller being used based upon a parameter. I am creating an application that needs to be dynamic enough to be able to change controllers on the fly. Let me explain further;
When the application starts a dictionary of custom controller names is loaded with a controller name as the key and a custom controller name as the value. This will be help in the application scope.
When a request is made I need to access the requested controller name, use that name and check to see if it matches a key in my controller dictionary and if so, replace the requested controller name with the custom controller name from the dictionary.
example;
My dictionary will contain data as follows
Key: 'Home', Value: 'Home_IN'
Key: 'Customer', Value: 'Customer_BE'
Now, the following request is made 'User/Edit/1'. Does the controller name exist in the dictionary? No, continue with original request.
Now, the following request is made 'Home/Details/2'. Does the controller name exist in the dictionary? Yes, replace the original controller name 'Home' withe custom controller name 'Home_IN' so changing the requested URL to be 'Home_IN/Details/2'.
Does this make sense?
My problem here is knowing exactly where in the request cycle I need to do this?
I am assuming I need to create my own custom controller factory?
View 7 Replies
Jul 12, 2010
I have a common base class from which all my ASMX webservice classes will inherit. In the constructor, I want to do some common authentication checks; if they fail, I would like to halt processing right away (subclass's code would not get executed) and return a 401-status-code response to the caller.
However, the common ASPX-like ways of doing this don't seem to work:
Context.Response.End(); always kicks back a ThreadAborted exception to the caller, within a 500-status-code response. Even if I explicitly set Context.Response.StatusCode = 401 before calling End(), it is ignored. The result is still a 500-response, and the message is always "thread-aborted-exception". MSDN suggests I use HttpContext.Current.ApplicationInstance.CompleteRequest() instead. However, this does not stop downstream processing: my subclass's functions are still executed as if the constructor had done nothing. (Kind of defeats the purpose of checking authorization in the constructor.) I can throw a new HttpException. This is a little better in that it does prevent downstream processing, and at least it gives me control over the exception Message returned to the caller. However, it isn't perfect in that the response is still always a 500. I can define a DoProcessing instance var, and set it to true/false within the constructor. Then have every single WebMethod in every single subclass wrap its functionality within an if (DoProcessing) block... but let's face it, that's hideous!
Is there a better / more thorough way to implement this sort of functionality, so it is common to all my ASMX classes?
edit: Accepting John's answer, as it is probably the best approach. However, due to client reluctance to adopt additional 3rd-party code, and some degree of FUD with AOP, we didn't take that approach. We ended up going with option #3 above, as it seemed to strike the best balance between speed-of-implementation and flexibility, and still fulfill the requirements.
View 1 Replies
Jan 9, 2011
I have a small vb.net-based page, displaying a booking form with a large dropdown of movies.
now this page can be opened on two ways, one is directly (no preselection=no problem)
the second way is with a link like "page1.aspx?movieid=400" which should open the booking table and preselect the movie with ID 400.
How can I do this in VB.Net?
View 4 Replies
Jan 30, 2010
For someone, new to .Net based Web development: what web development frameworks are provided with or are compatible with .Net framework 3.5 +.LikeASP.NET Web Forms patternASP.NET MVC framework / pattern (1.0, 2.0)an you provide links as well
View 4 Replies
May 18, 2010
I would like to know how can I list for every page (child page) selected the number and id of localize component in the current page. I need this to update resources files, a button will be on the master page and when they click on it, they will go to a page which show up every data in the resource file.
View 1 Replies
Oct 26, 2010
I use visual studio 2005 and now my team wants me to try my hand at some testing frameworks for asp.net websites.I'm completely new to testing. I want to know what kind of automated testing can I do.Can I test my business logic,Can I test my UI.I just started using NUnit and I am getting a hang of it. For Web UI testing I've tried Nunit asp.Somewhere I found about Selenium, which of this is better.Also is there an add-in to test Javascript code with NUnit.Is there an better alternative to NUnit.
View 1 Replies
Feb 21, 2011
As per the increasing security threats, my site needs extreme care in terms of security in all aspects. I know asp.net has built in some security measures (Anti-forgery token, cross-site scripting, authentication, roles), but that is just not enough.I need a tool to test all possible security threats (Brute-force attacks, .... IP location, browser info ... )and a framework (open source is better) that handles all these concerns and let you build upon.
EDIT,So to narrow a bit, my primary concern is protecting the "login" page from all possible threats.
View 2 Replies
Mar 17, 2010
I have decorated my base controller with a couple of action filters. They work fine.
One of those filters sets up the request - does things like set the culture based on the domain, etc.
I also have a handful of actions that require authorization using the Authorize attribute.
My problem is that when an user attempts to request a page they are not authorized to access, the authorization filter kicks in and redirects them to a page telling them that they cannot vie the page.
The issue is that the action filters never run so the culture and other request data is never set. This effectively causes language to be wrong in the view and other data to be missing.
I know that authorization filters run first but my question is this: How can I design this such that I can ensure that certain methods are always run before the view is returned, regardless of the authorization.
View 1 Replies