asp.net

Form element messes up imported HTML/CSS layout template in ASP.NET

I want to use this pure HTML/CSS template for my ASP.NET website: http://sub3.tanguay.de I copy it inside my Default.aspx page, inside the FORM element, but the form messes up the layout: http://sub2.tanguay.de UPDATE: this now displays correctly, thanks to Devio. I tried altering the style of the form tag but can't get it to stop a...

Mocking for Dummies?

I'm new to mocking, I have a new .net web project that is in UI->BLL->DAL->DB structure, I use NUnit to do some testing currently. I intent to use it to test middle tier so I don't have to actually write to DB. Now, I've never done any mocking, don't quite know where to start, so I am looking for a mocking framework that has some end to...

ASP.NET based Workflow Engine

I am working on a design spec for a new application that will be heavily workflow driven. Before I re-invent the wheel, is there a decent lightweight workflow engine that plugs into ASP.NET already around? Basically, I'm looking for something that handles moving through a defined set of workflow pages while handling state management au...

ASP.NET theme not rendering correctly

Hello, I have a small web application which uses themes. The themes work on host, so on preinit, if the host = a, load x theme, if the host = b, load y theme. In my code this looks like: If request.url.host.contains("a") Then Page.Theme = x Else request.url.host.contains("b") Then Page.Theme = y I have a url which is a.abc.co...

Select a ListItem from DropDownList using a Linq Query

I' trying to use a Linq query to find and set the selected value in a drop down list control. Dim qry = From i In ddlOutcome.Items _ Where i.Text.Contains(value) Dim selectedItem As ListItem = qry.First ddlOutcome.SelectedValue = selectedItem.Value Even though the documentation says that the DropDownList.Items collect...

Question: Regarding GridView boundfield ReadOnly property

I have a Gridview boundfield where i set ReadOnly to true because i don't want user to change its value. However on the objectdatasource control's update method that boundfield became null when i try to use it as parameter in update method. Is there a way to set that value during updating? ...

Session Timeout ASP.Net

I'm trying to increase the timeout on all sessions. The site is hosted with Godaddy, and it is written in Flash (client side of course) and asp.net on the backend. I've added this to my web.config, <sessionState timeout="720"> </sessionState> Is that really all that I need to do? I'd prefer to not let sessions expire ever, but I'...

system transaction .net remove exception from session

Hi I am new to asp.net. I am working on an application that is doing system transactions. At some point in code an exception is raised and the code bombs out. It bombs out when clicking on a particular row record in a grid list. However after the user sees the exception...they go back and try to click some other record..which should ...

How to define CellPadding in GridView in ASP.NET

I autoformat a GridView in ASP.NET. It looks nice but the headers all run together like this: idfirstNamelastNameage I set CellPadding="5" but it does nothing. How can I set the cell padding of the headers and all cells? A D D E N D U M : Thanks Andrew, I fixed it with this. Works in Firefox and Explorer 7: .gridview2 tr td { ...

ASP.NET Configuration Folder Security Login Issues

I used the ASP.NET Configuration wizard to set up a web user. I then denied access to anonymous users on a folder. This works locally. However, when I upload my webiste to my hosting provider, when checking the login it says that it can't "access the SQL Server 2005". I notice that the wizard created the database files: App_Data/ASPNET...

What replaces .htaccess on IIS/ASP.NET sites?

On Apache/PHP sites if I want to put a senstive file within my website folders, I put a .htaccess file in that folder so users can't download the sensitive file. Is there a similar practice for IIS/ASP.NET sites, i.e. if I have a shared hosting account and don't have access to IIS server. Can I do this in web.config for instance? e.g. ...

Find a localized file

Hi In my asp.net app a user can upload several localized images (of buttons) . For example, he will upload 'send.gif', 'send.fr.gif', 'send.en-UK,gif; etc.. When a visitor is coming to his page, I need to pick up the right file based on the visitor's locale. Is there an api (or simple way) to find the best appropriate image based on...

Creating custom server control to accept user input

Hello, I am trying to build a server control that, depending on a "QuestionTypeId" display either a text box, date picker or Yes-No radio buttons. I have my control displaying how I want it to, but when the submit button is pressed on the form, the text box, date picker or radio buttons that were generated in the RenderContents method...

ASP.NET MVC Relative Paths

In my applications, I often have to use relative paths. For example, when I reference JQuery, I usually do so like this: <script type="text/javascript" src="../Scripts/jquery-1.2.6.js"></script> Now that I'm making the transition to MVC, I need to account for the different paths a page might have, relative to the root. This was of cou...

ASP.NET linkbutton raising onBeforeUnload event twice

I've posted this here, but thought it might deserve a question on its own. What I'm trying to do is show a dialog box that asks the user if he/she wants to leave the page if there are unsaved changes. That all works fine. But the problem is described below: Has anyone come across the problem where Internet Explorer fires the onbeforeun...

How do you iterate through custom keys in web.config?

Hi, is it possible to create my own custom keys in the asp.net web.config file and iterate through them with C#? How do you do both (where do I put the key? what format?)? I have an application for an intranet that does certain things based upon the IP address of the client. Instead of hard coding those in the codebehind file, I thou...

Passing master page form data to another webform

I have a master page with one form on it. It is a search form which must always be visible. When the button of that form is clicked I want the form data to be sent to search.aspx. The problem is, I don't know how. I cannot set the form action to search.aspx, because all my other pages which use the master form will go to search.aspx. Thi...

How to get Url Hash (#) from server side

I know on client side (javascript) you can use windows.location.hash but could not find anyway to access from the server side. ...

ASP.NET Session/Cache + multi-core processor server

Hello, I have a multi-core server hosting my asp.net solution. In the past with dual-core, etc. you had to modify your app to NOT use in-proc session state, etc. Is this still the case if its a dual core? Also, does server cache play a part in this? I have had no issues with session, but when i try to clear the cache from code, it do...

Why does global.asax change sql connection?

In asp.net 3.5, I have a problem that if I upload my global.asax to the remote web server, the app starts looking for my local sql server and eventually times out. I use a different config file for the local and remote because of the sql server login. Local is windows auth and remote is sql server auth. However, none of that info is ...