asp.net

Image inside UpdatePanel not working in Firefox

I have an image that is generated automatically inside an Ajax UpdatePanel. This image is a graph that is generated from server-side code. Searching in Google, I realised it was a bug of FF. Does anybody have any solution? Here is the source (it contains also unneeded tags, I just copied-paste) <div> <asp:UpdatePanel ID="UpdatePane...

string.Format throws System.Format exception on HTML + javascript

I'm running string.Format on a readonly string that contains a bit of HTML + javascript but I get a System.FormatException instead. This is my format string: <script type="text/javascript"> function {0}_showHideFieldWindow() { if ({0}.IsCustomizationWindowVisible()) { {0}.HideCustomizationWindow(); } els...

ASP.NET: How to initialize when *user control* is initially loaded

I have an ASP.NET user control that I'm embedding in another user control. This works fine. I need to know the best logic/method for detecting when the control is loaded. In other words, I have some display initialization logic that needs to run when the control is initially displayed. Surely there is a pattern for this. The typica...

Displaying proper date format depending on culture.

I am using a control for a popup calendar date picker. This uses a javascript function, SetText, to set the textbox to the given date. I can't change anything in the calendar control itself but I can override the SetText function. The SetText javascript just takes the TextBox name and the date value in string format and sets the TextB...

Insert BoundField into DetailsView

Basically I have a detailsview, dependent on what query it is I have certain BoundFields I'd like to show or hide. Using visual basic, I know that I can use .visible = false. That does the trick, however, it sacrifices my alternating row style in the process. Any ideas? Thanks By the way if you write it in C# I will probably understa...

ASP.NET MVC model binding and validation question

I'm trying to use MVC for a new project after having been around the block with all the samples and tutorials and such. However, I'm having a hard time figuring out where certain things should take place. As an example, I have an entity called Profile. This entity contains the normal profile type stuff along with a DateOfBirth property ...

ASP.NET horizontal menu with submenu appearing below, also horizontal

I've got a horizontal menu with UL/LI markup that I want to convert to an ASP:Menu in .net 3.5. I'd like choices in the submenu to be rendered in a horizontal menu below the main menu when the main menu option is clicked. I also want to: indicate which menu option is chosen by highlighting/bolding both the main menu and submenu, chec...

What might be causing the"The client disconnected" ASP.NET exception?

My .NET 3.5 application sporadically throws the following exception System.Web exception: The client disconnected Any ideas why this exception is occurring? My application is running on a load balanced Windows Server 2003 IIS 6.0 server. ...

ASP.NET - How to load page via server-side code (C#) with MVC Pattern in place?

I am trying to use more server-side code (MVC pattern in place) and one of the methods that I am thinking of implementing is something like: LoadWebPage(). If a user is on a page, say Page1.aspx, and they click on a hyperlink, I would like to call the above method, LoadWebPage(). But the problem is, I do not know how to load another pa...

Inverting Image Transparency in ASP.net

I am trying to build a page that will allow me to take an input image and generate a mask from it. The input would be an indexed PNG with a transparent background. The resultant image would be be black where the original was transparent and transparent wherever the original image was opaque. I've done some very basic image manipulatio...

ASP.Net View PDF

Is it possible that when you have a webpage, when you open the PDF, the file view is defaulted to 100% size? Thanks. ...

Using HttpModule to Display Images

I have an HttpModule that displays images that follow a certain URL pattern. For example, /images/employees/jason.jpg is handled by the module, but all other images aren't. It works just fine on my local machine (Cassini and IIS 7). However, the IIS6 production server isn't working. I've had the hosting company map the images to the ASP....

Search Active Directory in WebApp for multiple users

a web application I work with requires a form which allows an Administrator to add users into the web applications user table. The web application is intranet based and is run in a number of countries world wide. They need the ability to search Active Directory to find users to add from across multiple domains. Searching domains that ar...

how to reference public objects from other ASP.NET pages

How can we access and reference classes and variables in different pages in ASP.NET? In version 2003, it was straight forward, just reference the class name of the page and the whole page becomes at your command, but with Websites instead of Web Applications, that does not seem to be the case. I have an App_Code folder, with a class that...

jQuery Intellisense in VS 2008 not working with ajax ToolkitScriptManager

I've followed all the steps to get intellisense working for jQuery in VS 2008 SP1 (with the vsdoc hotfix). It works when I reference jQuery inside an asp:ScriptManager control like so: <asp:ScriptManager runat="server"> <scripts> ... </scripts> </asp:ScriptManager> But I'm using ajax ToolkitScriptManager instead and the intellisense d...

How to remove login link from YAF.NET forum header?

I can't find good reference in yaf support forum for this issue. I followed these steps from yaf support forum... comment out these lines in pages/ForumPage.cs. if ( TransPage != "LOGIN" ) header.AppendFormat( String.Format( " | <a href=\"{0}\">{1}</a>", Forum.GetLink( Pages.login, "ReturnUrl={0}", Server.UrlEncode( Utils.GetSafeRa...

asp.net add templatefield items for many dropdownlist to detailsview control

How can I add the following templatefield programmatically for each of the dropdownlist control inside the details view? <asp:TemplateField HeaderText="Your Gender"> <EditItemTemplate> <asp:DropDownList ID="ddlGender" runat="server" DataSourceid="ddlDAGender" DataTextField="Ge...

Do you have to compile .net 3.5 code

We have a .net 2.0 folder and a .net 3.5 folder in our web application. I am able to simply upload a new .vb file and see the changes in 2.0 without having to compile and upload the build. However, In 3.5 it seems I only see my changes after doing a compile and uploading the build. Does anyone know what is forcing me to have to compil...

How to make the Asp.Net/WSE asmx page generator add the base class properties in a derived class

I have a simple base class B with 2 public properties. This class is inherited by another class D that adds another public property. The derived class is returned by a web service call. The page generated by ASP.Net looks like: '''<remarks/> <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3074"), _ Sys...

Best practice checks when allowing users to upload files to a web application

The target web application is using ASP.NET 3.5 technology but I'm more interested in the intent of the list of checks to enforce on the server. The following list is my initial thoughts, is there a better checklist out there? Are any of these thoughts misguided? Limit file size at an HTTP infrastructure level. Anti-virus. Only allow ...