asp.net

Hiding and showing content in ASP.Net based on value

I am looking for an elegant solution for removing content from an ASP.Net page if no data has been set. Let me explain this a little more. I have some blocks of data on a page that contain some sub-sections with individual values in them. If no data has been set for one of the values I need to hide it (so it does not take up space). Als...

Error accessing the Cache in the Application_Start method of Global.asax

I am trying to access the Cache in the Application_Start method of Global.asax. I am trying to accdess Context.Cache. When I run the code from visual studio it works just fine but when I run it on the server from IIS I get: Session state is not available in this context. I want to seed some values in the cache when the application starts...

Auto-Generate Binded Columns/Fields for a DetailsView

In Visual Studio I have set up a DetailsView and an ObjectDataSource which connects with my BLL. <asp:DetailsView runat="server" ID="UserProfileview" DataSourceID="UserData" AutoGenerateRows="False"> <asp:ObjectDataSource ID="UserData" runat="server" TypeName="UoM.Business.Core.UserAccount" SelectMethod="Read"> <SelectParameters> ...

Can you add data to a datagrid with no data source?

I have a DataGrid with 5 template columns, However when I try and add some dynamically created controls into the grid, it fails, as there are no rows. -Can i add a blank row in and use that? and how? -Or any other way? ...

Can I nest Templates in a Web User Control?

I want to do something like this: <MyTemplate> <span><%# Container.Title %></span> <MySubTemplate> <span><%# Container.Username %></span> </MySubTemplate> </MyTemplate> Assuming I have a list of Titles that each have a list of Usernames.. If this is a correct approach how can I do this or what is a better way? ...

Tracking e-commerce with Google

I've been asked to add Google e-commerce tracking into my site. This tracking involves inserting some javascript on your receipt page and then calling it's functions. From my asp.net receipt page, I need to call one function (_addTrans) for the transaction info and then another (_addItem) for each item on the order. An example of what...

Take down website to public, but leave for testing... "We're Not Open"

We are rolling out a site for a client using IIS tomorrow. I am to take the site down to the general public (Sorry, we are updating message) and allow the client to test over the weekend after we perform the upgrade. If it is successful, I open it to everbody - if not, I rollback. What is the easiest way to put a "We're not open" si...

LinqToSql Producing Different Sql Queries on Different Machines for Identical Code

I have a website built using Asp.net and LinqToSql for Data Access. In a certain section of the site, LinqToSql produces a query that looks like this (from my dev machine): select ... from table1 left outer join table2 on table1 where ... left outer join table3 on table2 where ... Since the connection between table2 and table1 is not ...

"Both DataSource and DataSourceID are defined" error using ASP.NET GridView

"Both DataSource and DataSourceID are defined on 'grdCommunication'. Remove one definition." I just got this error today, the code has been working until this afternoon I published the latest version to our server and it broke with that error both locally and on the server. I don't use "DataSourceID", the application reads database qu...

Using Python to authenticate against raw username, hash, salt in DB created by ASP.NET roles/membership

Hello all. We have a current application where user login credentials are stored in a SQL Server DB. These are, basically, stored as a plain text username, a password hash, and an associated salt for this hash. These were all created by built in functions in ASP.NET's membership/role system. Here's a row for a user named 'joe' and a ...

Disable autostart of integrated webserver in visual studio 2005

Is there a way to run a project inside a solution that has more one project (read: web applications) and avoid the autostart feature of the integrated asp.net webserver in Visual Studio? I have a big solution that has Windows forms projects, Windows Services projects, Web applications, Windows Libraries etc., sometimes I just want to de...

What is the connection string for odbc connections?

I've always done web apps and now I need to do a console app. I need to use both an odbc connection and a regular connection. In the past I would have used: <add name="LinkConnectionString" connectionString="Data Source=SERENITY\SQLEXPRESS;Initial Catalog=Link;Integrated Security=True" providerName="System.Data.SqlClient"/> In the w...

Compare string with ASP.net Membership Answer in the form of Hashing and saltvalue

I need to compare the answer in with the aspnet_membership tables PasswordAnswer value. The text in Password answer is in the form of Hashed. What algorithm they have used how they implemented the Salt value in ASP.net Membership Provider. I have tried hashing (sh1) and compared with text what is salt value How to hash my answer value...

Can you bin-deploy ADO.NET Data Services?

Anyone know of a hack to deploy ADO.NET Data Services without .NET 3.5 SP1 (just 3.5) on the server? Mosso is not ready to roll out SP1. I think this would also require bin-deploying the Entity Framework. ...

<%# Eval("State") %> or <%# DataBinder.Eval(Container.DataItem, "state")%>

What is the difference between having <%# Eval("State") %> in your aspx page or <%# DataBinder.Eval(Container.DataItem,"state") %> in your aspx page? Thanks, X ...

Editing Web.config programatically

What is a good way to edit a Web.config file programatically? I looked into System.Xml but couldn't find any obvious answers. Incidentally, ctrl-k seems to insert a code sample tag in the input box here. This is a bit annoying as ctrl-k is typically (in Emacs and Cocoa applications) used for killing a line of text. ...

Can you enable HTTP compression in IIS 6 without restarting IIS?

Hello - I'm currently optimizing the performance on my company's site; when it was taking 6-10 seconds to download 2MB+ of our homepage and assets (the site is mostly Flash with a lot of media, so it's not 2MB of HTML and viewstate). There are a lot of things that will need to be done to get this download size down; but one thing I defi...

Blackberry Browser ASP.Net click event

I've got a small little page that is going to be viewed from a BB. Here's my 2 questions: If I "click" on the link to submit the page, I get the following error: "JavaScript: An error occurred while executing a script." I can tell my BB to emulate a Microsoft IE browser and I don't get this error. I hope to not use this option because ...

ASP.NET Refreshing one Window from another

I have a page with a GridView on it that launches a popup, using Javascript. The user then selects an item, that updates the data connected to the GridView and closes the popup. How do I refresh the first (ie the Calling page) so that I can refresh the data shown in my Gridview? ...

XML to Database in ASP.NET

Using VB.NET, how do I add the values from an XML file into an SQL Server database with a similar schema? ...