asp.net

asp.net GridView isn't updating properly.

I have a Gridview with these parameters: <asp:GridView runat="server" ID="ItemGrid" CssClass="Grid" AutoGenerateColumns="false" AutoGenerateDeleteButton="true" OnRowDeleting="RowDeleting" AutoGenerateEditButton="true" onRowEditing="RowEdit" OnRowCancelingEdit="CancelRowEdi...

Need the best approch to show a group of server control according to its permission.

Suppose I have a page which have more that 50 asp.net server controls. Now I want to display some control according to the logged in user's permission and rest of the controls will be hidden. In the same way, if an another user logs in then according to his/her permission it will show another group of controls on that page. So what is t...

can't get System.Web.SessionState with asp.net 4 webforms routing

I've seen couple of questions here such as http://stackoverflow.com/questions/161221/state-service-when-using-system-web-routing-in-webforms but couldn't find proper solution. I am using asp.net routing with webforms on iis7. I've added below to webconfig file to get it working at first palace <system.webServer><modules> ...

ASP/VB6 to .NET conversion help...

i'm updating some VB6 code to .NET and have come across a small problem. i'm basically in an infinite loop because i don't know the .NET equivalent of RecordSet.MoveNext() (VB6). i've updated the use of a RecordSet with a DataSet While Not _sqlADP.Fill(_dataSet) = 0 // code // more code // original VB6 code had _recordSET....

data grid bound with dropdown list

How do I dynamically change the content of a data grid to select the correct data from database when the drop down list SelectedIndexChanged event happens? To be more specific, I have a dropdown list of apple, orange and pearl. When the dropdown list changes from apple to orange, I want the datagrid to query the database like this "sel...

Is it possible to read Page MetaKeywords in .NET 3.5?

I need to read the page keywords, is it possible to do with C# 3.5 ? ...

how not to have setfocus on textbox?

i have a TextBox control on my masterpage <asp:TextBox ID="txtSubject" runat="server" Width="280px" CssClass="formtxt" onblur="if(this.value=='') this.value='Enter text,150 characters only';" onfocus="if(this.value == 'Enter text,150 characters only') this.value='';" Text="Enter text,150 characters only" CausesValidation="false"></...

Display a list of results with numbers in ASP.NET

I have a common problem in an ASP.NET web form. I'm just surprised that I haven't found a common solution :) I have a list of results being returned from a SQL Server database. I want to show those results in my web page with number to the left of them. For instance, my result set may look like the following: New York | NY Chicago | IL...

ASP.NET - "Unknown user name or password" when trying to copy file to remote share

I have an ASP.NET application that's trying to copy a file to a remote share that's on a server on another domain ("REMOTEDOMAIN"): File.Copy(@"c:\Test.txt", @"\\REMOTEMACHINE\Share"); When we get to the File.Copy method, I'm getting "Login failure: Unknown user name or password" when trying to connect to the share through the local I...

getting the selected value on an asp.net mvc selectlist

Hello, I'm failing at getting the selected item on a mvc dropdown list. I can't stand viewdata, and every example uses it. Here is my code, thanks in advance. //controller public ActionResult Register(Models.Person APerson) { } public class Person { public Person() { using (var mod...

web.config file references cannot be found in intellisense

I have referenced multiple user controls within the web.config file, because I was receiving an error in the individual pages and they are used in multiple pages, the code I wrote is as follows: <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, Publ...

ASP.Net show/hide parent and child controls by passing variables

I'm trying to update the visibility of a parent control based on an event in this same parent's child control. It is a large pre-existing project and I'm trying to add some basic logic to simplify a checkout process. The problem I'm having is that it has so many control (which is a good thing) that due to it's structure I'm not sure ho...

FormsAuthentication: how to specify different cookie names for specific subdirectories/MVC controllers?

I'm using FormsAuthentication (with cookies) for users authentication, with the default cookie name (".ASPXAUTH"). What I need is a different login system for the "/Admin/" virtual directory (backed by an ASP.NET MVC controller, "AdminController")... as if the "/Admin/" directory was another web application, but without creating another...

Load ASP.Net User Controls via jQuery AJAX

I have mini modules(think iGoogle) that are currently loaded via the page calling LoadUserControl method and loading that control into PlaceHolders. I need to switch that implementation to loading the controls through a jQuery AJAX request. The problem currently lies in the fact that when I perform an AJAX Get, I can load the modules by ...

asp.net httpmodule execution order

Does the order of httpmodule execution match their order in the web.config or is it undefinied? ...

Classic ASP or ASP.NET : make multiple async calls, return when all complete

I need to gather information (via GET) from several other websites (not under my control), do some processing (specific to each source) on the data returned, and then print all the info out to the user. Right now I'm making the GET request to website A, waiting for it to return, processing it, then calling website B, and so on... Obviou...

Is there a good alternative to having JavaScript code as string literals in my ASP.net code?

Working on an ASP.net web application, I've been wondering if there is a good way to avoid writing JavaScript code in string literals in my ASP.net code. See here: http://www.4guysfromrolla.com/articles/030202-1.aspx. In the linked example, I see code that looks like: Private Sub Calendar1_SelectionChanged(sender As Object, e As Ev...

Moving from custom n-tier OR/M to EF4

I currently have a custom ORM. I have a business layer, and data layer. My Data layer has all my CRUD operations. In the example below, I pass an Id to the constructor. This gets the record from the DB and fills the object with my person record: E.g. //Access through business layer Dim person as new Business.Person(Id:=1) person.Data...

How to display .NET string in a div and include line breaks?

I have a list view that does something like this in the ItemTemplate: <div><%# Eval("QualificationDescription") %></div> My problem is that QualificationDescription has line breaks in it, if I put it in a TextBox it will display them but if I put it in a div it does not. Is there anyway to get the line breaks to show in a div? ...

asp.net expandable image

I have an image which is too big so by default I want it to be hidden and instead, display something like a "+" sign on the page. toggle that sign will show/hide the image. Which component in asp.net can achieve this? I did not find anything in the VS 2010 Toolbox. ...