C# Shows Multiple Non Nested Masterpages In One Project?
Oct 2, 2010
i have an asp.net site built using visual studio 2010 in c#. the site is basically two sections...(http://www.wsgelectronics.com for reference) the default page is the site.master page with default.aspx. I want to split into two more master pages, one for each section, car audio and computer sections if you look at the site, each with its own layout, nav bar, content etc. how would i go about linking them to work? can i have three *.master pages on one project?
I am currently using nested masterpages in my latest asp.net 4.0 project and i want to change the look and feel dynamically, so the homepage may just be 1 column wide, about us page may be 2 columns etc.I am dynamically loading the masterpage dependant on the record selected in the DB (1column.master, 2column.master) on the pre_init event of a static page (Load.aspx) which work succesfully however i need to be able to dynamically add controls to the page in order to get the desired layout
I'm currently in the process of creating a webshop. This webshop supports theming, but I also want customers to choose a lay-out. I can create multiple masterpages and create a handler to dynamically set the correct master page. But some components, like the shopping cart, are controls which have to be present in the master page and are also used in the aspx pages. The shopping cart control for instance, has an Update method which is called whenever the user adds a product to their cart. So the question is: can I somehow create a default masterpage which has all the components on it, but still be able to create multiple lay-outs. And how should I reference that master page from the aspx pages? I also thought of creating an Interface class which defines the masterpage and it's public components, but I don't know if I can reference an interface from aspx pages.
I have web page with multiple update panels on it, each update panel has a detail view which is bound to different data sources, since the data loading takes time so i want that when data from any source is available the update panel shows it, while the other update panel shows a progress panel till data loading is done.
I have set all the update panel to 'Contional Mode' updating and a trigger is set to them against a buttons click event. on button click i load data from Db. hoever, when i click the button all update panel start the progree bar and they load data syncronously, but i want the above secario.
I am getting a NullReferenceException when the following code is executed. I have also noticed that the nested table appeared on a new page when I added in the code that wrote cells to the main table. It doesn't occur if I take out the two loops that write cells to the main table.
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" %> <%@ Import Namespace="iTextSharp.text" %> <%@ Import Namespace="iTextSharp.text.pdf" %> <%@ Import Namespace="System.IO" %> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { Document doc = new Document(PageSize.LETTER); // Here is some stuff needed to put the pdf into the users response stream
I've got this page where I display a 3 level nested gridview. First gridview displays data, 2nd one displays data based on the 1st one's row and 3rd one displays data based on the 2nd gridview. All of this works perfectly, including the edit mode for the 3rd gridview.
The issue comes when I make each gridview collapsible, again, it works fine but when I click on "Edit" on the 3rd gridview all the grids collapse, I can then re-open them and the "edit mode" is still present and I can still save my updated data. But that collapsing thing is quite annoying. I based a lot of my code from this page: [URL] And I understand how I can fix my issue on a 2 level nested gridview, by simply adding the C# code:
[Code]....
This makes allows me to save the index and prevent it from collapsing when I'm editing. Unfortunately, because I'm actually editing the 3rd gridview, if I code:
[Code]....
That simply doesn't work because I get the error "GridView2 does not exist in the current context". I also tried adding it to the .designer.cs page, but that doesn't change anything and still doesn't work. I'm not at work atm, and hence cannot paste the entire code, however, would anyone still have any idea as to how I can fix that issue?
my page based on master and Details. there are two gridview one is header and other detail.detail gridview is inner gridview.so when i click on + symbol then details should diplay.i use dataKeys for display Inner gridview record.when i use one datakeys then it is working fine but i need two condtion for show Inner Gridview. how can use multiple datakeys here?my HTML code is below. just modify it for multiple Datakeys
I'm trying to design a page that displays all suppliers by their location. I'd quite like this to work from a query that will automatically include new locations added in the future.
At the moment my design has a table that holds 'locations' with locationID and locationName fields. In my 'suppliers' table I also have a locationID to join them.
I'm not sure how to query the database to return all the suppliers in location 1, then all in location 2. (Or even sure of the terms I need to Google to get some examples!) For example:
I have 3 nested repeaters and in my code behind I can't seem to lock onto the second level repeater. I have written code for the third level but I will once I figure out how to get to the second level. My code is written below.
I have been creating my BLL and DAL with in the same project as my UI. These have been logical tiers in their own folder with in the same project, that's with in the same solution. I want to try to create a solution that is more like a truly multi tiered app.
I've heard people talk about using a separate projects for their DAL and BLL. My understanding is that these would be separate dlls that would contain the appropriate code for each of the these tiers. I have a few questions regarding this.
Is this a good way to do this? It seems like a logical approach. It also seems like the next step in me moving towards an architecture that's truly tiered. Should I do this differently?
Should the projects for the BLL and the DAL use the same namespace? I think I read that some people use a namespace for each of these that indicates what they are, such as BLL and DAL.
is it possible to create a Setup project within Visual Studio that will allow the generated installer to allow for the user to install the application multiple times? I would imagine there would be changes needed for checking if the destination folder already has an installation there but what about removing the "already exist" detection or how to change the Add/Remove Programs to show nothing at all or each individual instance of the installation.
I'm currently working on an C#/ASP.NET project that will host several differents e-commerce websites, all running in the same application.I use LinqToSql (moving to PLINQO soon) to access my database. The database contains both informations on the website structure (pages, ...) and the products/orders/users data.
My question is, should I use only one database for all the websites, or sould I create a new database (same model) for every new website?I'm now using a single database (with SiteIDs in some tables) but I have a big security concern, I can't just backup/restore the database for ONE website if something goes wrong (e.g. somebody erase all the products on ONE website) and it's an important requirment of the application.
So I was wondering what are the good practices in that case? Is there big cons if splitting dbs?(I would have to make changes to several database instead of one in case of structural changes, but i guess i can make a db version/update system).How the existing CRMs are dealing with that?Is it a performance problem if a database server host a lot of different DataBases? A complex backup/restore tool would be better?
Subquestion:To make a website replication easy, I can also split the pure CMS data (Pages, Texts, ...) in one DB and the e-commerce data (products/categories/orders in another). It can be achieved by some select/insert functions but it would be easier by just copying a database of course.
I'm having trouble moving a website from one server to another. It seems to be a problem loading multiple versions of System.Web.Extensions. The code uses version 3.5 in most places but a third party control appears to be needing version 1.0.6. I didn't think this was possible but it appears to be working in it's current situation.
Is there a way I can use the GAC version of System.Web.Extensions for the site but import a dll of version 1.0.6 just for these controls?
I have existing web application project in which i need to add new subdirectory. In this subdirectory i need to add WCF service.Question is: Can i use different AppDomain then services from root directory? Also, can i add new global.asax just for this subdirectory?
I am making project on hospital management which will contain different databases for different hospitals. how can i manage this thing with single asp.net project?
My website uses a single project solution. Each web page file consists of C# code along with the markup. I now have to separate the code from each page into code-behind files that must be combined with many different versions of the markup. I assume this means that I will need a solution with a common project of code-behind files that is merged with a project of each version of the markup files in order to create different websites. I need to know how to organize the solution for debugging and building each website and where to place each file.
I need to know the best way to do the following. I have nested business level APIs (say level 1 & level 2). L1 needs to call L2. Both APIs use the database layer directly at their own nesting levels.
Now, in the database layer, I fetch the db connection from the pool each time as follows:
SqlConnection conn = new SqlConnection(connString); conn.Open();
Is it proper to fetch the db connection each time on every DB level call as above? I know it will return a connection from the ASP.NET connection pool. However, wouldn't it be better to maintain the same DB connection throughout the nested calls (or throughout the current http request lifetime)? Will fetching a connection from the pool each time cause issues with nested TransactionScopes?