asp.net

Creating an Excel Workbook (*.xls) with formulas from .NET

I'm working with ASP.NET Webforms and I need to create an report as a Excel file. That should be easy, by changing the ContentType, but I need to dynamically add formulas to some cells. Any Ideas? PS: The format of the excel file should be XLS not XLSX. ...

How do I prevent static member variables from being accessed by more than one request at a time in IIS?

I’m having some trouble with understanding how IIS is handling static variables on its threads. My understanding has always been that if IIS has 4 worker processes that it can handle 4 requests simultaneously and that it would be the same as having 4 separate threads running the website. Any static variables would persist in each indi...

Paged listview - Set Active Page

I have a listview that displays products. I have a datapager associated with the listview. I control the visibilty/population of product details by a query string value "prodID". I need to make sure that the right page is active when the page is loaded. So if prodID 10 exists on page 2 in the listview, then page 2 will be the active ...

Asp.Net binding SQL data to a repeater?

I am trying to bind data from SQL to a repeater control. I have tried what I usually do for a Gridview and it doesn't work. I would like to see an example whether it be using an SQLAdapter or using ExecuteReader from a command. Thank you! string sql = "SELECT [WallPost], [DatePosted] FROM [WallTable] WHERE [UserId] = '" + Request["frie...

Validators on deployment server stopped working

This is strange and baffling. In my ASP.NET 2.0 app I have a form that uses a number of client-side validators. Custom, Regularexpression and RequiredField. My app requires that I enable or disable certain validators based on a dropdown selection. I do this in my codebehind event. All this works great in my dev environment however when I...

Designing a website for which users can create themes? (ASP.NET/C#)

What is an elegant way to architecture an ASP.NET website in which end-users can create custom themes for their sites through a user interface? Would ASP.NET themes help me here? Should the UI allow users to write guided CSS files to disc and apply those? Any suggestions are welcome. Thank you in advance. ...

Accessing TreeView with Javascript

I wish to minimize my server-client trips in this application and want to update the TreeView control through the Javascript. I am guess that the autopostback will have to be set to False. After the data is entered and the tree is ready to be saved, I will need to access the TreeView control on the server side in order to save it. Do...

Can you have <param> type tags within a asp.NET WebUserControl?

I want to create a WebUserControl (not a custom control) in asp.NET (C#). I want to have <param> tags that can be put between the control's start/end tags when being used in an aspx page. Eg: <abc:myWebUserControl id="myWUC" runat="server"> <param name="pName1" value="pValue1"> <param name="pName2" value="pValue2"> <param n...

ASP.NET TreeView performance

What would be the advisable thing to do to maximize the performance while using TreeView? By maximize the performance, i mean minimize the number of trips between client to server, ie postbacks. Would that mean then, that most of my Business logic will sit in the Javascript? What would be the compromise here? I am talking about ASP.n...

.net server control performance compromise

We are finding that for a large sets of data server controls (with the amount of postbacks) they do often times result in a very slow performance. While we don't want to do all the business logic in Javascript, we would like to speed things up. What were your solutions/ideas? AJAX? ...

How to get UpdatePanel from causing whole page postback?

Hello, I am using .NET 3.5 and building pages inside of the Community Server 2008 framework. On one of the pages I am trying to get an UpdatePanel working. I took a sample straight from ASP.NET website, but for some reason when I try and perform the function - update a time in an UpdatePanel to current time by clicking a button. Here...

How do I persist an object between threads without using httpcontext.items?

I've got an object that handles in memory caching for my data access layer (DAL) and I need to persist it between threads. From what I've read the preferred method is to use httpcontext.item with code like so: Shared Property DALList() As Dictionary(Of String, DAL) Get If Not Web.HttpContext.Current.Items.Contain...

How would I bind a SqlDatasource ConnectionString property to a function

I am trying to set the ConnectionString property to the return value of a function in the ASPX page. Example: <asp:SqlDataSource runat="server" id="blah" ConnectionString="<%= ServerSensing.GetConnectionStringByServer("someKey"); %>" > ... </asp:SqlDataSource> The above is obviously not going to work.. so.. what will? Pr...

Finding controls inside nested master pages

I have a master page which is nested 2 levels. It has a master page, and that master page has a master page. When I stick controls in a ContentPlaceHolder with the name "bcr" - I have to find the controls like so: Label lblName =(Label)Master.Master.FindControl("bcr").FindControl("bcr").FindControl("Conditional1").FindControl("ctl03")...

Is there a good comparison between ASP.NET, Java Enterprise Edition, and other "enterprise" platforms?

I've been Googling with little success, getting mostly marketing from Microsoft and Sun, backing their respective platform. Does anyone know if a resource that takes a good look at Java Enterprise Edition, ASP.NET, and any other major enterprise platforms? ...

Do you think ASP.NET MVC skills will be in higher demand in the future?

There seem to be factors for and against this happening. For: Growing number of applications being implemented on a web platform Growing need for web apps that work on different devices/platforms, and thus, a need for clean, compliant XHTML code on the front-end Against: Plugins such as Silverlight and Flash becoming more popular,...

Switching a Repeater's ItemTemplate at runtime

Is it possible to define multiple templates for a Repeater's ItemTemplate and switch between them according to some condition? I use a repeater to view a list of posts but want to have a different view for rows that belong to the current user (e.g. contains a LinkButton for deleting the post) If this is not possible, then is it possibl...

Pull string value out of JSON object.

Hey Everyone.. I have a web service that returns me a JSON object that contains the string "Hello World". How do I pull this string out of the object? data = [object Object] Thanks Nick ...

ASP.NET CustomValidator client side

I can't get this CustomValidator working. In the <head>: <script language="javascript" type="text/javascript"> function ValidateFile(sender, args){ alert("Hi"); args.IsValid = document.getElementById("fuFile").value != "" || document.getElementById("c101_c7").value != ""; } </script> In the body...

Convert Gridview column from ID to String in ItemTemplate

I currently have a Gridview that displays TypeID , Name , Description. I would like to display the actual type name instead of the TypeID in the gridview. I created this function that takes in the ID and returns the Name but I am having trouble using it. There are 15-20 different types so How do I convert the TypeID to a Type Name so t...