Using Include Files Still The Best Practice?

Jun 14, 2010

Is the classic way of using include files still the best practice in ASP.NET. IS there a better way in ASP.NET to simulate include files? IF not can someone please provide an example of the .NET way?

View 5 Replies


Similar Messages:

Using An Include File Bad Coding Practice?

Mar 18, 2010

Is using an include file bad coding practice in asp.net? I am aware of master pages, etc. but it seems like in this case an old fashioned include file works best.I have a home page and I have an "all other" page. The all other page is my master page. I place the header include on the master page and at the top of the home page.

<!--#include file="inc/inc_header.aspx"-->

View 11 Replies

DataSource Controls :: Best Practice For Importing Files.xls Or Files.csv To Database?

Apr 16, 2010

I need to populate a database (SQL Server) with some data from a templated excel document.Here are some approaches:

A) User upload a file.xls or file.csv that the server reads, checks and updates the database (cons:the uploaded file might be too big. file.* needs to be in correct format)

B) User downloads a tool.exe to read and upload file.xls (cons: maintenance of the tool.exe)

C) Use of a web service in excel? (don't know how to do it) but
this article might give you a hint

Which one is the best to use? Are there any others?

View 4 Replies

Include Files Within Include File

May 20, 2013

I have just started with ASP.NET.

I like the idea of using Include files so that I can create various versions of individual parts of a site and decide in code which to display. I used:

<%Response.WriteFile("contentcontent.aspx")%>

to include a content.aspx file within my default.aspx page.

I would like to include a Left.aspx, Main.aspx and Right.aspx file inside the content.aspx file. I tried using the reponse.writefile function but noticed when I debug the website that the text "reponse.writefile..." displays instead of the code contained within the referenced file(s).

Can this not be done?

View 6 Replies

How To Include .css Files

Jul 22, 2010

Since virturl directory name is not fixed, I wrote code below to include .css file in .aspx page now.

<link rel="Stylesheet" href="<%= ResolveUrl("~/Css/xxx.css") %>" type="text/css" />

The question is, when I use "ResolveUrl" in tag, IDE is always barking about that all CSS classes is undefined.

Is there any better way to define .css file including?

View 3 Replies

2.0 -how To Include Files Containing Server-side Code

Oct 20, 2010

I want to be able to load a customized log in page depending on a couple of parameters passed into the querystring.Each customized login page needs to be able to dynamically display log in errors and possibly have other variables passed in.
Let's say the dynamic login page looks like this (over-simplification here):

<form>
<% if (has_errors) { Response.Write(error_msg); } %>
<input type="text" name="email">
</form>
If the aspx page loads the file like this:
Response.writefile("path/to/custom/page");

the code shows up in the output and doesn't get processed. I have tried other ways to load the file contents (something similar to classic ASP includes) but get the same results every time.I could have all the custom pages set up as user controls, but I need 100% control over the css, js, and html - and the documentation I read here indicates that I won't have that level of granularity.link textPLUS - I'm stuck in a .net 2.0 environment - so .NET MVC is not available to me

View 1 Replies

Refresh # Include Files - Caching On IIS7 / ASP?

Jul 28, 2010

I have an ASP.NET master page which references a #include file as follows:

<!--#include virtual="/includes/scripts.inc"-->

I have modified the file /includes/scripts.inc but the changes do not show up in pages. What needs to be done so modifications will be reflected? I need to avoid the following: restarting the server restarting IIS modifying web.config (doesn't appear to have any effect)
pretty much anything that causes the app domain to restart Any other options? Is there a setting which affects how long IIS caches #include files?

View 4 Replies

How To Automatically Include Content Files Into Project File

Mar 31, 2010

I'm frequently adding a lot of content files (mostly images and js) to my ASP.NET project. I'm using VS publish system, and on publish, new files are not published until I include them in the project. I would like to auto include all files in specified directory. Is there a way to specify wich directories should be auto-included in csproj file or anywhere else?

View 3 Replies

How To Get Visual Studio 'Publish' Functionality To Include Files From Post Build Event

Jun 29, 2010

I am currently attempting to use Visual Studio 2010 'Publish' and MSDeploy functionality to handle my web deployment needs but have run into a roadblock with regards to customizing the package depending on my build configuration.

I develop in a 32bit environment but need to create a release package for a 64bit environment, so in the 'Release' configuration I have a post build event that copies the 64bit version of a third-party dll into the bin directory overwriting the 32bit version. When I use the 'Publish' functionality, even though the correct 64bit dll is being copied to the bin directory, it doesn't get included in the package.

Is there a way to get the 'Publish' to include files that have been copied into the bin directory during a post build event?

View 2 Replies

C# - Caching, What Would Be A Best Practice

Aug 13, 2010

I have a table that stores songs and plays counter.
Here's the code:

//Increse plays counter
string ip = Request.UserHostAddress;
if (!string.IsNullOrEmpty(ip))
{
if (Cache["plays:" + trackID + ":" + ip] == null)
{
tracks.IncreasePlaysCounter(trackID);
Cache["plays:" + trackID + ":" + ip] = true;
}
}

I wonder what would be a better practice, store many cache items(like this) or store one item like a ArrayList that would contain the users who already heard that song. Is there any difference?

View 2 Replies

Where Can I Find The Tasks To Practice

Sep 16, 2010

I am a beginner of C# programming. I have read a few books about C#.net. But I cannot find some exercises in the books. Someone told me to build up a blog to practice my coding.

But it is a huge task for a beginner. I just want some tasks to have a step by step learning process.

View 3 Replies

Declaring Variables Without As, Bad Practice?

Oct 20, 2010

I just noticed that I can save a lot of spacing by not using "as" when declaring variables, in some cases (not sure if this is something new in VS2010). For example:

Dim Name as string = "Bob"

works the same as:

Dim Name = "Bob"

I prefer the latter as some of my type declarations can be very long due to the library I am working with, and omitting the types simplifies the lines and makes them more readable. I am wondering a few things:

1. Do the two methods function at all differently?

2. Is this a bad practice, or generally excepted?

3. Is there a name for this?

View 1 Replies

Best Practice When Using WebMethods And Session?

May 15, 2010

I want to reduce postback in one of my application page and use ajax instead. I used the WebMethod to do so.. I have a static WebMethod that needs to access the session variables and modify. and on the client side, i am calling this method using jQuery. I tried accessing the session as follows:

[WebMethod]
public static void TestWebMethod()
{

[code]...

The values are displayed correctly and seems to work.. but i would like to know if this practice is allowed as the method is a static methods and would like to know how it will behave if multiple people access the application.I would also like to know how developers do these kind of tasks in ASP if this is not the right method.

View 1 Replies

Security :: What The Best Practice For Next Scenario

Apr 27, 2010

1) All users can browse open web site content.

2) To access memebrs area users must login.

3) Users can create , edit/update, delete there profile/information only.

4) Users can see / view other users profiles.

5) Admin can browse, create, edit/update, delete an any profiles.

I found many different ways to implement it, but what the best practice. May be you can point me in right direction.

Application Web based, MsSQL 2005, .NET 3.5, Server 2003.

View 1 Replies

MVC 3 Add Column To Sql Table (best Practice)?

Feb 19, 2011

vs2010 (express)
.net 4.0
SQL 2008 (express)
MVC 3
C#
Entity Framework

I'm curious as to whether there is a well known way to add a column to a SQL table as a global change in MVC 3.

"Global change" referring to adding a column from database to UI... can someone please outline the fundamental steps.
(i.e., 1. add column in SQL table. 2. update .edmx (replace relative tables) 3. ...)

View 4 Replies

What Is The Best Practice Of Declaring The Variables

Oct 7, 2010

I just want to know the declaration of variables in a separate class file or declaring in the same aspx.cs file. the best practice of declaring the variables.

View 3 Replies

Good Practice When Retrieving SQL Data?

Jan 19, 2011

I'm currently using the fantastic DorkNozzle 'framework' for building a very basic blog in .NET.My first "self-taught" script is as follows, and is for solely retrieving SQL results.

PHP Code:

<%@ Page Language="C#" MasterPageFile="~/Dorknozzle.master" AutoEventWireup="true" Title="Blog" %>
<%@ Import Namespace = "System.Data.SqlClient" %>
<script runat="server">[code]....

I should change to perhaps improve my coding style, without going down the MVC line just yet?

View 17 Replies

Best Practice For Using JavaScript On Partials And Views In MVC?

Feb 25, 2010

I started removing part of a view into a partial so that it could be reused on another view. However, I got stuck because there are some JavaScript functions on the original view that call some of the functions that belong to the partial. It seems wrong to call functions that are defined on the partial from the containing view (and vice-versa). What is the best practice for this situation?

View 3 Replies

Multi-select Control (best Practice)?

Jul 22, 2010

I wrote a schedule app -- in asp.net 3.5 -- used where I work to do all the scheduling, and it actually turned out quiet nice. The issue is, you can only schedule one employee at the time.Each job is one row in a database and equals one employee.We have a lot of jobs that involve multiple employees, so it would be much easier to create one entry that schedules 3 employees for the same job.I've looked at a lot of multi-select dropdowns and combo boxes. Here is what I would like some advice on.

If multi-select selects employee numbers 2202, 2403, and 3610...how is the best way to get that into the database?I'm thinking 2202, 2403, and 3610 get put into an array, and use a loop to add each entry into the database. The database stays the same, and when this gets posted, there are three new entries in the database, one for each of the employees.Am I thinking right or can maybe someone that has done this offer some insight to something that would work better?

View 5 Replies

What's The Best Practice For Displaying The Contents Of A DataSet In MVC V1.0

Jul 12, 2010

I am long familiar with using the ASP.net GridView in ASP.net forms to display the contents of DataSet on a web page. What is the best practice for displaying the contents of the DataSet in ASP.net MVC? I can add the DataSet to my DataVew dictionary in my controller, but I'm unsure of how to display it in the View page.

View 2 Replies

What I S Best Practice For Accessing Settings From Config

Feb 28, 2010

I want to know what best practice is for accessing settings in config file when you have dev/test/production types.

If you have different config for each type when you publish a ASP.NET website doesn't the config get copied as well??

View 3 Replies

Databases :: Roles In .net / Oracle - What Is Best Practice For This

Apr 20, 2010

I'm using oracle for my asp.net website. In website I have 3 different roles. Now do I need to create as many diff users in oracle as roles?

Someone in team insisted on having as many users in oracle. But then unnecessarily i have to maintain multiple connection strings in app.

like, I have manager/ team leader/ user roles.

Now the team member insists on having 3 users in oracle. then in DAL i've to check role and use corresponding connection string.

This is not very big app, but in all 12-15 aspx pages and some 10 table in oracle to be used only on intranet.

what is best practice for this?

View 2 Replies

C# - Best Practice To Create A Generic User Id?

Jun 21, 2010

What s the best way to implement a method that creates and assings ID s to user on a asp.net application?

I was thinking about using DateTime ticks and thread id

I wanna make sure that there is no collision and user ids are unique.

ID can be a string or long.

should i use MD5 on some information that i collect from user? what would that be?

I have seen that md5 collision rate is very low.

View 3 Replies

Architecture :: Best Practice For Handling Exception?

Jun 3, 2010

I devide my website on 3 layers :

DAL(Data Access) - simple extract data from DB using LINQ
BLL(Business Logic) -

cache data and in try/catch block call function from DAL and throw it to UI :
try
{
}
catch (Exception ex)
{
//Log error
throw ex
}

UI (User Interface) - simple working without handling any exception,

So if error occured in BLL i will be redirected to Error.aspx page with message that something wrong.

how and where handle exceptions, or may be exists common patter where handle and how to inform user about errors ? Can anybody share bes practice.

View 1 Replies

DataSource Controls :: Best Practice For SQL Connection?

Mar 11, 2010

I was just wondering what would be the best practice for sql connection in asp.net, when using a loop

[Code]....

or...

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved