asp.net

Control Layout Template

I need a way to layout controls in a page. Let me ask you by example. I have four different action buttons (Edit, Delete, etc..) that do the same actions on any page, but sometimes I want them laid out horizontally and some other times vertically, depending on which page is displaying them. So I thought of placing all four buttons in a u...

'Company.Dept.Project.Controls.ControlName' is not allowed here because it does not extend class 'System.Web.UI.UserControl'

I have defined the following control which serves as a wrapper for another control (simplified code): using System.ComponentModel; using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Company.Dept.Project.Controls.ControlName { [ AspNetHostingPermission(Securit...

LinkButton inside LoginView LoggedInTemplate, how to trap the Click event?

I have a master page that contains a LoginView control. In the LoggedInTemplate I have a link button. I would like to trap that click event and do some cleanup (kill session, forms auth, etc). No matter what I do for some reason the button event never fires, and the LoginView switches back to the AnonymousTemplate. The fact that the ...

ASP.NET MVC Inline Edit

I am building an MVC 2 web app, where I want to display information about something (the parent) as well as child details which are displayed as rows (children have a many to one relationship to the parent). I have implemented AJAX in MVC before using Ajax.BeginForm and partial views Using this method - with minor changes for MVC 2 rel...

ASP.NET encoding problem

I need to fill textbox with russian text from query string: region.Text = Request.QueryString["r"]; When I redirect to this page on server (with Response.Redirect) or on client (by document.location) there are no problems with encoding. When I simply go to page in the text field are encoded characters (like ���). How to solve this prob...

ASP.NET IIS Authentication issue for some users

I have an ASP.NET repository site running on IIS6.0 and I have an issue that I can't reproduce, but three of the users have this problem every time (~20 other users run just fine). I'm pretty sure it has something to do with the IIS Authentication setup, but I certainly haven't ruled out a coding mistake. The users tell me that the com...

TextBox value is not updating in VS 2008, C# .NET

I'm using following DropDownList event to select an employee from MS SQL Server 2005 and showing the employee's information on TextBox. protected void employeeDropDownList_SelectedIndexChanged(object sender, EventArgs e) { EmployeeDAL employeeDAL = new EmployeeDAL(); ...

Format Data in an ASP.NET Repeater

Hello, I have an ASP.NET web form that uses an ASP.NET Repeater. The data source for this repeater is a DataTable that includes a column called "City", and one called "State". In the ItemTemplate of the Repeater, I want to call a custom method I've written called "FormatLocation". This method is defined as: protected string FormatLocat...

Eliminate the letters or marks out only leave numbers and apostrophe

the cases are listed below; 82&? 82,9 abse82,9>dpkg After Regex 82 82,9 82,9 Please help me to do it on c# with using Regex ...

Active Directory group authentication performance

I'm working on a web-based project that users will access after having been authenticated by Active Directory. My boss controls access to Active Directory, and wants to use groups to handle authentication to the application I'm writing. He's also provided me with a class to connect to pull the information I need from AD (logon name and a...

LINQ to Entities, several one-to-one references to the same tables and naming

Hi, I've started porting a .NET SQL Server application to LINQ to Entities. I have (among others...) one table called Users, and one called Time. Time is reported on a specific user (UserId), but it is also recorded which user made the report (InsertedByUserId) and possibly who has updated the Time since insert (UpdatedByUserId). This g...

Getting "Unhandled win32 exception" error when trying to instantiate CR XI R 2 Document

I'm trying to upgrade an old ASP.NET application we've got, which was written in VS 2005, and uses Crystal Reports XI Release 2, to VS 2010; and still using CR XI R 2. When it gets to the point of trying to instantiate the ReportDocument type, I get the following error: An unhandled win32 exception occurred in w3wp.exe [3148] The Just...

Window.open as modal popup?

I want open window.open as modal popup. var features = 'resizable= yes; status= no; scroll= no; help= no; center= yes; width=460;height=140;menubar=no;directories=no;location=no;modal=yes'; window.open(href, 'name', features, false); I can use Window.ShowModelDialog(), but in my child window I am calling parent javascript metho...

Articles on the inner workings of Session State Management (ASP.NET)

Hi everyone, I’m currently doing some work involving optimization of session-related code. The code I work on uses a state server approach in a web farm environment. I want to deeply understand what happens session-wise when a request occurs on the server. So far I’ve found two great articles on the matter: Fast, Scalable, and Secur...

Set ImageUrl in code

I can't figure out why this line of code Image1.ImageUrl = displayPath + photoFileList[index].ToString(); works in the Button1 click event but not in the btnNext click event (after clicking button1 to load the data). if i comment out the line in button1 it won't work in btnNext after clicking button1 public List<string> photoFil...

How can I print only one specific panel ID

I have an aspx page (c# using visual studio 2010) in which I have a terms of service. I would like to allow the users to print the terms of service without having to print the rest of the page. (The rest of the page is various other information) Therefore I would like a way to specify a panel ID and when the "Print TOS" button is pu...

How to merge web.configs for ASP.NET MVC and plain ASP.NET app

Merging the web.config files of a legacy ASP.NET App and a new MVC app has pretty much defeated me. Is there a way I can build my solutions with projects sectioned off into subfolders? EG (each project to have its own web.config): ~/PlainVanilla/ /* original asp.net app - still some life in old dogs */ ~/PlainVanilla/StrawberryMV...

2 servers, same website on both: IE shows two slightly different version

I'm getting a weird issue involving IIS and IE, and I'll try to describe it clearly. I have a regular html-css-js/jquery website that I've developed locally. Now that it's ready, I'm trying to deploy it on a server. Once it's hosted on the server, I see two problems in IE only: The rendering is slightly different: there's a few pixel...

ASP.net Checkbox Pairs

I have a page that renders two panels that display the same data differently using a repeater, differently. I then have a javascript function that toggles between the two views. I want each data item in each view to have a checkbox. <asp:panel id="1" runat="server"> <asp:repeater id="view1" runat="server"/> </asp:panel> <asp:panel i...

disable caching on a single page

Hi I have checked this thread. http://stackoverflow.com/questions/1160105/asp-net-mvc-disable-browser-cache And wondering if I can put the answer inside page_load ? If not how do I disable the cache on for a single page? Thanks! ...