asp.net

Should I be using Application.Lock()?

Consider the following situation: I'm using the Application object in ASP.NET to store a collection(List(of MyObject)) that is being accessed concurrently by several users. While I understand that reading from the Application object is thread safe, I'm wonder how I should make this code thread safe: objList = Application("GlobalList")...

Win form application freeze on HttpWebRequest file post

I have an application that will upload files from my client to a web server using HttpWebRequest (with the function suggested here: http://stackoverflow.com/questions/566462/upload-files-with-httpwebrequest-multipart-form-data) My problem is that when the file (about 10 mb in size) is being posted the whole application freezes (e.g. "ap...

Need to upload file, and use it in the pre-init event

As it states, I need to upload a file, and then use it in the pre_init event of a second page. Server lifecycle prevents this (as pre_init happens before the event handlers), that's fine, so the only way I can see around is to use page1 to upload the file, then do a response.redirect to the page2 where I can use the file in the pre_init....

How to make a code run on all aspx pages?

I need to create a code that reads the QueryString and set a value on the Session and on the end of the page I need to clear the Session. How can I make a code like this to run on all .aspx pages? ...

Nullref on Session.Current in App_Code file

I have a class Session.cs in the App_Code directory that needs to extract some values from the session. I define the session with this: System.Web.SessionState.HttpSessionState session = HttpContext.Current.Session; but when I run the page I get a Null Reference Exception on session. The class (Session.cs) gets called from anot...

Displaying a gridview's footer with an empty (linqdatasource) datasource

The datasource of the datagrid is a LINQDataSource which relies on the value of a dropdownlist. In addition, I want to use the footer to insert new records - so I'd prefer not to use the empty dataset template. I am trying to find a way to always display the footer regardless if the datasource is empty or not. EDIT: Is there a way to ...

Changing "web reference" to "service reference" changes method signature

I'm helping out a colleague on this one so if I'm missing some details that's why. We have an asp.net 3.5 web application calling a WCF service. Originally the app used a "Web Reference" to register the service however after having some trouble and burning an incident with Microsoft their solution was to replace the "Web Reference" wit...

Problem with HttpHandler and session state

I'm trying to fashion a solution which will simulate App_Offline.htm for remote access but still allow local users to test the website out. I found some various options that I am trying out but the best one doesn't seem to work for our ASP.NET(2.0) site which relies on session state being enabled on all of the pages. The HttpHandler is...

asp.net gridview paging

how do i make my grdivew page more dynamic than hardcoded upto 5 pages?, below code works fine but the limitation is that i can show upto 5 pages because i have 5 linkbutons. how can i make this code more dynamic page numbers? <asp:GridView ID="gvTable" runat="server" ShowHeader="true" PageSize="5" AllowPaging="true" AllowSorti...

access forms as asp.net's listview

I made an access vba application where all my architecting was simply creating a one-to-many relationship between a "status" table and a "data" table that contained all the other details of my record. Created a form with the single click of a button with my "status" table open, and wallah,,, I got a form for my open or closed records th...

ASPX: Get path of cs file

How can I get the path of a cs file in aspx? Here's the issue: I've created a property class in a property.cs file which is used in an EPiServer admin module. Server.MapPath() will hence return the path of the executing file, which is in a totally different place than my code. I need to get the path of the property.cs file (from inside ...

How to make asp.net parse markup tag property as list

Is there a way that I can extend asp.net to accept the markup <c:MyControl runat="server" MyList="1,2,6,7,22" /> Where MyList is a List<int> or List<string> or even List<someEnum>? So I want asp.net to parse automatically all lists (that can be parsed) generically. I know I could take the way around it and make MyList a string, the...

Uploading files in ASP.NET

I am trying to import an excel file using asp.net and C#. I found an example in VB, but it is using something called "Server.MapPath" which is not resolving to a namespace. I am on .NET 4.0, C#, and windows XP. I found a "HttpServerUtility.MapPath", but I don't know if this is the equivalent for IIS7? C# public OleDbCommand ExcelCon...

ms Chart Multiple Series X Value Mismatch (ASP.NET)

Hi, I'm currently developing a website that shows multiple charts that I build using data from SQL tables. I've used and followed Scott Mitchell's tutorial (http://www.4guysfromrolla.com/articles/093009-1.aspx) and K. Scott Allen's ChartBuilder class (http://code.msdn.microsoft.com/mag200903XASP/Release/ProjectReleases.aspx?ReleaseId=224...

How do I configure a WCF service that calls other services behind a load balancer?

I haven't deployed behind a load balancer before. My customer has a WCF service built and tested on servers using a service model configuration that is relatively straightforward. It provides a service to return an image of a map for another application. To get the map, it calls other services. The service was built in Visual Studio 201...

cannot access protected member ... without a python subclass of ...

bt_volver is a System.Web.UI.webcontrols.button and it's just a code it used to work fine in 2.0 IronPython 2.6.911.0 in ASP.NET webforms Visual Studio 2008 Professional 9.0.30729.1 SP cannot access protected member bt_volver without a python subclass of abmlocalidades_aspx Error de código fuente: Línea 7: else: bt...

ASP.Net ModelState Automatic Error for Enum List

I have a class like this public class MyClass { public MyClass() { Enumlist = new List<MyEnum>(); } public virtual List<MyEnum> Enumlist { get; set; } } and the enum is public enum MyEnum { Enum1=1, Enum2=2, Enum3=3 } but in my view i keep having this eror "The value 'System.Collections.G...

Binding to a List<string> using DataBinder.Eval

I have the following object: CrossTabDataObject { string RowName{get;set;}; int RowId{get;set;} List<string> CellContents = new List <string>(); //Constructor..... etc. } I'm building a dynamic crosstab grid using GridView in asp.net 3.5 I wish to bind to CellContents[0] for dynamic column 1, CellContents[1] for dynamic...

ASP.Net ListBox values not posting changes after jQuery manipulation?

Hi everyone, I have an ASP.Net page with two ListBox components, rendered in the browser as <select> lists. I'm using jQuery to move elements from one list to another by manipulating the DOM. I then select all elements with the mouse and postback the form. That way, all the list elements are posted with the form. When I submit the ...

What's the best hosting for ASP.NET MVC 2, Silverlight 4 and WPF with Team Foundation Server 2010?

I need some web hosting for testing my internal web application with my few customers and hosting my personal public website. The web hosting must provide almost following request. Allow me to use the following technology. ASP.NET MVC 2 or higher MS SQL 2008 R2 Silverlight 4 and WPF (xbml) Team Foundation Server 2010 Price must ...