asp.net

How to Bind a custom class with no strongly typed properties

hey guys, here are my requirements: I need a simple class with only one Public property and no Public methods (the final Class will be more complex, but for testing this is all I need) The Property is "Item" and takes a "String" as a parameter. It returns a "String" based on the parameter. I then want be able to add instances of this ...

How to output XML in Log4Net

Hi guys, I'm working with Log4Net under my 3.5 SP1 Web Project and I need to know how can I (reads Log4Net) create the log file as a xml file instead text, line by line... I'm thinking that can be a easy thing, but... I can't find the trick to apply :( Thanks. ...

How do I use PDFBox with Asp.Net for parsing pdf files with c#?

I recently downloaded PDFBox, and I am trying to figure out how to parse pdf files with it in Asp.Net to no avail, in fact, I don't even know where to start. Has anyone been able to do this in asp.net (C# preferrably)? Is there any other ways to parse text out of a PDF in Asp.Net? ...

ASP.NET: Timer and scroll position

Got a timer inside an updatepanel. It constantly refreshes (about every 2.5 seconds). If it refreshed while scrolling it sets the scroll position back to what it was berfore the partial update :( I'm using ASP.NET 3.5 and MaintainScrollPositionOnPostback is set to false (even if set to true behaviour doesn't change). No clue why this h...

Solution to remove frames from a website

At the moment I'm working with a booking website that has a frame set. Let's say, 40% is from it's own website, so can be easily altered into a frame less site. However, the actually booking-flow is from another website (also maintained by us) and is meant to "live" on it's own, so that 3rd party websites can buy/use the booking-flow a...

Strip away all HTML tags and formatting (RegEx)

I have RSS feed that I want to modify on fly, all I need is the text (and linefeeds) so everything else must be removed ( All images, styles, links ) How can I do this easily with ASP.NET c# ...

Using Cache on C# ( VB code included)

How can I use web server cache in a similar way as the following VB code does: //// FindData() returns real data //// FindCached() returns from cache (kept 20 minute) Protected Function RegisterCachedData(ByVal id As String) As Integer Dim onCacheRemove As CacheItemRemovedCallback onCacheRemove = New CacheIte...

Youtube API integration ASP.net - upload video with a single page

Hi, we are trying to use the Google YouTube API to upload videos from our website to Youtube through the browser directly. The API works in two steps, in the first step we need to create an Video object with all the metadata like title,tags,description, category etc. Then we need to send a request with this object to Youtube and get a...

How to change Action attribute of the aspnetForm on MasterPage dynamically

We are trying to modify the Action attribute of the main ASP.NET form in the master page dynamically. The page has a radio button, user selects one of the options and clicks on submit, on postback, based on the selection the Form's action attribute should be set and the form should be submitted again automatically. We were trying to u...

How to enlarge image to normal size in ASP.NET 2.0

Hi My users uploads a picture and the picture get saved into my SQl Server Database My users view the picture on the page in a normal Image WebControl with size 150px by 150px - example can be found http://www.erate.co.za/CompanyProfile.aspx?ID=112 - the USA flag is the Image i am talking about. If the user uploads a picture of 300...

Date Time Conversion

I want to convert mm/dd/yyyy to dd/mm/yyyy. My application is asp.NET with VB. I tried following code DateTime.Parse(oldDate.ToString("dd\mm\yyyy")) But got the error: "The string was not recognized as a valid dateTime. There is an unknown word starting at index 2" Can any one give the appropriate code? ...

How to convert string to "iso-8859-1" ?

How can i convert an UTF-8 string into an ISO-8859-1 string? ...

Not able to run ASP.NET web app using Development Server

My development machine (Vista) was working perfectly fine for over a year and then suddenly (without explicitly installing anything) I am unable to run the websites using ASP.NET development server. The development web server starts fine, but IE cannot display the page: Internet Explorer cannot display the webpage Firefox says ...

how to response.write bytearray?

This is not working: byte[] tgtBytes = ... Response.Write(tgtBytes); ...

Hosting an ASP.NET page as a control within an HTML page?

This sounds like a "why would you do that?" sort of question, but here goes.. I have a very simple ASP.NET page which simply renders out a one column grid of about 10 rows with paging. At the moment, I need (due to some technical restrictions) to essentially host the ASP.NET page within an IFRAME on a basic HTML page. It works of cour...

NHibernate thread safety with session

I've been using NHibernate for a while now and have found from time to time that if I try to request two pages simultaniously (or as close as I can) it will occasionally error. So I assumed that it was because my Session management was not thread safe. I thought it was my class so I tried to use a different method from this blog post h...

How does one call method exists in a page from another page?

I'm working on a page, in which other pages are opened from it in a modal way. I need to call function exists in opener page to update certain controls in it. I'm using window.open to open another window but in this case Page.PreviousPage for opened page is null. I'm using <%@ PreviousPageType VirtualPath="~/PreviousPage.a...

Capture form post in asp.net - VS2008

I have a 3rd party submitting data via form post. I want to capture the contents of the post without actually doing Request[FormElementName"].ToString() for every element that i am expecting Is there some method/property in the Request object which would allow me to capture the entire form post? Something similar to Request.RawUrl....

What Is Your Complete ASP.net Development Environment?

I assume that the basic setup for ASP.net web development today is: Windows Vista (or XP) Visual Studio 2008 SQL Server 2005 IIS 7 The .net Framework v3.5 So, what combination of tools, addons, libraries, etc do you always install to increase your productivity and support your development? For me, it is always: Ubuntu LAMP server ...

JavaScript triggering - reflection of vb.net api calls?

Can you call a vb.net api function using reflection from javascript code? I just started playing around with reflection, I have this snippet of code that works, I want to change it to a javascript page. Dim RawPlugin As Reflection.Assembly RawPlugin = Reflection.Assembly.LoadFrom("C:\Inetpub\wwwroot\demo\MasterApplication\getSession\bi...