asp.net

How to find a server's machinekey if it wasn't set

Trying to transfer servers but a connection string is encrypted and there is no machinekey set in the web.config. Is there anyway to find out what the machinekey was on the old server so we can set it on the new server? ...

Dynamically Generated Datatable for Google's Annotated Time Line

I want to use Google's Annotated Time Line Visualization. It is very easy to make this work by manually adding the lines for column & row data. This is all done through attributes of google.visualization.DataTable(). I would like to update this data table dynamically, but I do not know how. The data is on a server running MS SQL Server ...

How to increase the max upload file size in ASP.NET?

I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default. I have found in certain places referencing the below code at msdn. [ConfigurationPropertyAttribute("maxRequestLength", DefaultValue = )] None of the references actually describe how to use it, and I have tried sever...

Select on collection - C#

Say I have a sql query SELECT fname, lname, dob, ssn, address1, address2, zip, phone,state from users Now say the records are now either in dictionary base or a strongly typed collection. I have a grid view control and i want to bind it to my collection but I only want to display fname, lname, dob and ssn and not the other columns. ...

Prints pdf when page loads

Hi, I have this code in my aspx page; <a href="javascript:void(0);" onclick=<% Print(); %> title="Print listings">Print</a> which presents a link to print a listings to a pdf when the user clicks on it; as you can note the script calls a function from the behind code. The problem is that when I coded this it happens that when I go th...

How to return JSON from a 2.0 asmx web service

I saw another question like this but it did not answer my question. I am using .Net framework 2.0 / jQuery to make an Ajax call to a 2.0 web service. No matter what I set the contentType to in the ajax call, the service always returns XML. I want it to return Json! Here is the call: $(document).ready(function() { $.ajax(...

How to raise custom event from a Static Class

I have a static class that I would like to raise an event as part of a try catch block within a static method of that class. For example in this method I would like to raise a custom event in the catch. An advice, code samples would be helpful. public static void saveMyMessage(String message) { try { //Do Database stuff } catch (...

Setting Response.ContentType="image/tiff" in asp.net 1.1 and IE7 doesn't display tif files

I have an Asp.Net 1.1 application that uses the following code to write out an image file to a pop up web page. Response.ContentType="image/tiff" 'Only for Tif files Dim objStream As Object objStream = Server.CreateObject("ADODB.Stream") objStream.open() objStream.type = 1 objStream.loadfromfile(localfile) ...

ObjectDataSource and Collection of Objects

I have a GridView that I would like to bind to an ObjectDataSource. I have a ReadOnlyCollection of business objects that have many properties. I only to need to display four of these properties in the GridView. I haven't used the ObjectDataSource control before, so how can I use it to display 4 properties of all of the business object...

HTML hyperlink with mouse over image

I am having a Html hyperlink. I need to link this hyperlink to another page.When I place the mouse over the link. It should show the image. how to do this ...

ASP.NET MVC US State Drop Down List

anyone have have a dropdownlist helper method with a list of US states? thanks. ...

Paging on Gridview control VS-2008

If you followed my previous post var filteredUser = from U in collection select new {U.fname,U.lname}; gridView.DataSource = filteredUser; gridView.DataBind(); Now I am trying to do this: Format the column names based on properties of U. So for example if U.fname chancges to U....

ASP.NET HttpModule - guaranteed execution of pre- and post- handler code?

Basically, I'm trying to write the following (pseudocode) in an ASP.NET HttpModule: *pre-code* try { handler.ProcessRequest(...) } catch (Exception) { *error-code* } finally { *post-code* } I've found that I can hook into HttpModule.PreExecuteHandler for "pre-code" and .Error for "error-code". But PostExecuteHandler doesn't seem to b...

Sql Server 2005 only accessible in ASP.NET 1.1 when I specify protocol and port

My company is currently migrating some of their really old db's to sql server 2005. Some legacy apps have problems connecting to the new server. The connection string works in Asp.NET 2.0, probably because it assumes tcp:1433 automatically. I have to construct the connection string like this in ASP.NET 1.1 for it to work: "Server=tcp:m...

SVN Reporting in ASP.Net

We have a custom project management tool built in ASP,net 3.5 and we use VisualSVN for our version management. However, we are looking a way to report the version changes through the project management tool by integrating VisualSVN with our project management tool, i.e. pretty much similar to what Trac [python based SCM tool] provides. ...

ASP.NET logic / connection pooling and error handing

Hi I just uploaded my first ASP.NET (as part of my learning of vb.net) and got into awful mess with the connection pooling (funny things happen when there are more than 1 user of your web site) all sorted now by better use of the try catch statements (well the idea was to learn) BUT I was wondering if this is the best / final method, no...

Connecting to SQL with ANONYMOUS LOGON since switch to IIS7

Hello, I've recently had my PC upgraded to Vista, which means it includes IIS7. The problem is that the ASP.NET website we're working on doesn't work anymore. I get an error because the application is trying to connect to the SQL Server with NT AUTHORITY/ANONYMOUS LOGON instead of my domain user, and anonymous isn't authorized. I've trie...

How can I make my image control's imageurl dynamic depending on host?

Hi, I am trying to convert my web application into a fully dynamic system. One thing I am trying to do is to load a different logo (set in the masterpage template) depending on the host. But, even though the code is hit (in page_init), there is no image displayed on any page inheriting the masterpage - no image, no red x's, nothing. M...

textbox autocomplete

how do i make an autocomplete textbox in asp? but i need to get the autocomplete data by querying the database. I dont really know how to explain this, sory if theres not enough detail. i cant use ajax, because i think i will have compability issues with my old app. so im thinking of doing this using java script. or is there a way to d...

check for duplicates in arraylist

I have an arraylist that contains items called Room. Each Room has a roomtype such as kitchen, reception etc. I want to check the arraylist to see if any rooms of that type exist before adding it to the list. Can anyone recommend a neat way of doing this without the need for multiple foreach loops? (.NET 2.0) Cheers ...