C# - Uncompiled User Controls Running In Compiled Web App?
Feb 23, 2011
Is it possible to compile my web forms app and deploy it, then drop some user controls in it later to add functionality? (assuming I had taken into account being able to load user controls dynamically in the first place)
View 3 Replies
Similar Messages:
May 7, 2010
We have an ASP.NET application that uses SQL statements, where table names are unqualified. When compiled, it works fine, but when uncompiled, it complains and errors out, saying these tables dont' exist. (Qualified name looks like Select * from MyDatabase.mySchema.MyTable; Unqualified like Select * from MyTable) If you try these queries on the database, by yourself, it will take only the qualified names. What's going on? I thought Compiled vs Uncompiled apps should perform the same way codewise.
View 2 Replies
Aug 7, 2010
can i determine programmatically if im running my web project in debug mode or compiled?
or even better if im running it on my local machine or on a server? example to change the path for databases etc..
View 7 Replies
Apr 23, 2010
I am having a very hard time in consuming a very simple web user control that I have built using a Web Application project in VS 2010. The user control works fine as long as the consuming aspx page is in the same project. But after deploying the project using Web Deployment Project into a single assembly I am not able to use it correctly from another aspx page which is in a stand-alone project. The error I see is a null reference exception. Here are the steps that I am following:
1 Create a web user control named WebUserControl_Label using a web application project. This control works fine when used in an webform in the same project.
This is the ASCX of my user control :
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl_Label.ascx.cs" Inherits="TestWebAppWithCustomControl.WebUserControl_Label" ClassName="TestWebAppWithCustomControl.Controls" %>
<asp:Label ID="Label1" runat="server" ></asp:Label>
This is the code behind:
namespace TestWebAppWithCustomControl
{
public partial class WebUserControl_Label : System.Web.UI.UserControl
{
private string _labelText;
public string LabelText
{
set
{
Label1.Text = value;
}
get
{
return Label1.Text;
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
2. Create a single assembly for the user control above using a Web Deployment project. The name of the assemby is TestWebAppWithCustomControl.
3. Create a webform in another web application project to use WebUserControl_Label user control. This project has TestWebAppWithCustomControl.dll added as a referemce.
This is how I am using the custom control above in an aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ConsumeTestWebAppUserControl._Default" %>
<%@ Register Assembly="TestWebAppWithCustomControl" Namespace="TestWebAppWithCustomControl" TagPrefix="GBS" %>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<GBS:WebUserControl_Label Id="label1" runat="server" LabelText="This is custom label" />
</div>
</form>
</body>
</html>
The problem is that .NET throws a Null Reference Exception when its trying to set the label text via the LabelText property. It looks like that the label control that lives inside the WebUserControl_Label user control is not getting instantiated and is always null.
I have found a few articles online that talk about creating such distributable user controls using ASP.NET website projects. But if possible I would like to stick with the web application project because of the benefits it brings.
View 1 Replies
Nov 24, 2010
I have a web service that uses ThreadPool to delegate a task to a thread but it runs on ASPNET (System.Environment.UserName) while the main thread runs as windows account. How can I make this thread run with same windows account. Note that I have impersonate=true in web.config. This is causing problems accessing database.
View 1 Replies
Aug 31, 2010
I've got an ASP 4.0 website running on IIS 7.0 . Part of the web site creates an Excel document using C#, due to company policy I'm stuck with Excel 2003. I've noticed that when I deploy the site and use the part that creates the Excel file, its running Excel application object with the login of the user accessing the site. This causes problems with access rights to the Server.
How do I set the server up to run the Excel application using a fixed account? I've got the Application pool running under one, and I thought that would solve the problem, but it doesn't seem to.
View 1 Replies
Aug 3, 2010
I have a web application that initializes a third-party com application to perform few calculations. The website is deployed on a windows 2008 server (standard edition).
The problem I have been facing is that when I am logged in to the server (Remote Desktop Connection only as the server is not local), the com application initializes fine. But when I log-off or just close the remote desktop connection, the application doesn't get initialized. I have searched for a solution and found this:
[URL]
I created the scheduled task as I didn't know how to create the windows service (the description at
http://support.microsoft.com/kb/251192 is too confusing), and got the application to run when windows starts before even the user logs-in. But in even in this case, the application doesn't work unless the user is logged in and when I log-in, a second instance is created (with exactly the same user (admin)) and the original instance is never used.
I cannot get the application to run without logging off or atleast having to close the remote desktop connection.Is there anything I am doing wrong?
View 1 Replies
Jan 28, 2010
Note:- i don't want to use updateprogress etc. control of ajax
on button click, long task(e.g thread) runs in my webpage for about 4-5 minutes.I want to show status to user either by a processing image through javascript(image must be shown in a certain part of page other part of page will remain intact) or an exact status of process if possible. i have tried a lot but all in vein.
View 5 Replies
Feb 1, 2010
Is there a way to run an SQL statement (or stored procedure) at the successful completion of a Create User process?I'd like a user to be able to create their login profile and upon completion automatically run a SQL statement to pre-populate some other tables.I'm using 3.5 and the have a create user wizard control on my page. I'm working in VB, and am a bit of a n00b with it.I'm thinking I need an onClick somewhere, but frankly I'm not sure how to go about writing it.
View 2 Replies
Jan 30, 2010
I've been having a difficult time with this. I have an asp.net page. The user hits the "Run" button and I have code IN AN ASSEMBLY, not in the APP_CODE folder that is called and runs a long process that moves product info from a file into the database. While the user waits, I would like them to see status updates like what product the import process in on and status info. I'm assuming I'd break off into another thread and use Ajax but I have no idea how to do this.
View 4 Replies
Apr 1, 2011
We have an ASP.NET / Silveright web application. The silverlight client displays user specific data in a graphical form - it requests the data from the server: Problem: Getting this data is expensive, due to the underlying database queries that the server has to perform - so the client has to wait... Optimisation Idea: We run the database queries at regular intervals on the server, writing the results to a 'userdata' table in a database 'close' to where the ASP.NET server runs. The process of running the queries and writing the data to the tables is performed by a 'data collection' service, which is separated from the ASP.NET server.
When the client requests data the server retrieves it from a 'userdata' table. This should be nice and quick - we probably have the 'userdata' tables on the same machine as the ASP.NET server. We also have the added benefit that the client sees data even if the underlying database is offline. Of course the data is not live - but all data is potentially old as soon as it reaches the client. So now my Problem: The 'data collection' service needs the user credentials in order to perform these database queries (because each user gets different results for the same query).
How can I store user credentials in a database, in an acceptable 'secure' way? Such that the 'data collection' can impersonate a user to perform the database queries. Our initial scenario is based upon using windows integrated login to the database.
View 1 Replies
Mar 24, 2011
heavy operation which takes long time to be completed in my asp.net application. I don't want to run the entire operation in one request which may result in a TimeOut error. Instead I want to invoke the operation in a separate thread and poll for the result every x seconds. How can I do this?If the operation gets completed I need to register a script in the ajax postback to hide the loading panel and show the content. However I'm not able to register new scripts and invoke it during ajax postbacks.
View 2 Replies
Jul 1, 2010
I am executing a long-running Oracle stored procedure from .NET. The procedure takes about three hours to run. Ideally, the user should be able to kick off the procedure, close the browser, and come back later to check the results.
The problem is that the connection to the Oracle procedure is lost after exactly an hour. As you would expect, the Oracle procedre runs to completion if it is executed from SQL Plus. Strangely enough, it will also run to completion if I run in debug mode on my local machine (I start two threads, one of which executes the procedure. I set a breakpoint on the second thread).
Here is my connection string:
data source= (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=serverx)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=TestSID)))
Some relevant sections from web.config:
<sessionState mode="InProc" cookieless="false" timeout="3000" stateNetworkTimeout="72000"/>
<httpRuntime executionTimeout="18000" maxRequestLength="2097151" />
Any thoughts as to why the connection is being lost in exactly an hour, and what I can do to maintain the connection until the procedure finishes?
View 1 Replies
Mar 17, 2011
We are using membership provider for LDAP authentication. It is working as it should.
But what all configuration settings I have to do so that
all the future requests to this application run under the security context of the Logged in user account not through the some default user set in IIS.
We need to have this working because all the permissions on the database are based on the logged in user.
We are using form authentication for LDAP authentication. And having impersonation = true in web.config.
View 1 Replies
Mar 28, 2011
Is it possible to run a web service as a particular user/service account in the same way a Windows service can?I have a service account used for connecting to the DB and want to run the webservice under this account as the users using the webservice won't have DB access.The way I see to do it is to include the Impersonate option in the Web.config file, but is there any better way to do this?
View 1 Replies
Dec 29, 2010
Running Windows Server 2008 R2 (IIS 7.5). This is happening at a client's site and works fine on our internal servers with the same OS configuration. We are using the following work-around for now:Modify the Advanced Settings of the Application Pool that the site uses, and change the Identity used by the Process Model from ApplicationPoolIdentity to NetworkService
View 1 Replies
May 4, 2010
Complete newbie with asp.net using 2008 express edition.I made a master page and one simple page, and used the ftp copy web site tool to load the pages to my web site.When I try to open the one page, I get the message has not been pre-compiled, and cannot be requestedI havedone some searching on the error message, and most places talk about missing things from the Bin directory. I don't have a bin directory on my local machine.
View 8 Replies
Oct 26, 2010
Why we say compiled code in ASP.NET using C# or VB.NET means high performance and in the other side the server controls make the website slower! so if we combine server controls + compiled code the result will be the same as other interpreted technologies, so where is the speed and performance in ASP.NET? From this point of viwe it seems to be the same as others technologies, right?
View 9 Replies
Nov 22, 2010
We deployed a UserControl to our testing server. Then made a change to the UserControl and re-deployed. I cannot get the change to take. We have cycled the ASP.NET server, deleted the file completely and re-copied, and also tried a suggestion to change the web.config in order to force all files to be re-compiled.
I definitely know that we are changing the correct file. At one point, I removed the UserControl file altogether and received the "File not found error" when trying to load the user control. The file IS the correct version on the testing server.
[ASP.NET 4.0, Windows Server 2003 SP2, IIS (I think 6?)]
View 4 Replies
Feb 28, 2010
My XSLT was compiled via xsltc, the performance is hugely improved. However, I am wondering how the compiled XSLT works on IIS? Will there any cached of the compiled XSLT instance on the IIS after 1st JIT'ing. As I am seeing my page slightly slow in response from server, but if the page after being called once, subsequent access to the page will faster. So I am suspecting all the transformation processes was not cached for long time on server side.
View 1 Replies
Jun 29, 2010
my asp.net site uses resource files for a referenced project with the user controls in it.
so i have one website project, and one dll project with usercontrols + the resource files.
The website references the dll project.
So far so good.
When i publish, the dll with the usercontrols gets compiled in a dll (what else) but the resource files also get compiled (a separate dll for every language)
Is there a way to edit the resource strings in the dll once deployed?
View 1 Replies
Aug 9, 2010
I'm using "VS 2010 Ultimate" "Web Application" project.
The problem is that web application compilation occurs at run-time.
My steps:
1) change Wep Application source code (*.cs files)
2) rebuild "Web Application" in Visual Studio
3) run web site's(mapped under IIS 7.5) start page via browser
4) Problem: CSC.EXE starts compiling wep application for the second time! Despite I've done it on step 2)
What should I do to escape step 4) ? I don't need re-compilation at run-time!
I've tried "to play" with <compilation batch="false" but it seems to be ignored.
View 6 Replies
May 24, 2010
I have read under: Compiling Web Application Projects [URL]
... this compilation model creates a single assembly, you can specify attributes, such as assembly name and version.
You can supply a PATH (directory name only) in the Visual Studio "Build Options".
But where can the file name for the assembly be specified?
View 1 Replies
Feb 17, 2011
There is a pattern in ASP.NET - whenever there is a piece of markup that generates code (like the .aspx/.ascx files in WebForms or .cshtml files in MVC3), these files are dynamically compiled at runtime. aspnet_compiler will produce another assembly for them, which references your code-behind assembly. This approach seems awkward to me and I don't understand why it hasn't been discontinued already. A much better approach (in my opinion) is like in Winforms or resource files - you have your .whatever file, and then there is .whatever.desginer.cs file. This designer file is created at runtime as you type. When you compile, the compiler doesn't care about your .whatever file, it just takes the .whatever.designer.cs file and produces a single solid assembly. This provides several benefits:
You can inherit your forms from each other, similar to windows forms;
You can always see the code that is being generated, possibly adjusting your markup to generate better code;
You can easily instantiate strongly typed instances of your forms;
The only benefit I can see from dynamic compilation is that You can change the markup file anytime and don't need to recompile the app.To be honest, I've often wanted for one of the first three benefits, but never for the last one. Recompiling the app to see your changes isn't that big of a deal. Especially since you have to do it anyway when working with code-behind, where the most of your time will be. And when you deliver your app to the client, you deliver it as a monolithic, precompiled block. When you update, you update everything, not just individual .aspx files - there's no point to. why is it like this? What am I missing?
View 2 Replies
Jan 28, 2011
We have a company product (asp.net website) that gets compiled and distributed to our clients. I need to figure out a way to allow us to add in an ad hoc aspx webpage into the website (so it recognizes the master page, the forms authentication, assemblies, etc) without having to provide them with an un-compiled version of the website product.Is this possible. Is there a better method than having a special compiled version of the website on their server.
View 1 Replies