asp.net

How to set focus on an div from a button click through javascript

I have a aspx page where in I have made a form. There is a help button on this form.When I click on the help button I have created html code in Javascript. function help_For_admin() { var Message_Help = '<p><b>Admin Page Description</b></p>' document.getElementById("help").innerHTML =Message_Help ; document.getElementById("Div...

Unit Testing Action Filters - How to mock ViewResult

I did a search on SO and looks like this question gets asked quite often. I have been able to get the mocks working and I'm also able to execute OnActionExecuted() without any issues. Here's my Unit Test. The commented lines are the ones that fail and I'm sure I'm not mocking the right type. //Arrange //var viewResult = ...

SWF to image in asp.net

Hi, I am working on a greeting card website in ASP.NET. I need to show the thumbnails of .swf files. I was generating jpg image by the IMAGETOSWF. But it didn't work in 64 bit server. I have gone through their help and tried to fix thing accordingly. But nothing worked for me. Is there any way to generate thumbnails from swf files? ...

ajax search that filters returned records

hi i want to create an search that uses ajax. here are the requirements 1)on initial page load return all search data 2)have textbox that when typed in filters out the none matching records any good tutorials out there on this forgot to mention i'm using the telerik controls, using radgrid to display the results. ...

How to create Self signed certificates

Hello I am trying to open my homepage with HTTPS in my test server. Is there a way i can create Self signed certifcates and see if https works. Please suggest me some links or any ideas with how to do!! Its an ASP.Net project and IIS V6.0 I appreciate all your help :) Thanks a lot! ...

reset user password

I have a server which has machines... I have an administrator and multiple users... these are all windows users and not present in the databse. How do i reset the user password.... i log in using the administrator and provide the username that needs to be reset.. I tried string newPassword; u = Membership.GetUser(UsernameTextBox....

System.Windows.Forms.WebBrowser inside Asp.net WebForm DocumentCompleted not fired

Hi everyone, Yeah some people would say "Are you crazy using winforms controls inside asp forms"... and I think they are right. But I would say.. "I'm not the only one!!, take a look" http://www.eggheadcafe.com/tutorials/aspnet/b7cce396-e2b3-42d7-9571-cdc4eb38f3c1/build-a-selfcaching-asp.aspx So... Doing some kind of stuff like the p...

Is there a security reason to validate a textbox input if you are limiting the max length of the input?

Since I'm new to coding and I'm trying to understand why here is a little more detail on the question. If you have a text box and you are limiting the input to say 2 charactrs do you really need to validate the input further? What I have is a text box that has a max length of 2. Is there a security reason to add a validator to the te...

Structuring of Asp.net MVC controller folders for better cohesion

When building complex applications the controllers can start to get unwieldy and very large, which may mean that you split them out into separate controllers. This may not be suitable as it will be reflected in the users experience. Ie. They will see the controller name in the URI. For example: The default project that ships with MVC ha...

How to create a extension method to sum up a column of a generic constrained type in a datatable

Is something like the below possible? public static T Sum<T>(this DataTable dt, string columnName) where T : IEnumerable<decimal>, IComparable<decimal> { return (from c in dt.AsEnumerable() where !c.IsNull(columnName) select c.Field<T>(columnName) ).Sum...

.NET date validation with jQuery

I need to do some basic validation on a date, things like validating that the date is greater than today, validating that the date is real (i.e. "99/99/9999"), etc. Basically, I need to emulate what .NET does with DateTime.TryParse. Is there anything like that in jQuery? Or would I be better off making an AJAX call to validate the date ...

downloading a Text Editor problem for visual studio

Hello fellow programmers I’m faced with an usual problem. Currently, I’m working on a site as a hobby and I want to use a text editor. The problem is I do all my work from school. Unfortunately the school uses a drive shield on all their computers. So every time you turn off the computer it wipes the hard drive clean and uses an image o...

Why won't DataBinder.Eval work

I am trying to create a simple menu system using repeaters. In the system I want to use a different formatting for class sub items and am trying to use an If that checks the DataBinders results and branches if its "Classes" but when I compile the code is says: Name "Container" not declared. On all the tutorials online and MSDN the Co...

programmatically creating weborder on target sites like digikey, mouser ...

I have a need to programmatically create a weborder (or add to cart) on the target websites where URL is known. for instance at http://in.mouser.com/Cart/Cart.aspx Flow would be as below (functional need) read from csv /xml/or different source for the parts and other info - this is not a problem invoke the target URL and add all the ...

persistence in .net forms authentication, doesn't work when machine key resents

Persistence doesn't work in my web application on one server while it does on another. On the server that it doesn't work on (a shared hosting environment), the persistence is lost anytime the app pool recycles. When it recycles the machine key changes automatically and that affects the encryption of the cookie. When the machine key chan...

Client-Side Validation in a Modal Popup?

I've got a gridview/formview, master/detail relationship going on. When I click a button in my formview (item template), I display an ajaxcontroltoolkit modal popup. On this popup there is a textbox (several, actually). I want to validate the data in this textbox (at least six digits, so far I'm using a regex validator) before I dismi...

Silver and WCF Service Behind Firewall

I have a Silverlight 4.0 (ASP.Net 4.0) application on our website for our customers once they authenticate. The program loads fine but can't talk to the WCF service created. Internally everything works great. The Silverlight application is hosted on IIS 7.5 with an internal IP of 10.1.1.8 with teh firewall redirecting the real world app...

Do I need to install SQL Express to use an MDB in App_Data

If i have a server with ASP.NET 3.5 installed, where no one explicitly installed SQL Express. Can my web application still connect to an MDF file in the App_Data folder ...

How to get a label value from web user control to a content page using master page

I have a web user control book.ascx and a formview: <formview runat="server" id="fv"> <ItemTemplate> <asp:Label runat="server" id="bookID" Text='<%# Eval ("bookId") %>' /> </ItemTemplate> </FormView> This formview is databind dynamically. Now i have a Content page Default.aspx: <%@ Register src="Book.ascx" tagname="Book" tagprefix="u...

Building an administration area to control a dynamic website

I've learned asp.net from books available on the internet, but I didn't find a good book that teaches you some techniques or logic to follow to build an administration area to control the front-end. I mean they talked about security, membership and roles. but still they didn't show you how to manage anything that's not related to a datab...