asp.net

ASP.Net Localization & Bound controls

When I localize an asp.net page that is using bound controls (DetailsView, etc) that has TemplateFields bound using the <%# Bind() #> syntax, after the localization all of the bindings are removed and I have to go back in & rebind everything. I'm creating the localized resource file by switching to design view, then Tools / Generate Loc...

adding .net code to a classic asp website, can't reference namespaces in .dll file

I have an existing fairly large classic asp website, with virtual directories configured to centralize certain resources. My problem is for some reason I can't access any of my namespaces and classes. I tried adding a reference to another project where I have classes in a namespace "DAL" and even though intellisense sees the classes and ...

How to export an asp:GridView's TemplateField fields to excel in c#?

Does anyone have an example (code or a link) that will allow me to export a gridview template field to excel? Here is an example of what I mean. Assume I have the following GridView Declaration: <asp:GridView Id="gvResults" runat="server"> <Columns> <asp:TemplateField HeaderText="Contact Info"> <ItemTemplate> ...

Zip Folder is always corrupted after downloaded

Hi, For some reason when I download a zip folder from my server's folder it is always corrupted. Here is the code: protected void gvFiles_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { string fileUrl = String.Empty; if(e.CommandName.Equals("DownloadFile")) ...

Calling a parent page code behind method from a child page code behind - ASP.NET 2.0 Page Inheritance model

What would be the best way to call a method in the code-behind of parent page from the code behind of the child page in the ASP.NET 2.0 Web Site model? Scenario: User clicks a link in the parent page to view a data record's detail in child page (The parent and child are tow seperate pages). The user will modified the data in the client...

Type ‘System.Web.UI.WebControls.SessionParameter’ does not have a public property named ‘DbType’.

I read this: link text My dev box , everything runs fine. On production server, they installed V3.5 framework and i got to my site and i got this error. Do I have to do something to get it to read the V3.5 assemblies? ...

asp.net website external bin folder

Can I put my "bin" folder with all of its .dll files at a higher level then the IIS Local Path/web root for the site? I need to keep my dll files in a directory outside of my project is this possible, I tried to use a virtual directory but .net seems to ignore it. Can I use a virtual directory for my bin folder? DUPLICATE: More info p...

How can I add an ampersand for a value in a ASP.net/C# app config file value

I've got a C# program with values in a config file. What I want is to store ampersands for an url value like... <appSettings> <add key="myurl" value="http://www.myurl.com?&amp;cid=&amp;sid="/&gt; </appSettings> But I get errors building my site. The ampersand is not allowed. I've tried various forms of escaping the ampersands to ...

DropDownList SelectedIndex always = 1

I have a dropdownlist in a page. The values of all the list items = "0". I have viewstate turned off. When the page posts back, the selected index always = 1 in Page_load event, regardless of the selection in the list. If the values of the list items are different, the selectedIndex has the proper value. Is this normal behavior? ...

Why doesn't globally declared DataTable retains its value?

I have an aspx page with a gridview. In my page load event, I load a datatable with all the data like so: HistoricalPricing historicalPricing = new HistoricalPricing(); DataTable dtHistoricalPricing = new DataTable(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { dtHisto...

Asp.Net Performance Resource / book

Can you recommend a favourite resource/book for techniques and practices on writing asp.net apps that perform/scale well? ...

What is the best way to allow for multiple buttons on an ASP.NET MVC form?

I have a feeling I'm being too "webforms" with this, but I'll ask anyway. I have a form in an ASP.NET MVC project that has some input fields and two buttons on it. One button is used to 'filter' one of the list boxes. The other is used to submit the form. My view looks something like this: <%using (Html.BeginForm()) {%> <%=Html...

Passing Value Between Web User Controls - DifferentQuestion

Hi, I want pass values between web user controls without writing any code to the main page which user controls are put on. I do something like that but after doing that I need to click double to pass the value. The example of what I've done : Department User Control (Code-Behind) protected void Page_Load(object sender, Even...

ASP.NET Localization with singular and plural

Hi all, Can I with ASP.NET Resources/Localization translate strings to depend on one or other (the English grammar) in a easy way, like I pass number 1 in my translate, it return "You have one car" or with 0, 2 and higher, "You have %n cars"? Or I'm forced to have logic in my view to see if it's singular or plural? ...

Hosting user videos

My client would like website visitors to embed videos in their profiles. We've suggested that we use YouTube for a quick and cost-effective (free) solution. However he is not keen that YouTube would control access to the videos which are an important part of his service. It seems unlikely that YouTube would suddenly pull the plug but to ...

Load an ASP.NET 2.0 aspx page using System.Reflection?

Can I load an stand alone aspx page in another stand alone aspx page using System.Reflection? I am using the ASP.NET 2.0 Web site project model. ...

LINQ: Cannot insert duplicate key row in object 'dbo.tblOutstandingCompletions' with unique index

Hello I have an application (ASP.NET 3.5) that allows users to rerun a particular process if required. The process inserts records into an MS SQL table. I have the insert in a Try / Catch and ignore the catch if a record already exists (the error in the Title would be valid). This worked perfectly using ADO but after I conveted to LINQ I...

ASP.Net resource files

I'm using selenium to run some functional tests on the UI for our current application. I want to ensure that strings from the resource files in the Web project are being displayed at the correct time and place. Simple (I thought) all I have to do is reference the assembly of the web application and assert that the text selenium is rea...

ASP.NET - Single large web request triggers System.OutOfMemoryException - Still have plenty of available memory

Environment: Windows 2003 Server (32 bit); IIS6, ASP.NET 2.0 (3.5); 4Gb Ram; 1 Worker Process We have a situation where we have a very large System.XmlDocument is being loaded into memory, and then it heads into a complied XSL transform. What is happening is when a web request comes in the server is sitting in an idle state with 2500Mb...

Can an Ajax-enabled WCF Service pass back a DataTable as a Sys.Data.DataTable?

Can an Ajax-enabled WCF Service pass back a DataTable as a Sys.Data.DataTable? Like this but in WCF. My OperationContract looks like: [OperationContract] public DataTable GetEmployees() { NorthwindService ns = new NorthwindService(); return ns.GetEmployees(); } Through the Firefox error console I get t...