asp.net

display the selected dropdown

I am retrieving the credit card type from Database and have to show what credit card type the merchant have used, in the dropdowm. The dropdown has 4 types like Master, Visa, American Express and Discover along with select. I retrieve it well, but I am not sure how to bind it such that it has all the 4 types along with select but shoul...

ASP.NET Wizard control, how to add a step dynamically?

Code-behind: public partial class WebForm1 : System.Web.UI.Page { protected override void OnInit(EventArgs e) { var t = new TemplatedWizardStep { Title = "Lalalal" }; t.Controls.Add(new Step1UserControl()); _WizardWebControl.WizardSteps.Add(t); base.OnInit(e); } } Page markup: <asp:Wizard r...

Using themes and resources

I have a site that uses asp.net themes and it uses i18n. Some images are specified on resource file because they have texts on it. When I tried to add an item like this: <asp:ImageButton SkinID="ImbDisaprove" runat="server" ImageUrl="<%$ Resources:Images, Disaprove %>" /> I receive an error saying that it is not possible to use scr...

ListView - Show LayoutTemplate on empty data source

For a shopping cart page, the list of items is displayed in a html table. I use a ListView for that and it works great. When the cart is empty, the text 'This cart is empty' appears. But it only renders the code in the EmptyDataTemplate. My goal is to display the table headers ('delete', 'product', 'quantity', etc.) without repeating th...

ASP .Net Intranet Application How to make an Employee variable available to every page

On just about every page in the application I do something based on which employee is currently logged in. Is there an easier way to access the employee other than creating a variable in the Page_Load? ...

Static Method Confusion

I am working with Asp.NET and I have a class named PathFinder which has methods like StyleBarPath(string BrandId,string ProductId) which returns for example a combination of path including brandId and productId and also there are such methods in the same class. What I am thinking to make them static methods to invoke them easily in ever...

How to implement session Time out page to show using asp.net mvc

Hello Friends, I have this in my webconfig file... <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> timeout 2880 means how much sec or min its going to take? How to show when my session time out I need to display SessionTimeout.aspx page... Thanks ...

Asp.Net MVC2 on qualityhosting.com

Hey Guys, did anyone deployed an Asp.Net MVC2 Application on qualityhosting.com ? I see only the Homepage but the other Controllers doesnt work. Please help me ;) Thanks!! ...

MVP or MVC - Which one allows to write loosely coupled code?

Though I have gone through some articles regarding MVC and MVP, I am not able to take decision to write code with MVP or MVC pattern? Which pattern will allow us to write loosely coupled code? Can I assume Asp.Net web forms is MVP by default? ...

Logging in to HTTPS from HTTP?

As part of a master page template, several sites include a login control. Since the site is served over HTTP, I want the login control, once a successful login has been achieved, to resolve to a portal served over HTTPS. The closest I've seen to achieve this may be here, but I'm not entirely clear on its implementation. Can I get some...

Random Sorting Results in Lucene.Net 2.4

How do I sort my results in a random order. my code looks something like this at the moment: Dim searcher As IndexSearcher = New IndexSearcher(dir, True) Dim collector As TopScoreDocCollector = TopScoreDocCollector.create(100, True) searcher.Search(query, collector) Dim hits() As ScoreDoc = collector.TopDocs.scoreDocs For Each sDoc As ...

Problem with shopping cart, asp.net c#

I have built a simple shopping cart. The problem is that the first time i try to add an item nothing happens. If i click the buy button a second time an item is added. What is the cause if this problem? Thanx! .aspx <asp:Content ContentPlaceHolderID="main" runat="server"> White lily <asp:Button ID="button" runat="server" OnClick="buy_...

Is it safe to always create a new HttpContextWrapper?

I'm trying to make an existing ASP.NET web forms app more unit testable by using some of the ASP.NET MVC objects, specifically HttpContextWrapper. I've seen examples of its usage and they always create a new object. I disassembled the source with Reflector and see all it does is store the passed HttpContext. But I was curious as to wheth...

Copy and Paste from an Excel Spreadsheet to a ASP.NET Control

I would like to be able to copy one row and five columns from an Excel spreadsheet to a table like structure on a ASP.NET web form. The idea is keeping the data in the exact row and column from Excel to the table like control on the ASP.NET web-form. Then I want to be able to save to the contents of the ASP.NET control to a database b...

How to use jQuery to show a different page in ASP.NET

I am trying to set up functionality similar to Netflix. Where if you mouseover a movie - you are presented with a window of movie details (all client-side). At high level, can someone in this forum help by telling me how this should be implemented? I.E., one or more .aspx pages, what would go in code-behind, and .js file, css, etc. ...

Update panel can not find the button which trigger it.

Hi, I have a button is inside a another table(s) inside the update panel. <Update panel> <ContentTemplate> <table> <table> <Button> <table> <table> </ContentTemplate> </Update panel> I would like to add a button to Update panel's trigger. But am getting an err says "Update panel can not find the button which trigger it". I ...

Import MD5 Passwords from a PHP app to ASP.NET

So I'm in the process of writing an ASP.NET application that requires to import users from a PHP application. The passwords were hashed using MD5 into the database, so the user table records looks more or less like this: user Password user1 827ccb0eea8a706c4c34a16891f84e7b user2 e10adc3949ba59abbe56e057f20f883e And so on. I have acce...

How to place aspx-files in seperate Web Application Projects in one solution?

We have been building ASP.Net websites for many years. During this time we gathered a lot of knowledge of ASP.Net. We know what to use, a what not. One problem is still, persistently, bugging us. I hope to solve this for once and for all. We have a fairly large solution with lots of aspx-files. All aspx-files reside in one Web Applicati...

Why should I comment the following lines in my webconfig in order to work in IIS ?

I'm new to IIS 7.5 (Window 7) If while I new ASP.NET 3.5 Website target it on Local IIS , it works without any problem . But if i new a file-system ASP.NET 3.5 Website and from IIS add that website and configure it , It doesn't work . I get this error In order to work I had to comment these following lines <sectionGroup name="system...

Generally speaking, how do I implement a realtime monitoring system?

Suppose I have either an ASP.NET displaying my results, or a Silverlight client. And I'd like to show the current status of my server, or embedded device. (pretend the device reads temperature and humidity stats) How should I send the status information from my device to the front end? Should I poll the device and save the results to...