Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP.NET


Advertisements:










Create A Reusable Library Using MVC2-RC?


I am trying to write a simple library for MVC2 projects that takes care of user login, e-mail validation, password recovery, logging, etc. Since some of these steps involve user interaction, I need to have Views and Controllers in that project.In MVC2 Preview 2, one could do this by abusing areas (at least, it seems) since they were implementedas different projects. However, in the RC, creatinga new area will merely create a subfolder. Since I want to share the base code between applications, that is not an option.I tried to brutally hack the AfterBuild steps into my project files, but that feels like the craziest hack ever.


View 10 Replies (Posted: Jan 24, 2010 09:02 PM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
How To Build A Reusable Library Of User Controls
I want to build a reusable library of User Controls.

I found this article:

[URL]

While it works for me, but I find it a bit cumbersome to implement, expecially for future maintenance.Also, I noticed that if you create the User Control with code in separate file, it will not work. In this case, you will not get any error, but, the page where the control in registerted will not show (you will get blank page).Why I am getting BLANK result when I develop the User Control with code in separate file ?I appreciate your recommendation on the best approach to implement a library of Reusable User Controls. Also, I did not like the method of Web Controls, becuase they are difficult to implement.

Posted: Mar 16, 2010 03:58 PM

View 4 Replies!   View Related
MVC :: Create A Reusable Ascx?
In ASP.NET web forms we created few user controls (.ascx) which were used in almost all of the projects. I'm not sure how to achieve same in the MVC?

Posted: Jan 22, 2011 10:18 AM

View 2 Replies!   View Related
AJAX :: Create Reusable Tab Control?
I have been given the task to create a TAB control ( probably the Jquery tab control) as the company wants the Lazy loading of data.

The tab control should not have fixed items on it. It should be reusable in different projects . So I cannot fix the items in the tab control. Depending upon the project the tabs can change.

Need some great ideas on how I can achieve it.

Note: I am using MVC, VS 2008, C# for my development.

Posted: Jan 20, 2010 04:19 AM

View 2 Replies!   View Related
How To Create A Reusable Grid View Component Like Date Time Picker
I want to create a reusable user control which contains a date time picker in asp.net. Need to add this user control in a grid view as column.While clicking the column,date time picker has to be displayed.Which is the suitable method,Creating the component or creating the user control. Also want to know, How to add this component in to the toolbox?

Posted: Jan 5 10 at 15:31

View 2 Replies!   View Related
How To Create Reusable "widget" Markup Across Modules In MVC 2.0 Website
Scenario:

platform: ASP.NET 4.0, MVC 2.0 (doesn't have to be MVC if it's not the right solution)

Create various widgets that inherit the same core markup:

[code]....

The above "simplified" example should be in some reusable control or masterpage.

The flow is something like this:

Controller -> View -> Partial View (1..n) -> widget markup

User instantiates an action which calls a controller. The controller tries to render a view that contains content + multiple widgets (left rail, right rail, etc). The Widgets all have their own individual partial views but each partial view should inherit or consume a base set of widget markup and have controller areas where to embed functionality.

Functionality in the head, body, and footer can either be plain text, HTML, or additional custom controls.

What is the best recommended approach?

Posted: Oct 4 10 at 21:20

View 2 Replies!   View Related
Forms Data Controls :: Reusable Forms / Create One Form And Reuse It Across Multiple Projects?
We have a number ofprojects and acrossprojectscerrtain forms are duplicated.

Is there a way that I can create one form and reuse it across multiple projects?

Posted: Nov 11, 2010 10:53 AM

View 2 Replies!   View Related
How To Create View Form In MVC2 Application
am trying to create view form in my MVC2 applicationIn this i have a submit button which is an imagebut when i try to run it shows a normal windows button the image is not shown(the image is a round edged).the code is as below:

<input type="submit" value="Log On" id="login_button_75" />
#login_button_75 {
background:url(images/login_submit_button.png) no-repeat;
height:28px;
width:75px;
background-position:center;

Posted: Feb 10, 2011 08:12 AM

View 6 Replies!   View Related
How To Create A Textbox (from Toolbox) In Mvc2 Web Application
The toolbox says there is no usable control in this group?

I have to create a textbox in asp.net mvc2 web application?

Posted: Feb 18 at 14:02

View 1 Replies!   View Related
Proper Way Of Using FormCollection In .NET MVC2 Create Method?
I am currently developing an application with the new ASP.NET MVC2 framework. Originally I started writing this application in the ASP.NET MVC1 and I'm basically just updating it to MVC2.My problem here is, that I don't really get the concept of the FormCollection object vs. the old Typed object. This is my current code:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(FormCollection collection)
{[code]....

What are the benefits of switching to FormCollection in MVC2 and more importantly - how is it used properly?

Posted: Jan 28 10 at 15:59

View 2 Replies!   View Related
How To Create A Class Library Use SQL LINQ
i want create a class Library work with SQL Linq ,when i create a LINQ Data Class it automatic create some connectionString and use the database namemy question is can i change some settings that, use this class Library in difrent website with difrent connectionStrings?

Posted: May 24, 2010 01:23 PM

View 6 Replies!   View Related
Want To Create A Website For Library Management?
have few doubts running though my mind which I want to clear. Here is my scenariolet's say I want to create a website for library management.I need to have registration page where I will allow users to register and login. My doubt is : After login how do I restrict users from accessing only the authorized page ? also I need to make sure that they should not access pages by entering the url directly without authentication ? i don't want to use the login controls provided in asp.net by default.

Posted: Jul 11, 2010, 23:52

View 4 Replies!   View Related
Create New Project Web Control Library?
how i can create new project web control library in visual studio 2010i'm not found this type of project in visual studiio 2o1o

Posted: Jan 22, 2011 07:55 AM

View 2 Replies!   View Related
How To Create A Site Like MSDN Library In MOSS
I am in the process of creating an inhouse help file on a MOSS portal for my company's department. At the moment I have created a wiki on our department site and am busy filling it up with the necessary information.Feedback which has been most common is that my colleagues would like to have a dynamic treeview to make navigation through the help file a little more manageable. The basic sharepoint treeview does not meet the requirements and upon discovering MSDN library,I was quite intrigued by their treeview.

What I would now like to create would be something similar to the format of MSDN library, but then containing my department's content. Unfortunately I cannot easily find a method of creating such a site and after countless searches of MSDN, ASP.net and even google I am struggling think of how to tackle the issue.

point me in a direction in which I can start looking on how to achieve the creation of such a site and whether this is possible/feasible or even purchasable? I have access to Sharepoint Server and Designer 2007, but a limited knowledge of programming.

Posted: Aug 06, 2009 01:30 PM

View 1 Replies!   View Related
Web Forms ::create Webpart Library For The SharePoint?
I am trying to create a webpart library for the SharePoint. I have VS 2008 installed over XP and shrepoint is installed in another machine.

Is there anyway I can take the reference of shrepoint dll and create a webpart library without installing SharePoint in my local machine?

Posted: Sep 21, 2009 04:06 PM

View 1 Replies!   View Related
Create A Class Library For 2 Projects In One Solution?
how to create a class library for my 2 projects in one solution....?

Posted: Nov 06, 2008 10:56 AM

View 3 Replies!   View Related
Web Forms :: Create Validations In A Class Library?
I would like to learn to use Validations from a class library in my projects. I am trying to create a simple project, so when a button is pressed a validation from a method in the class library checks to see a textbox on my ASPX form if it has a valid integer in it and a label message display true/false. How abouts would I get this?

Posted: Nov 05, 2010 10:49 PM

View 2 Replies!   View Related
How To Create The Public Assembly By Using Class Library Template
i try to create the public assembly by using class library template. i tried like this

Namespace TestDll
Public Class Class1
Public Sub Summa(ByVal a
As Integer,
ByVal b As
Integer)
MsgBox(a + b)
End Sub
End
Class
End Namespace

After that i build the application then i got the Dll file. then i went to command prompt and create the Sn File. by using the below Command line.

Sn -k Sudha.snk

after that ican get the message."Strongname is written" then i made the few change in assemblyInfo.vb file. these are given below.

<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("Sudha.snk")>
<Assembly: AssemblyKeyName("")>

and save that file and then rebuild the application. while rebuild the application. i can get the error message. that is

"Error1Error creating assembly manifest: Error reading key file 'Sudha.snk' -- The system cannot find the file specified. "

Posted: Oct 14, 2008 09:32 AM

View 7 Replies!   View Related
SQL Server :: How To Create Database With Library Table Like Aspnet_applications
I want to create a database in Sql server 2005 with library tables like aspnet_applications, aspnet_profile etc.,

I want to provide admin interface[webform]for the client to create user in the aspnet_Users.

How can I attain this?

Posted: Feb 22, 2011 12:37 PM

View 1 Replies!   View Related
Free Library For Create Xls With C# Files On A Server Without MS Office?
Is there any free library for create xls files in asp.net on a server without office?

Posted: Mar 9 10 at 9:01

View 4 Replies!   View Related
MVC :: Create A Class Library Contains A Controller Based On Its Module?
In My Project I want to Create a Class Library Contains a Controller based on its module, Example : Class.Controllers.Album,Class.Controller.Artist

in this Class Library I wrote two Controllers AlbumController.cs, ArtistController.cs.When I add this to Main Project Contains Views,

Posted: Feb 22, 2011 03:00 AM

View 1 Replies!   View Related
Visual Studio :: LINQ Dynamic Query Library In Class Library
I'm having terrible trouble trying to get the LINQ Dynamic Query Library to work in anything other than a web project, where there also exists a Data Context in the same project. So, I've got my website, and class library which contains the .dbml file and the dynamic query code file. When I try an compile this class library, I get errors such as:

Type 'System.Data.Linq.Mapping.DatabaseAttribute' is not defined. Type 'System.Data.IDbConnection' is not defined.Type 'System.Data.Linq.Table' is not defined These errors occur in the desiger.vb file for my data context, and it seems like it's a clash of namespaces or a similar problem. Does anyone have any idea how I can solve this, actually done this, or know if this is possible?

Posted: Mar 27, 2008 09:26 AM

View 10 Replies!   View Related
C# - Twitter Api Library / Get The Twitters From Parse Out The New Ones And Use A Library To Retweet Them On Own Account?
I am looking at the twitter api page http://apiwiki.twitter.com/ and I noticed that they have already built libraries that are wrappers against the twitter api. So I am thinking this is the best way to go but I am unsure which C# library I should use.

What I am trying to do is make some simple service or cmd line application that will help me automate retweeting.

So I am looking for a library that will allow me to get posts from other twitter accounts and then retweet them from another account.

I am not sure if the library can do this or not. Otherwise I was thinking of getting the RSS feed from the twiter account I want to get the twitters from parse out the new ones and use a library to retweet them on my own account.

I have not used twitter much so I am hopping someone can shed some light on this.

Posted: Mar 2 10 at 20:51

View 2 Replies!   View Related
Reusable WebUserControl?
Could someone give me a small example how i canmake reusableWebUserControl (.ascx) file.Basically i need to make a employee lookuputility where users entersemployee id to get Emplyee information.Once the Emplyee information is available, it is used invarious data entry tasks by the page that includes the control.

Posted: Feb 12, 2010 06:51 PM

View 1 Replies!   View Related
MVC :: Reusable Components And Unique Ids?
I'm trying to create reusable "zones" but am having trouble figuring out how to give them all unique ids.What I'd like is to be able to create a component which can be put on an mvc page using the usercontrol syntax or using RenderAction or RenderPartial. I want to be able to update these components' content using ajax, so I need someway to reference them by id. However, there is no mechanism in MVC that wraps anything in a div or something like that.

I've learned that if I extend ViewUserControl and put the controls on the page like so:

[Code]....

This way, I can pass the previous ID and put it in ViewData, in case I need it laterThen, I can even go through all my controls on page load event in the master page and get my unique ID and write somekind of register javascript function to the page so that I can do javascript stuff if I want when the page loads.

[Code]....

Is there a more elegant way to do this? I see similar stuff from 'Areas' but never seen an example where someone has put more than one area on a page and then needed to reference them via javascript. This also seems similar to custom templates, but I'm having trouble figuring out how that would work.

Posted: Aug 24, 2010 08:26 PM

View 5 Replies!   View Related
Web Forms :: Creating Reusable Code?
I'm pretty new to asp.net and was hoping for a little help creating reusable code. Basically I want to have some textboxes (a form for the user to fill out), that can be used on different pages, and then on each page there will be a "Submit" button or something similar, which uses the information in the text boxes to do different things.So essentially, text boxes are being reused, and submit buttons are page specific.Hope that all makes sense. I've included a screenshot to help describe what I would like.

Posted: Sep 04, 2009 11:09 AM

View 3 Replies!   View Related
Reusable Code / Class Files?
I want have a web application that I am putting together - but I have started to see that some of the things I am writing are repeated over and over, example -

GetDepartments() in the code behind has all the database connections and is linked to a stored procedure.All it does is return Department Names' and Ids', ie then bind them to a dropdownlist.My question is this I have seen Class files - I want to know if I can put this type of information in there and just call it whereever I need it in the site and then bind to whichever dropdownlist I need to?I have had a look around the net and even saw some examples by scott mitchell - but it used datasets (.xsd) files etc and dont want to be using them, plus it was a little over my head. Does anyone know of some good simple examples out there that I can follow, or maybe some examples on here?

Posted: Jan 23, 2011 12:23 PM

View 2 Replies!   View Related
Best Approach To Implement Reusable SortedList?
I have a situation where I need to maintain a large number of related integer values in my ASP.Net 3.5 application. The SortedList seems perfect for this purpose. If this were a Windows app I'd just create a class and setup one method to Set values within the SortedList and another one to Get values out of it.

But being a web app, I'm not entirely sure of the best approach to use. Sure, I could just create one method for Set and another for Get but that doesn't seem very "clean".I thought about creating a UserControl without any visual elements but am not sure if that makes sense.How would you go about implementing such a SortedList in your web app?

Posted: May 08, 2010 01:24 AM

View 7 Replies!   View Related
Reusable Code / Want To Call On Multiple Pages?
I have a procedure that I want to call on multiple pages, what is the best way to do this? I only want the code block to be in one place for easy management and updating.In old ASP you'd use an include file, what do I use in Asp.Net.

Posted: Nov 28, 2009 09:29 PM

View 2 Replies!   View Related
Department Standards, Templates, And Reusable Stuff?
I have been tasked with setting up some kind of "system/repository" where a developer can go to see what the department's stardard is for a site's layout or a control's usage.For example, how a datagrid should look and behave or the colors and sizes for page headers, etc.I would like to model any system that is popular in the industry but have not yet been able to find any information on this subject.

Posted: Aug 04, 2009 08:21 PM

View 1 Replies!   View Related
VS 2008 - Reusable Control For CRUD Operations?
I want to build a reusable control which will enable e to perform add/edit/delete operations easily. All I want to do is give the control a datasource and it will handle the rest.

What controls should I use? I want it to be as user friendly as possible.

Posted: Jan 20th, 2011, 01:55 AM

View 15 Replies!   View Related
Programming Model For Prototyping Then Reusable For Production
In .NET land what would be a good approach for quick prototyping of a concept (i.e. development just on my PC) that could then be extended out to product (users across LAN/WAN), BUT in a fashion that the model/business logic code and data access layer code can be used as is? One thought for example I had as to do:
(a) WinForms with business logic and Entity Framework layer to SQL Server Express on my PC, then
(b) Go then to ASP.net (using the business logic / data library) with SQL Server/IIS

Posted: May 15 10 at 12:03

View 2 Replies!   View Related
MVC - To Achieve Reusable User Controls And Maintain DRY?
When creating user controls in ASP.NET MVC, what is the best way to structure the code so that the controllers that invoke views that use the user controls do not all have to know so much about the controls? I would like to know a good way to maintain DRY while using user controls in ASP.NET MVC.

Please note, this question only pertain to user controls that require special handling and logic on a postback. I have no problem creating nice DRY code for user controls that are either view only (using RenderPartial) or that require some pre-processing to create the appropriate ViewModel (using RenderAction).

Also, this question pertains only to achieving reusable controls within an application. I am not worried about reusability between applications at this point.

To give a specific example, let's say I would like to create a 'Quick Add' user control which contains three entry fields, First Name, Last Name and Company Name and a submit button. When the QuickAdd functionality is used, the following steps should be performed independent of what page the control is on:

Validate that the fields were not empty, if they are, show an indicator.

Perform a lookup to a repository to see if the Company already exists, if not; create it.

Create a new contact associated to either the existing company or the newly created company
Re-render the existing page. If no validation errors, the user would see the exact same page again, otherwise the same page with validation errors.


My main problem with achieving DRY has to do with all the controllers that invoke views that contain the partial view end up having to have an Action Method to process the form submission from the Quick Add. Even if I break out the logic for processing the information into a separate controller and invoke that method from each of the other controllers it seems like a burden that each and every controller that invoke views that have reusable controls have to have that knowledge.

The other option I looked at was to have the reusable control always submit to a specific action method / controller but then there is no way for that controller to know how to re-populate the model appropriately for the specific controller that invoked the view that contained the reusable control (in step 4).

I am aware that there is talk of subcontrollers in MVC 2 (from this question http://stackoverflow.com/questions/1244911/asp-net-mvc-contained-user-controls) but since it is not there yet, what is the best way to structure the code to achieve maximum reusability while maintaining DRY?

Is there an alternative to having to have all the controllers that invoke views that use a reusable control (with the characteristics of the one described above), having to have an Action Method to process the information from the control?

Posted: Dec 31 09 at 0:36

View 3 Replies!   View Related
MVC :: Proper Pattern For List Of Reusable Controls?
Say you have a for loop which renders a bunch of the exact same control. This is probably done with RenderAction or RenderPartial.

What is a way to ensure that each of these controls in the list gets wrapped in a div with a unique ID?

Posted: Aug 26, 2010 12:06 PM

View 2 Replies!   View Related
Web Forms :: Creating Reusable GridView Template Fields?
The project I'm working on utilizes GridViews on quite a few ofit's pages. Some of thetemplate fields are identical - andit would be nice to define them in a single location for reuse inmultiple GridViews, on multiple pages. Ideally, the template fields would show up in the Edit Columns dialog in the Designer, but it is not a requirement.

Posted: Dec 05, 2009 12:50 PM

View 4 Replies!   View Related
C# - How To Create A Dll File - Showing An Error / "a Project With Output Type Of Class Library Cannot Be Started Directly"
Using Visual Studio 2005

I have list of class files, when i try to run the class files, it showing error as
"a project with output type of class library cannot be started directly"

How to run the class file? How to create a dll file.

Posted: May 23 10 at 9:45

View 5 Replies!   View Related
Making Reusable DropDownList Control With Default Blank Item?
I'm wondering how you'd go about doing this. I tried making a user (composite) control and added a default item that would always be there and always selected, but then when I went to use the control, I didn't understand how I could still databind.

Would a person have to implement properties in the user control for each of the normal databinding settings?

Posted: Jan 15th, 2008, 07:10 PM

View 6 Replies!   View Related
AJAX/Javascript PageMethod.FunctionName, Trying To Made Code Reusable
I have implemented AJAX for calling server side function using client side function call i.e Calling server side function using javascript tag by using PageMethod in javascript.

I have few question regarding the same implementation.

[code]....

This FunctionName will be the name of server side function that a developer want to call.

Posted: Jan 11 10 at 12:15

View 1 Replies!   View Related
Rewriting This Linq Query To Move It From Code-behind To DAL As Reusable Object?
I'm working to move my simple asp.net website to a three layer architecture. Currently I have Linq queries like the one below in my code-behind files. Basically this code snippet retrieves a collection of customer data from the database and then binds it to a grid control.

I'm wondering if someone can guide me on how to rewrite this in order to move it to my newly-created data access layer. I'm thinking I will turn it into a class (e.g. GetUserBoxesByStatus()) that can be reused throughout the site.

var boxes = from p in sbm.Packages
where p.UserID == CurrentUserId && p.StatusID > 1 && p.StatusID < 3
select new { p.PackageTag, p.PackageName, p.DateReceived, p.DateShipped }; [code]....

Some of the options that I've investigated but have not had success implementing are the following:

DataTable --- returning a DataTable seems like the best solution but it also appears to require a lot of potentially unecessarry code to define a table (isn't the data source already mapped in my Linq 2 Entities dbml?)

IEneuerable --- I think I could pass an IEnumerable list between the layers but after reading many tutorials about Linq I'm still a little lost DTO --- Conceptually I think I understand what a DTO is but I am not clear on how to begin implementing this approach POCO --- Again, the concept seems logical enough but I don't know how to put this into practice

how they would tackle this using one of the above or some other solution.

Posted: 2 days ago

View 1 Replies!   View Related
MVC :: Achieve A Reusable Area In Multiple Views (navigation Menu)?
I want to build my navigation so I can use it on multiple views. How do I do this? Nested views?Whats the best practice and show me a quick example?

Posted: Sep 16, 2010 06:50 PM

View 1 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved