I am trying to freeze my gridview header for last 2 days and got this link and many other links too provided to me on Stackoverflow as well as from googling. This worked fine when i used it on IE 6,7 and under compatibility mode in IE8 but in normal mode, this code is not working.
This line is giving me an error. I want to implement this functionality.
I have a table with 4 columns: ID, signId, storeNum, quantity with ID, SignId, and storeNum as composite primary keyif storeNum is -1, that means the quantity is the default quantity. If a store has a store-specific quantity, the storeNum is this store's number.
I need to show all rows that have specific quantity for a store, and all rows that have default quantity and of which the store does not have store-specific quantity
currently I use table-value function with storeNum as parameter to return the list. first, I get all rows that have specific quantity for a store; then, I use cursor to loop through all rows that have default quantity and check each row if the store has a specific quantity. It takes 9 seconds to run the function for a store.
The function is called within a stored procedure, which in turn is called by a function in a class, which in turn is called by a aspx code behind file. It takes about 20 seconds to load the page. 20 seconds to load a page is too long. I am trying to improve the performance.
I wonder if there is an alternative method to the cursor to get the second part of the list.
i have just found that i cant create postback triggers on the fly (i had a function that runs onclick that creates buttons and postback triggers)
so i need an alternative or a method to achieve this
what happens is onclick of a button, updatepanel1 is updateded and depending on what button you click in panel1 more buttons are added, these buttons that are added also have an oncllick event that should update a wysiwyg in panel2 with content
heres my code below, if anyone has any ideas or knows of other methods to get this to work it would be great
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 just moved to a new PC and installed VS 2010. I copied all of my websites over from the old machine and now when I open the old websites on the new machine, they do not show up in my recent projects list on the start page. New websites that I make do show up there but the old ones do not. This is very inconvenient. Is there a way to make old projects that I open show up in the list?
This brings up another question. Is there a way to make a shortcut that will open VS2010 up with a website already loaded so that I don't have to go through the file open dialog every time?
I've seen some teams that start breaking into multiple projects from the beginning and others build behemoth single projects. The large project teams say that one massive project is easier to maintain than multiple smaller projects.
I need to create a sample project (for educational purposes) and I'm faced with the choice between Web Site Projects or Web Application Projects. This feels similar to the choice between C# and VB. My question isn't about the differences between these 2 choices, but rather which is more popular (relevant, recognizable) to the general ASP.NET community.Has anyone seen any statistics in terms of adoption/usage of these 2 different project types? What project type should I use to reach the widest audience?Update: I created a poll on this subject - http://poll.fm/2e6cy
I have a multi-tiered application. I would like to publish the class libraries to UI developers to let them add to their web or windows projects to add all the functionality.
I would like to restrict access so only a certain project can be referenced. The reason is so that they do not refer to the data access layer directly and start making calls that would bypass the business logic built into the business tier.
UI->>Business Logic->>Data Access
So in other words, BL and DA are deployed as compiled assemblies. BL references DA. UI will reference BL, but I would like to strictly prevent any other project from referencing DA directly.
Normally, I use App_Offline.htm for taking the site offline. But occasionally, when I do that, the site just hangs (like in: browsers wait forever, server gives no response at all). This seems to happen on an updateable site when I change something, like a control and afterward, when it doesn't go quick enough (site hangs), I place App_Offline.htm in the root of the website.
In most cases, this immediately takes down my site. But occasionally it doesn't. In those cases, I cannot just stop the website (when I restart, the behavior continues). Stopping the application pool doesn't let me restart the same app pool. The only two solution so far is restarting the whole IIS web service.
I'd like to prevent this from happening. Is this a bug in IIS not "breaking all actions" when App_Offline.htm is found? I use IIS 7 with Windows 2008 SP2 64 bit.
I regularly (every few days or so) publish my ASP.NET web project to the local web server.
But the weirdest thing keeps happening... a file called "app_offline.htm" keeps appearing, unbidden, in my web project!
I have deleted this file several times, it is not in source control, and AFAIK nobody else is tampering with the project. But practically every time I try to publish the project, my publish fails (Unable to add 'app_offline.htm' to the Web site. The file 'app_offline.htm' already exists in this Web site.Error: The operation could not be completed. Unspecified error), I go back to look at the project, and there it is again, large as life, and I suspect if it could it would be blowing raspberries at me.
Having read up a little about this file, I gather it's meant to be an easy way to take your app offline. But I didn't see anywhere that it's supposed to impose itself on you arbitrarily for no good reason.
When I publish my ASP.NET MVC application it generates a app_offline.htm file to take the site offline while it updates the website and then deletes the file once the publish is successful.
This is cool and I really like the idea, but I want to create my own custom app_offline.htm file that the publish action is aware of and put it somewhere where it doesn't effect my development site - i.e. it doesn't sit in the root of my development site rendering it offline all the time.
EDIT: From the comments on Scott Gu's post about app_offline.htm, it seems that customization of the app_offline.htm file wasn't possible with VS 2005 - has this changed with VS 2008 and now VS 2010?
I have a web app that has an app_offline.htm file, this file is stored in source control along with everything else.
The problem I have is that each time I (or any other developer) do a get latest on the source I get the app_offline.htm file and then when I try to run the app all I see is the app_offline rather than the actual web site.
I have created an app_offline.htm file for an ASP.NET MVC2 application running on IIS7 / Win2008 64-bit, and ensured that it's over 512 bytes (it's 2KB right now). On my dev box running Visual Studio 2010, it works like a charm, but when I put it on the production box, all I get is the generic HTTP 500 error saying "The page cannot be displayed because an internal server error has occurred."
What's especially strange is that I don't get anything logged in the application event log, nor does ELMAH pick anything up. I've disabled custom errors, put FormsAuthentication location exceptions for the file, ensured I'm not referencing any other files (images, etc.), but nothing fixes it.
In quite some scenario's, placing app_offline.htm in the root is just right: you do some updates, the message appears while updating, and that's that. The idea is, as Microsoft puts it, that before anything is called, IIS first checks if app_offline.htm is there and if so, it cancels everything and displays it.
So for so good, but in many situations it doesn't work:
When you have a compile error in an ASPX page and a user links directly to it When you have conflicting assemblies When you have a parsing error in your web.config In the midst of removing / uploading the entire site.
A direct link to a static HTML page is still displayed as suchm File-not-founds, access-denieds are thrown before the message is shown Possibly more scenario's exist that fail. My point is: for any serious updating work, app_offline.htm is not suitable. I sometimes create a redirect in IIS, to another site, but another site may not always be available and it can confuse users.
Ideally, I'd want to keep the current location in the url location bar of the end-user, show the message, and have the page auto-refresh each minute to see whether the site is back, so that the user continues where he left of when the site comes back. While technically easy enough with a static page, it will fail for the above mentioned reasons the minute an error is thrown.
I have placed an app_Offline.htm in the root of my IIS7 application. This works for calls to pages on the root, but not for calls to pages in a subfolder of the application.
How comes? And how to make it work also for subfolders?
I get the message "This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory. "
However, this is no app_offline.htm file in the root directory. Where in the heck is it?
I am looking in the Solution Explorer, and I also looed in Windows Explorer . . . not a sign of it. ?
i am trying to delete app_offline.htm programmatically but the code doesnot even get called as the app_offline does not other pages load. how should i delete the file after the updations have been done in the website. i know that i can delete the file manually but i dont want to do that.
The app_offline.htm file that ASP.NET serves returns the http status 503. This is the correct behavior for most situations. However, in the scenario where a specific URL is requested (e.g. [URL]), I'd like to change the returned http status to 200, while still returning http status 503 in all other situations. Is this possible?
The reason why I want to do this is whenever we do scheduled maintenance on our website, we use the app_offline.htm file, but we don't want our uptime monitoring service [URL] to report downtime during our scheduled maintenance.
I assume this would have to be at the IIS level because the app_offline.htm gets served very early on in the request processing cycle.
have been using the Publish Web Site option VS 2005, and all of a sudden it quick working correctly and do not get an error message. Also, compiling the web site does not take as long as it did before. Now Pubish Web site only puts the bin folder and PrecompileApp.config file in the C:InetpubwwwrootOIAEmailMaint. Because I am working and testing this website sometimes I delete any previous files that was in the folder C:InetpubwwwrootOIAEmailMaint before Publish Web Site. I did notice when I was looking at the files I delete in the Recycle Bin that a app_offline.htm. Apparently I changed some kind of option by accident by I do not have a clue what.
After seeing the Hanselman "You are doing it wrong" video I start to use the Web Publish feature of VS2010.
What I'm really missing is that the websites sometimes gives errors while the site is publishing because the feature does not copy the app_offline.htm file to the server.
I do not want to start using MSDeploy scripts, because I have several sites and want to keep it simple.
Maybe there is a simple tweak to tell the wizard to copy and then delete the file.
I am creating an Asp.net web site which will support dynamic data. When I am creating a dynamic web site from Scratch (from template in VS) all is working fine. But when I am trying to add dynamic entity (.edmx) file and running the application I am getting following error
"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'. "