I have a table which houses two entities. StaticProgram and DynamicProgram. There is one column in that table called ProgramType which determines if a program is of Type static or Dynamic. Though these two entities are stored in one table (I am guessing because the primitive fields for Static and Dynamic programs are exactly the same) but from a business point of view these are two VERY different entities.
So, I created two Classes StaticProgram and DynamicProgram. However, I donot want to create two seperate Data Access Classes because it is going to be the exact same code replicated twice. I tried creating a "Program" class as base class and inherited StaticProgram and DynamicProgram classes but down casting is not supported so I can't return a "Program" object from the data access class and cast it to "StaticProgram" class.So, what are my options? Can I create an IProgram interface and have StaticProgram and DynamicProgram implement that interface and have my Data Access class return IProgram?
Got a little dilemma I could use some guidance on. I'm trying to call an Interface method that resides in my Business Layer from within the template of a gridview in the same manner as below:
I have a base page called let's say Login.aspx with Login.aspx.cs code behind.Now...I would like to derive page from that page for several specyfic customers. Basically nothing changes in layout (aspx file), the only think is difference in handling Page_Load event. However when I access my derived login page LoginClientName.aspx no output is rendered - my aspx file contains only:
for reasons beyond the scope of this discussion (say xcopy an aspx page to a directory, so that we dont have to get a new build out) , we would like to implement an interface in an aspx page.Say, if the page is myPage.aspx, it is usually your class in the codebehind mypage.aspx.cs which implements the interface. When I do something like this
Parser Error Message: 'ICustomInterface' is not allowed here because it does not extend class 'System.Web.UI.Page'.
How ever, when not specifying an Inherits attribute the page does not throw an error. So by default, when we do not specify an Inherits attribute, the page inherits from System.web.UI.Page ?
We are using VS2008 web application project and are not precompiling the aspx pages. We would like to intercept the request to this page in the HTTPModule (begin request) and if the request is to a page of type ICustomInterface we would like to process it differently.
I load css and js files dynamicaly based on which controls are used on particular page. I am doing it by using following code:
[code]....
where AddLinks method adds HtmlLink controls to Page.Header with href attribute set to coresponding css and/or js file.
I would like to add Interface that would force new controls to have AddLinks method but it is impossible since it is a static method. Because my custom controls inherit from Control class I cannot use abstract class and/or virtual methods either. How can I achieve my goal?
I need to setup a file handler to route with multiple sub directories something like tihs;
http://localhost/images/7/99/786936215595.jpg
I tried putting this in the global.asax file;
routes.Add( "ImageRoute", new Route("covers/{filepath}/{filename}", new ImageRouteHandler()));
I am using the ImageHandler found in this Question, which works great if you have a single sub-directory (ie '/images/15/786936215595.jpg') but fails when you have multiple directories.
I tried setting up a wildcard and that didnt work (ie 'new Route("covers/{filepath}/*/{filename}"')
This is serving images from a large NAS (think something like 3 million images) so its not like I can just move files around.
I wrote a test page that does a bunch of busy work in a method called at page load. This process as I have it now takes around 12 seconds.
If I try to load another page while the first long running page is loading, this second page doing nothing except writing out a world, it doesn't load until the first long running page is finished.
Why is this the case? I would think IIS would be able to handle multiple concurrent connections, it seems crazy that one long running page would stop every other page in the application from loading. I must be missing something or not understand how IIS works.
I would think multiple independent requests would be spawned on different threads. Is this only the case if the requests are from different sessions entirely? Are all requests from a single session bound to a single thread?
How do i get the pretty URL with an ASPX pages. I have listed a couple links below and their associated print page url. As you can see it resembles the Class instantiation method of declaring object but is used for a webpage with its extension.
I was wondering if this method can be used or if this is a URL rewrite to mask all the querystrings and sub directories being referenced. I remember doing stuff like this when i was working on a UNIX system using the .htaccess file to mask effective query string being shown. I believe they called it a Clean URL, i maybe wrong as it has been well over 8 years since i dealt with the Unix .htaccess file and massaging urls with it.
and the print URL:http://msdn.microsoft.com/en-us/library/system.servicemodel.actionnotsupportedexception(VS.100,printer).aspx
As you can see they are not visually passing query strings but more like Class parameters. Is this just a simple URL rewrite after the page is loaded so the user doesnt see the query string information?
i have a method/function that is used to send email, and this method is used in many aspx pages. how do i implement reusability by defining the method once and use in an web app.
I am trying to add aspx pages to my website which already has Asp Pages. I made a virtual directory and pointed to existing website where I have placed new Aspx files along with previous Asp files. Now when I try to execute the file. It runs good in first attempt, however, when I click a couple of times of "click me" button browser keeps on processing and does displays my message again.
Code in Default.aspx.vb Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click Label1.Text = "Heello how are you?" Code in Default.aspx <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebApplication1._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> </div> <asp:Label ID="Label1" runat="server" Text=""></asp:Label> <br /><br /> <asp:Button ID="Button1" runat="server" Text="Click Me" /> </form> </body> </html>
I initially ran this code in Visual Studio 2008 and it executed well. Later on i transferred my files along with existing Asp Page? Version configured in IIS for ASp.Net is 2.0.50727 Visual Studio 2008 To clarify further, I would like to know, if I am proceeding in right direction to excute my Aspx pages along with Asp? Secondly, why does my browser keeps on processing if I click the button second or third time ? I am not getting exceptions or errors.. And have no idea of reading logs for the program..
I need to create aspx pages on the fly or at the runtime.I read that creating a template page and posting content to the page would be a solution, in a few posts in the forum. Can i get information on this method.
I've got a pretty simple problem but I am not sure what is the best way to accomplish this. I've got an input aspx where a user fills in about 15-20 input fields and I want to display this information on the next page however; I am not really sure what is the best way to go about doing this?
I tried using 'Server.Transfer' and 'FindControl' API calls but have struggled to use them because the value is always null because it cannot find the asp:textbox ID I have specified from the previous page.
What would be the best way to just simply transfer the values from my previous page to the next page??
[URL] (goes to the it's local default.aspx page, not default.aspx of at the root) [URL](goes to the it's local default.aspx page, not default.aspx of at the root) [URL] (goes to the root's default.aspx page) I hope i could tell my question understandable.
I need to display c#, vb.net or any source code on a web page. The source code that will be displayed should indented, colored as we see in any IDE. I am not sure how would i achieve this. Is there any in-built control available in asp.net that i can use to display the code or can someone tell me how can i achieve this.