asp.net

C#: Preserving Bits per Plane when resizing images

I'm developing a service in which users can upload images and save them in a library. I want to preserve the original file (so people can upload high resolution images), but also make a copy of the image to use as a thumbnail. The problem I have is that the thumbnail "weights" much more than the original file, proportionally. When I che...

How to use HttpContext of an existing web site, from a web service?

I am building a web service which uses some of an existing web site's methods. However, some classes and methods cannot be used (for example Redirect - which obivously throws an exception when not invoked from a web site's context). Now I came to a section in code where HttpContext.Current.Application.Get(keyNames.EncodedKey) Is used. ...

Hosting ASP.net application from WCF

Is it possible to host an ASP.net (MVC in particular, but I'm not sure if that's important) application from a self-hosted WCF service? I don't want to get into IIS, and I'd like to avoid something like Cassini if possible. Sorry if this is a duplicate, it's really hard to find questions on this (everything is WCF on ASP, not the other ...

Binding Concrete types (using Inheritance) to a ListView and display in Hierarchical structure ASP.net 3.5

I would like to bind more than two different implementations of a class to a ListView and display the data in a Hierarchical structure (multi level). Look at the Code below to understand where I'm coming from: Thanks in advance M. public class AutoElements : CommonElements { public class results_dataset { ...

How can I change the "App_Themes" directory in ASP.Net?

I'm upgrading a .Net application from .net 1.1 to 3.5. All the themes are stored in a folder called Themes, the new .Net 3.5 framework wants this information in a folder called App_Themes. It will be a major refactoring for me to move everything to a App_Themes folder. So I want to ask if there is a way to tell .Net what folder to use ...

Using Response.TransmitFile for physical file not working

I am trying to user the Response.TransmitFile() to prompt a download. I have read a number of posts on the issue and based my method off Rick Strahl's blog http://www.west-wind.com/weblog/posts/76293.aspx The only difference (that I can tell) is that I am targeting a physical file outside of the virtual directory. This code is called in...

ASP.NET: My GridView control is only partially populating itself....(??)

Markup <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundField DataField="insured_first_name" HeaderText="First Name" /> <asp:BoundField DataField="insured_first_name" HeaderText="Middle Name" /> <asp:BoundField DataField="insured_last_name" HeaderText="Last Name" /> </C...

Code OnTime ASP.Net code generator

Hi Does somebody tested Code OnTime on a real world project (codeontime.com)? Technology looks promising, but their free version restrictions are too restrictive. I managed to put only few tables in a model, real DB has 20+tables. Also it is not clear how generated site works where DB contains lot of records. To my surprise I didn't fin...

Insert a Line Break after text in TextBox ASP.NET

I need to add line break after the following in the textbox. txtBody.Value = "Dear " & Trim(tblProperty(0).Item("Contact")) & "," I've tried so far 'ControlChars.CrLf', ..., 'vbNewLine', 'vbCrLf', ... at the end. ...

dynamically binding an event within a usercontrol

I am trying to bind a click event to a button within a usercontrol at runtime. The code I have written works form a plan old webform but the event is just not binding with in the control. Here's my code. First the page: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="myApp._Default" %> <%@ Register ...

cache dependency on file asp.net - not firing the event

I configured cache dependency on a file on the server, the cache dependency event stops responding to file changes once in 2 or 3 days. After I perform IISReset on the server, it works fine. How to debug this type of issues? Thanks in advance! ...

perform SQL Server operations with windows user id from an ASP.NET page

I have an ASP.NET application that authenticates users using Ldap against active directory. This is, the users enter their same windows credentials on the webform to login to this application. The application is basically a SQL Server database frontend, and in my limited experience, I use the standard connectionStrings label in the web.c...

javascript: how do I pass safe strings to an array for client side display without messing it up / ASP.NET C#

platform: ASP.NET 3.5 / C# My requirement is this: I want to create a rather large array on the server side (in C#) and pass it to the browser via Page.ClientScript.RegisterArrayDeclaration("gBank", js); My array is a 2-dimension array, and I am constructing it right to pass it to the client. Simple cases work fine. My problem is ...

Deleting from ASP.NET Repeater item - erroneous deleting...?

I have a repeater which binds a set of data. Within this repeater is a column with various controls for updating, deleting, etc. These are image buttons which fire an onclick event such as "DeleteRecord". All this does is fire a stored procedure, passing in the ID of the record to delete from the CommandArgument of the object. This work...

Open page in new window when a link button is clicked

Hello, I was trying to open a new window when a link button is clicked. <asp:LinkButton ID="lnkpackageinfo" CssClass="linkclass" runat="Server" OnClientClick="lnkpackageinfo_Click()">Compare Packages</asp:LinkButton> I want the target page to be given in the code behind because in the target page i want to use querystring ...

Not all labels on x-axis are showing in sql server 2008 report

Here is my problem. The bar chart report is showing data on x and y axis (y axis has 3 fields - min, max, avg values for time frame) and x axis has task type. For some reason, the chart only shows task types on the x-axis for some apparently interval, even though I have no interval set expressly. Any ideas? ...

Selecting Multiple Distinct Values in my Database [pls Help]

I have this online quiz wherein it generates random questions but the only problem that's left is that it repeats the previous questions... i have this limited questions (i.e i have 10 questions in my table but my limited questions is set to be 5 ..the output would only display 5 random questions) which i named as RequiredRecords ques...

ASP.NET session issues on a production server

This is a pretty vague question as I've had no luck reproducing my issues outside of our production web server and am unsure if my two issues are even related. My application server is running Windows Server 2003 and is public-facing. The ASP.NET web application runs in .NET 3.5 and uses a (private) SQL Server (2008) on the LAN. The ser...

How do I see the raw HTTP request that the HttpWebRequest class sends?

I know you are all going to answer "use a debugging proxy server like Fiddler" but it's not that simple. Here's my situation: I have some code that runs on a server, in an ASP.NET page code-behind (aspx.cs), which (among other things) establishes a connection to another server, grabs some stuff, and then formats it and returns it to the...

add mouse over affect to asp.net menu

i have the following code in my asp.net page that dispays 5 menu items as images. is it possible to easily add a tag that would enable a mouse over affect? <asp:Menu ID="Menu1" runat="server"> <Items> <asp:MenuItem ImageU...