I'm getting this error message when trying to request my web application: Access to the path "c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files\root\6afc08f4\6af070d3" is denied. What could be the reason and how to solve that? Notice that I could not root\6afc08f4\6af070d3 folders in 'Temporary ASP.NET Files' folder. IIS is configured to point to the right directory and first page. Thanks for any help. Here is the stack trace: [UnauthorizedAccessException: Access to the path "c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files\root\6afc08f4\6af070d3" is denied.] System.IO.__Error.WinIOError(Int32 errorCode, String str) +393 System.IO.Directory.InternalCreateDirectory(String fullPath, String path) +632 System.IO.Directory.CreateDirectory(String path) +195 System.Web.Compilation.PreservedAssemblyEntry.DoFirstTimeInit(HttpContext context) +85 System.Web.Compilation.PreservedAssemblyEntry.EnsureFirstTimeInit(HttpContext context) +97 System.Web.Compilation.PreservedAssemblyEntry.GetPreservedAssemblyEntry(HttpContext context, String virtualPath, Boolean fApplicationFile) +29 System.Web.UI.TemplateParser.GetParserCacheItemFromPreservedCompilation() +91 System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound) +148 System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath() +125 System.Web.UI.TemplateParser.GetParserCacheItem() +88 System.Web.UI.ApplicationFileParser.GetCompiledApplicationType(String inputFile, HttpContext context, ApplicationFileParser& parser) +171 System.Web.HttpApplicationFactory.CompileApplication(HttpContext context) +43 System.Web.HttpApplicationFactory.Init(HttpContext context) +485 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +170 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +414
viktor9990
Posts
-
Acces is denied to folder in Temporary ASP.NET Files -
Sorting a collection within a datatableI'm trying to sort data (by startdate and descendant) in a collection object (CollectionActivities.Sort("StartDate", 0);) and print these data within a datable during run time. Everything is o.k. except the sorting order which is not working. Notice that the same collection(CollectionActivities) is sorting well when It is returned to the caller and bound to a datagrid. My solution require that I use the first way. Any help is highly appreciated. Here is my code: //Enumeration to define the sort orders protected enum enuSortOrder:int { soAscending = 0, soDescending = 1 } private void Page_Load(object sender, System.EventArgs e) { ListScopesWithActivities() } public void ListScopesWithActivities() { ListItemCollectionByScope CollectionScopes = new ListItemCollectionByScope(); ListItemCollectionByScope CollectionGoalDescriptions = new ListItemCollectionByScope(); ListItemCollectionByScope CollectionActivities = new ListItemCollectionByScope(); string colRedImage = "
"; string colGreenImage = "
"; // Define the child controls Table _table = new Table(); TableCell _tableCell; TableRow _tableRow; _table.ID = "InfoTable"; _table.CellPadding = 0; _table.CellSpacing = 0; _table.BorderColor = Color.Tan; _table.BorderWidth = Unit.Pixel(0); _table.BorderStyle = BorderStyle.Solid; _table.GridLines = GridLines.Both; //Get collection of scopes PageDataCollection pdc = Global.EPDataFactory.GetChildren(MogulEPiServer.GetPage(CurrentPage.PageLink.ID).PageLink); if(pdc.Count > 0) { foreach(PageData pd in pdc) { ListActivityItemByScope liScope = new ListActivityItemByScope(); //Get the property values for Scope from PageName string strScope = MogulEPiServer.PageName(pd.PageLink.ID); liScope.Scope = strScope; CollectionScopes.Add(liScope); //Create the row for Scope _tableRow = new TableRow(); _tableCell = new TableCell(); _tableCell.ColumnSpan = 5; _tableCell.Text = "
Område: " + liScope.Scope; _tableRow.Cells.Add(_tableCell); _table.Rows.Add(_tableRow); //Get collection of GoalsDescriptions PageDataCollection pdc2 = Global.EPDataFactory.GetChildren(MogulEPiServer.GetPage(pd.PageLink.ID).PageLink); foreach(PageData pd2 in pdc2) { //Get property values for GoalDescription if(MogulEPiServer.GetPage(pd2.PageLink.ID).Property["GoalDescription"].Value ! -
creating multiple datagrids during runtimeI wonder if it is possible to create multiple datagrids during runtime and bind these to records of data. I tried the following code but it did not work. Any help is very appreciated. foreach(....) { // for every loop the collection of objects will contain different data //and will be bound to a different datagrid control int numberOfGoals; for(int i = 0; i< numberOfGoals; i++) { DataGrid activityDatagrid = new DataGrid(); activityDatagrid.ID = i.ToString(); activityDatagrid.AutoGenerateColumns =true; activityDatagrid.DataSource = CollectionActivities;//collection of objects activityDatagrid.DataBind(); Page.Controls.Add(activityDatagrid.ID); } }
-
trouble binding datagrid to custom collectionI'm trying to bind a custom collection to an autogenerated datagrid without success. I'm getting this error: DataGrid with id 'DataGrid2' could not automatically generate any columns from the selected data source. Could you help me to find a solution? What is the problem in my code? Feel free to fix in my code.Thanks. Here is my code (NewsContent.aspx):
//-------------------------------------------------------------------- Code behind:(NewsContent.aspx.cs). public class NewsContent{ private void Page_Load(object sender, System.EventArgs e) { ListItemCollection myListCollection = AddToCustomCollection(); this.DataGrid2.DataSource = myListCollection; this.DataGrid2.DataBind(); } private ListItemCollection AddToCustomCollection() { ListItemCollection myListCollection = new ListItemCollection(); NewsContent.NewsItem myItem1 = new NewsContent.NewsItem("viko", "url1", "today"); NewsContent.NewsItem myItem2 = new NewsContent.NewsItem("vikan", "url2", "imorgon"); NewsContent.NewsItem myItem3 = new NewsContent.NewsItem("kiki", "url3", "veckan"); myListCollection.Add(myItem1); myListCollection.Add(myItem2); myListCollection.Add(myItem3); return myListCollection; } //Inner Class which holds all properties needed to show news content and listings public class NewsItem { public NewsItem() { } public NewsItem(string linkName, string linkUrl, string date) { } public string linkName; public string linkUrl; public string date; public string longDate; } } //--------------------------------------------------------------------------------- I'm using a collection class: (ListItemCollection.cs): public class ListItemCollection:CollectionBase { public ListItemCollection() { // // TODO: Add constructor logic here // } public NewsContent.NewsItem Item(int index) { //the appropiate item is retrieved from the list object and //explicitly cast to the ListItem type, then returned to the //caller return (NewsContent.NewsItem) List[index]; } public int Add(NewsContent.NewsItem myNewsItem) { return List.Add(myNewsItem); } }
-
Encrypting/Decrypting images in SQL serverI need to Encrypt and Decrypt Tiff images(500kb- 2 megabyte in size) in SQL server 2000. What is the best way to do that in asp.net C# (1.1)? Any example code is highly appreciated.
-
Sum columns in datagrid's footerI have used now the following to sum every autogenerated column in the datagrid but the totals in the footer columns are not right!Any help is appreciated. protected void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if(e.Item.ItemType == ListItemType.Footer) { //You can add Label controls for all cells since you don't know the column index. for(int index=0; index= columnNames.Count ==false) { viewCountSum += viewCount; } i += 1; } else if(e.Item.ItemType == ListItemType.Footer) { for(int i= 0; i< columnNames.Count; i++) { //Determine the column index and display the summary info. int colIndex = columnNames.IndexOf(columnNames[i].ToString()); Label lbl = e.Item.Cells[colIndex].Controls[0] as Label; lbl.Text = viewCountSum.ToString(); } } } //Here is the data source public DataSet CreateDataSource() { DataSet ds = new DataSet(); DataTable dt = new DataTable(); DataColumn dc; DataRow dr; dt.TableName="People"; //One way to create a datacolumn dc = new DataColumn(); dc.ColumnName="PersonID"; dc.DataType=System.Type.GetType("System.Int32"); dt.Columns.Add(dc); //Another way to create a datacolumn via its //overloaded constructor dc = new DataColumn("PersonAge",System.Type.GetType("System.Int32")); dt.Columns.Add(dc); dc = new DataColumn("PersonNameExtra",System.Type.GetType("System.Int32")); dt.Columns.Add(dc); //Now set the primary key for the table using PersonID DataColumn[] dtPK = new DataColumn[1]; dtPK[0] = dt.Columns["PersonID"]; dt.Primary
-
Customize the look of datagrid pagebarI'm showing data in a datagrid with built in pagination. I want to show on each page 100 records(pagesize = 100) so that the page barwill look like:( [1-100][101-200][201-300][301-400]...), but managed only to do it like([1][2][3]...). Any help is appreciated. Here is my code: public void NewPageIndex(object sender, DataGridPageChangedEventArgs e) { DataGrid_ExtCommMeasPoints.CurrentPageIndex = e.NewPageIndex; BindDataGridInfo(); } public void ItemCreated(Object sender, DataGridItemEventArgs e) { ListItemType lit = e.Item.ItemType; if (lit == ListItemType.Pager) { TableCell pager = (TableCell) e.Item.Controls[0]; for(int i=0; i
-
Sum columns in datagrid's footerThe problem is that I have an autogenerated columns datagrid so the number of columns displayed in the grid will vary from time to time. It will be difficult to Show each column's total in the footer because the number of columns is unknown. How can I determine in which footer column I will show which total of the column? Thanks
-
Sum columns in datagrid's footerIn an autogenerated datagrid I will be showing an unknow number of colums and rows with info as statistics as well the total of the rows in the Datagrid's footer. I know how to do that if the autogenerated colums is false. How to show these totals in the footer if the Datagrids autogenerated colums is true? Thanks Here is my code: Void ComputeSum(Object sender, DataGridItemEventArgs e) { 'First, make sure we are dealing with an Item or AlternatingItem if (e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem) { 'Snip out the ViewCount int viewCount = _ Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "ViewCount")) viewCountSum += viewCount } }
-
save data from excel sheet in sql server databaseI want to save data from an excel sheet into sql server database dynamically with asp.net. I wonder how to do that? Any exampel code would be helpful. Thanks
-
cost estimate web siteHas anybody here any example model of how to do a cost estimate for a database-driven web site (e.g., with sql server 2000 and .net)?
-
populating dropdownlist within a datagridI wonder how to do in order to populate a dropdownlist (with data from database) within a datagrid on page Load. Notice that I want the dropdownlists to be populated within the datagrid without that the datagrid is in edit mode.Any example code? Thanks.
-
transaction issueI'm inserting info in database when clicking a button. Some procedure are called. I want to do that with a transaction (when clicking on the button and within its procedure) so that everything will be inserted or nothing. How to do that? Thanks Private Sub btnRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) addExtPartyListToDB() AddReminderDB() addCostSplitDB() AddMoneyDB() AddinfoDB() AddmemberDB() end sub
-
filtering from multiple dropdownlistsI have several DropDownList Controls (ddlOrder, ddlContact...) where the user may select multiple values and let the results be displayed in the datagrid. I know how to filter when chosing from any of these dropdownlists. But don't know how to filer if the user wants to filter based on selection of some of these dropdownlists at the same time? Any Help? Thanks. Here is my Code: Private sub myFilter() Dim objConn As SqlConnection Dim strSql As String strSql = "SELECT Company, Contact, Title, Phone " _ & "FROM Customers" objConn = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString")) Dim sdaCust As New SqlDataAdapter(strSql, objConn) Dim dstCust As New DataSet() sdaCust.Fill(dstCust, "Customers") Dim dtbCust As DataTable = dstCust.Tables(0) Dim dtvCust As New DataView(dtbCust) dtvCust.RowFilter = "Company = '" & ddlOrder.SelectedItem.Text & "'" dtvCust.Sort = "ContactName" dtgCust.DataSource = dtvCust dtgCust.DataBind() End Sub
-
populating a datagridI have a datagrid with 2 item templates inside a hyperlink and a label (which will show the file name and creation date of files which resides on a folder on the server. I'm using a procedure (GetScannedFiles()) to loop and get the required information from the folder but don't know how to show this info inside my datagrid ( dynamically or from my aspx page). I appreciate any help. Here is the code for( MyDatagrid.aspx):
.....
Here is the code behind for (Mydatagrid.aspx.vb) Private Sub GetScannedFiles() 'Name of the folder which holds the scanned TIFF files (agreements images) Dim FolderPath As String = Server.MapPath("/TrackerAggreement/admin/FilesTIFF/") Dim source As DirectoryInfo = New DirectoryInfo(FolderPath) 'Get an array of all scanned TIFF files in the source direcotry Dim sourceFiles As FileInfo() = source.GetFiles("*.tiff") 'Loop to get File Names and Creation Time of the TIFF files in the source direcotry Dim i As Integer For i = 0 To i < (sourceFiles.Length) 'Get the File Name of every scanned TIFF file Dim FileName As String = Path.GetFileName(sourceFiles(i).FullName) 'Get the Creation Time of every scanned TIFF file Dim FileDate As String = Path.GetFileName(sourceFiles(i).CreationTime) i = i + 1 Next End Sub
-
encrypting images in asp.netI wonder if it is possible to encrypt images(like .tiff or .gif files) in asp.net? How? Any exampel code or url will be appreciated. Thanks
-
error on the server when trying to run PowerPoint from asp.net codePowerPoint is installed on the server. I have done as you have said and got the following error: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 204: catch (Exception ex) Line 205: { Line 206: LblError.Text = ex.InnerException.ToString(); Line 207: LblError.ForeColor = Color.Red; Line 208: // ex.Message + " " + ex.StackTrace + " " + ex.InnerException + " " + ex.Source;ex.InnerException.ToString(); Source File: c:\inetpub\wwwroot\laikatelemeeting\admin\upload.aspx.cs Line: 206 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] Upload.Omvandla() in c:\inetpub\wwwroot\laikatelemeeting\admin\upload.aspx.cs:206 Upload.BtnSubmit_ServerClick(Object sender, EventArgs e) in c:\inetpub\wwwroot\laikatelemeeting\admin\upload.aspx.cs:148 System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) +108 System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 I have an application in asp.net where from code I open a powerpoint presentation and save it to html. It is working well when running on my computer (after editing in the DCOM locally) but when I deployed to the server(and changed in the DCOM as I did locally) I got this error Message below: Which settings on the server should I edit? Thanks Unspecified error Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Unspecified error Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x80004005): Unspecified er
-
Logg off users with session.timeoutDo you mean that I should store the users sessionID in a database Table when they logg into the application and then delete these from the database (delete from Tablename , statement)? I did not make any changes in my Web.config file. Do I have to change the way I'm storing sessions there to make this work?Thanks for your help
-
Logg off users with session.timeoutI wonder if it is possible from a button click or a link to logg off (some unwanted logged on users or all users) in an asp.net application with session.timeout or another way?Thankfull for any code example/url
-
links in email body messageqs["senderAdmin"] = Context.User.Identity.Name; //The generated encrypted url that will be sent to the Customer url = "http://www.lkc.se/laikaTeleMeeting2/SigninCustomer.aspx?x=" + qs.ToString(); I have tried but it is not working: Mail.Body = "Klick here" + Min presentation; can you help me? Thanks