.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Multiple websites- usings same code but different markup.

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net
 

I have atleast 10 websites that have different css,html,javasacripts and webconfig. But the same code behind files.

With this design everything is hard to maintain. So I decided to work on it and I started moving all the queries in the code beghind file to stored procedures. Since every website uses the same database.

Now I am stuck, I dont know where to go from here. Should I create a dedicated server and throw everything in a global access cache? or should I create a dll for every code behind file?

Going in the future this would be used as a profile based system. Where a client, would just go and choose a template and it will work. How would I go about desiging this ? I cant use wordpress or any otehr thing has to be done froms scratch. If you can  just point me to the right direction that would be awesome



Since I just started working in the industry 4 months ago. This is a very big project for me and I am very confused as to what steps I should take. Any help would be greatly appreciated. Thank you in advance.


P.S. My boss wants a dedicated server




View Complete Post


More Related Resource Links

Multiple websites- same code behind but different html and css- making templates

  

I have atleast 10 websites that have different css,html,javasacripts and webconfig. But the same code behind files.With this design everything is hard to maintain. So I decided to work on it and I started moving all the queries in the code beghind file to stored procedures. Since every website uses the same database.

What I have decided is to make use of themes and multiple master pages? IS this the best way to go about it?

Also lets say I have two templates. There is site A and site B. both using different templates. And have pages Home About Us and Contact.

 

Now would I be creating three different masterpages? for each template so 6 in total? ( since none of the templates are supposed to look the same)

or Should I just create two masterpages? if so how would I manage the html of the page so it looks different? Thank you


Toolbox: Live Chat, Code Conversion, Multiple Monitors, and More

  

This month, more of the tools you need to get your job done.

Scott Mitchell

MSDN Magazine December 2007


Code Name Avalon: Create Real Apps Using New Code and Markup Model

  

The presentation subsystem in the next version of Windows, code-named "Longhorn," offers powerful new capabilities to developers. This subsystem, code-named "Avalon," allows developers to take advantage of its capabilities through a new markup language code-named "XAML." In addition, modern object-oriented programming languages such as C# and Visual Basic .NET can be used to tie everything together. Because most applications written to Avalon will probably be a mix of XAML and programming code, this article discusses XAML tags used to control page layout along with the procedural code written to respond to events.

Charles Petzold

MSDN Magazine January 2004


Running multiple websites in Sharepoint 2007 with AX2009 Enterprise Portal

  

I need to setup two separate webshops with public access and different layouts using AX2009 Enterprise Portal.

However I am uncertain how to implement two completely different layouts/designs because the Sharepoint Templates are located inside the 12 hive and not seperate for each website.

Can anybody give me some hints on how to do this - and if so, which requirements I have to meet (VSS 3.0 or MOSS Standard / Enterprise) in order to do it.

I am speculating whether I need to setup two separate web-servers with each own Sharepoint installation (and Business Connector Proxy)

Thanks in advance

bhlj


DataGrid ValidationRule or IDataErrorInfo validation code called multiple times for each data change

  
Following my enquiry regarding a problem in Datagrid validation, for which managing exceptions is apparently a problem, I tested the two other methods: using validation rules, or implementing the IDataErrorInfo interface. I ran into other problems there, more insidious this time. This has been done on Windows7 (32-bit), .NET 4.0.30319. 1) IDataErrorInfo When this interface is implemented, the this[string columnName] property is called four times for each modification: two times before the cell enters edit mode (with the old value in the corresponding property) two times when the new value has to be validated (with the new value) It strikes me as not really efficient, is there something wrong with my code? Here's the C# part: using System; using System.Windows; using System.Collections.ObjectModel; using System.ComponentModel; namespace DataGridTest2 { public partial class MainWindow : Window { ObservableCollection<User> users; public MainWindow() { InitializeComponent(); users = new ObservableCollection<User>() { new User { Name = "Teddy", Age = "2" }, new User { Name = "Avi", Age = "19" } }; datagrid.ItemsSource = users; datagrid.Focus(); } } public class User : INotifyPropertyChanged, IDataErrorInfo { string name; public string Name

Sharepoint: In Calculated Column, Code with multiple "IF" condition does not work.

  
Implemantation:  Calculate expected resolve date exclude "Saturday" and "Sunday"  based on Priority and Severity.Columns are:1. Priority:2. Severity:3. Raised on: Date record createdCode: Below is the code which contains multiple "If" conditions. For quick undersatnding, i separated major If condition. Below code does not work and sharepoint gives me Sytax error message. =IF(OR(Priority="Critical",Severity="Critical"),IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+3,[Raised on]+1),     IF(OR(Priority="HIGH",Severity="HIGH"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+4, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+4,[Raised on]+2)) ,   IF(OR(Priority="MEDIUM",Severity="MEDIUM"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+3),"dddd")="Saturday",[Raised on]+5,[Raised on]+3)) ) ,   IF(OR(Priority="LOW",Severity="LOW"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+6, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+6, IF(TEXT

multiple services to same code destination

  
I've been using WCF for years and have been in the 90 of the 90-10 rule.  Now I need to start using WCF in ways that don't fit neatly.  I find it exciting, actually.  But it's a lot harder to find the information I need.  So I'm turning to this forum.  I have two fundamental questions: 1. In the config file under the "service" tag, is the "name" attribute like the "codebehind" value in an asp.net page?  i.e., does this always map to the code that is called? 2. Is it possible to specify two difference services with two different endpoints go to the same code location?  If so, how would that code be able to determine which service was called?  I know I could implement two different code destinations that call on the same reused code elsewhere but I may not have that option given the state of our legacy code.

Multiple Images upload to SQL Database C# code help pls !

  

Hi,

I have a web form where user can upload image and store to SQL database. (SQL tables has a relation like one title has multiple images fields).

Title: <asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox>

Image Name:<asp:TextBox ID="txtImage" runat="server" Width="200px"></asp:TextBox>

<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="btnSubmit" runat="server" Text="Submit Information" 
               onclick="btnSubmit_Click" />


aspx.cs code:

 protected void btnSubmit_Click(object sender, EventArgs e)
    {
//to store image into sql database.
         string strImageName = txtImage.Text.ToString();      
           


                    if (FileUpload1.PostedFile != null &&
                    FileUpload1.PostedFile.FileName != "")
                      {
                           byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength];
             

PasswordRecovery control and multiple websites

  

Can anyone point me to a reference, or sample code, on how to use the passwordrecovery control with multiple websites?

I'm working on a web application which 'contains' two related websites.  Each website has its own set of users.  Currently the password recovery logic works for only one website.  If a user tries to retrieve their password for the other website they receive a message indicating unable to retrieve their password.

Thanks!!


LINQ to SQL Classes (dbml file) across multiple websites issue

  

Hello

I have a single LINQ to SQL Classes (dbml file) compiled in a Class Library that's referenced by 3 websites. Inside that Class Library there's also a class that's using the DBML to manipulate data.

At one point it needs to save in a user table the user info (firstname, lastname, email). SOMEHOW (!?) two of the 3 webapps saves email instead of firstname and viceversa while the other 1 saves them correctly ! The one compiled last seems to be the one saving correctly.

There's no code error as I have debugged this multiple times. The values are assigned correctly but before the SubmitChanges() call the data inside the database object is corrupted.

Now, I have already fixed this locally by putting every website in a separate AppPool (which also needs to be set to "Classic" and not "Integrated". However I really don't want to bug the client with such IIS changes so I'm looking for another workaround !

Please Help!

Regards

Mihai



code SQL to populate gridview with multiple random list box selections, How to

  

I could use some help in coding a query.

I have a list box that allows for multiple selections (holding down the control key) the selection quantity is basically unlimited, but realistically should never be more than 50 to 100 items from the listing of about 3000 items.

I need to collect the list of selected items from the drop down list and retrieve each of their full records from the item master and populate a gridview.

Any help would be greatly appreciated.

 

Thanks again,

 

 


How to close individually the multiple open browser window using c# code?

  

Hello guys,


The scenario is I have multiple open browser window (IE or Firefox) then I want to close the specific browser individually.

I have tried to lookup the applications running from the task manager but I can't get the running application from the task manager > application > task.

I have added two references below to lookup the task running applications.

using System.Diagnostics;
using System.Threading;

Anyone can help me on how to close individually the specific open browser window using c# code event.


Thanks.


Multiple websites but use same core files?

  

Not sure how to go about this so asking for help.

I basically have a working website and I now have another website to build which is basically the same

ie all code and pages are the same, just links to a different database and different css.

There will also be a few code changes on the new site.

Now is there a way for me to have both sites in one???

So if I make a major change it is changed on both but allow certain pages to have differences on the two files???

Any ideas / tips / helpers???


When binding value to ImageUrl property of Image using XPath it shows code as html markup on fronten

  

I have a listview in which I want to show an image from an xmldatasource control.

The following works, and shows the value of thumb (in this case: 12_634232073402187500_whatever.jpg)

<asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" runat="server">
    <ItemTemplate>                        
            <%# XPath("thumb")%>
    </ItemTemplate>
</asp:ListView>
<asp:XmlDataSource EnableCaching="false" XPath="root/data/compare/locations/location" ID="XMLDSCompare" runat="server"></asp:XmlDataSource>

No problem there, BUT, when I use an imagecontrol:

<asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" runat="server">
    <ItemTemplate>                        
            <asp:Image ID="img" Visible='<%# XPath("thumb

code SQL to retrieve records from multiple random selection list box

  

Having problems coding a query.

Got a list box that allows for multiple selections (holding down the control key) the selection quantity is basically unlimited, but should never be more than 50 to 100 items from the listing of about 3000 items.

How can I code the SQL statement to select the choosen record data? I think I have the selection list worked out by populating an array but I am not clear on how to build the SQL query.

Any help would be appreciated.

 

Thanks again


SQL code to populate gridview with multiple random list box selections

  

I could use some help in coding a query.

I have a list box that allows for multiple selections (holding down the control key) the selection quantity is basically unlimited, but realistically should never be more than 50 to 100 items from the listing of about 3000 items.

I could really use some help building the SQL statement to select the choosen record data. I think I have the selection list worked out by populating an array but I am not clear on how to build the SQL query.

Any help would be greatly appreciated.

 

Thanks again


Multiple Sites with single databse,single code base

  

Hi Friends,

I need your great help in developing a new Asp.net project.

I have 3 websites Site1,Site2,Site3 running on their own Code base's &amp; Databse's.

All are Job portals having 3 roles i.e Admin,Employer,Job seeker.

Now my requirement is to have a Single code base,Single Databse for all the sites.

Means all the content and state specific date should come dynamically according to the URL requested.

What is the best way to achive this and if I maintain same database then how to change the existing schema .

If I have Single database will the performance goes down.

Please suggest me the best approach .

Thanks in advance.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend