asp.net

how get ViewData in page load using Asp.net MVC and javascript

how get ViewData in page load using Asp.net MVC and javascript ...

Using Gridview in aspx.vb (code-behind)

Hey, I need to create a gridview based on 2 different datasources: main and sub-cathegory. And I need to list them like below: Productinfo sub-product 1 sub-product 2 Productinfo sub-product 1 sub-product 2 sub-product 3 sub-product 4 Etc... the thing is that both the "productinfo" and the "sub-product" are dynami...

How can I update the index of a Multiview with Javascript in ASP.NET?

I am trying to create a ASP:Multiview which contains 3 views. I want to change the index value using Java script, because if I make any ASP:Button then it will refresh my page, so I don't want to refresh my page and change the Multiview's index value. thanks But I want it in javascript, Because when i click at that time it will be chan...

How can I upload a file using JavaScript without a postback?

I am working on a file upload in ASP.NET. I used <input type=file id=upload> and <input type=button id="btnupload" value="File Upload"> I want to upload the file in JavaScript. The update panel does not work, I do not want it to postback and refresh the page. thanks but If you have code related to fileUpload in javascript then send me....

Server tag in OnClientClick

The following gives me an error of "The server tag is not well formed" <asp:LinkButton ID="DeleteButton" runat="server" CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete <%# Eval("Username") %>?');"> Delete </asp:LinkButton> (This is used in a data bound ListView that displays a list of users...

How to replace one value with another when comparing 2 strings?

Hi My user have a password field such as “0!ZWQ2” saved in the database. I must unscramble my User input password from “aA1234” to “0!ZWQ2” and compare it to data in a database. The 2 strings that I compare is: “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ” With “9setybcpqwiuvxr108daj5'-`~!@#$%^&()+|}][{:.?/<>,;ZWQ2...

Dynamically Generated Sentences for Multi-Lingual ASP .Net Website

We are planning on adding multi-language support for our ASP .Net Website. I understand the general process of pulling strings from resource files based on the current culture, but what is the best way to deal with the following situation? Lets say that we want to display to the user how many Stack Overflow posts they have made today. L...

What is the best ajax control to display floating windows?

Aloha, I'm looking for a floating div type of control, to display another (user)control over an aspx page, using ASP.NET and Ajax. As far as I can see the Ajax Control Toolkit doesn't have a nice overlay control. Can anyone point me at a solution? ...

Localise ASP.NET 2.0 App

At the moment, all of our localised texts are stored in resource files and then referenced using <% $Resouces:Something %>. Unfortunatly this method is not scaling too well, were getting lots of diff problems & the files are becoming rather big. Does anyone know of a better solution for localisation? Or is resource file's all I've got in...

How do I run different versions of jQuery on the same page?

My company has purchased a product that renders an ASP.NET control on the page. This control uses jQuery 1.2.3 and adds a script tag to the page to reference it. The developers of the control will not support use of the control if it modified in any way (including modification to reference a different version of jQuery). I'm about to st...

ASP.NET: Session state not updated when redirecting in explorer

I have an aspx page (page1.aspx) where I set a Session variable and then redirect to another page: HttpContext.Current.Response.Redirect("page2.aspx"); On page2.aspx I want to read the session variable, but it doesn't exist until I reload the page. I try to read the session variable in page_load. The weird thing is that it works in ...

Using Ajax method (how to do it)

Hi guys, Using an update panel in ASP.NET and with the help of a good tutorial on ListView from Matt Berseth I accomplished the image below. The behavior is, when I click the BOLD names, the rows below that name with numbers are collapsed. Getting the DATA: This is a SDK WebService that I cannot change, and with it I get the bold n...

Separation of concerns in asp.net cause hierarchy mess

I’m designing a back office web site, one that will enable administrators to manage content, products, prices and such. I have two issues I’d like to solve in a base class that each page controller (i.e. code-behind class) will extend, and these are: Storing of ViewState on disk, and User validation. Furthermore, I would like...

viewstate failing on postback

We have a web content management system (based on Sharepoint 2007/MOSS, but for the purposes of this problem, that is not relevant, so please stick around even if you haven't worked on MOSS!). On a given page, there are conditions we cannot change: An editor clicks "Edit" and the page posts back. When it reloads in edit mode, the contr...

SELECT @@DBTS using Linq to SQL

How can I use Linq to SQL to retrieve @@DBTS using C#? Here is what I am trying: IEnumerable<System.Data.Linq.Binary> results = db.ExecuteQuery<System.Data.Linq.Binary>(@"SELECT @@DBTS"); However, this results in "The type 'System.Data.Linq.Binary' must declare a default (parameterless) constructor in order to be constructed during ma...

Setting ASP.Net Role Provider Programmatically

I have a requirement for multiple Role Providers per website. What I'm not seeing is if/how to tell ASP.Net which provider to use (similar to the membership provider property on the login controls). I have a feeling that since this is done (I beleive) in an HTTP Module the role check may be occuring before the page life cycle ever begi...

Setting a css class for TD

I am using a customized user control (that I don't have the permission to modify) which renders the HTML for a table as shown: <tr> <td></td> <td></td> </tr> It lets me add any control dynamically within the tags. My question is how would I set the style of the cell for the table cell. Normally, I would do <td class="myClass">. ...

How should I design a class library to allow for IoC, but not depend on a particular container

I'm developing a class library that will be used in a number of different web applications, and possibly even made available as an open source project. There are several points where I would like to use IoC, but I don't want consumers of the class library to have to use one particular implementation. What is the best way to design this...

Using XMLHttpRequest to display a popup

I am writing an ASP.NET 3.5 web app that displays a list of items. I want to be able to display a non-modal popup with details when the user selects an item. I want to be able to display several detail popups simultaneously. (i.e., the user can click an item to see its details, then click another item to get another popup.) Currently I c...

SQL in ASP.NET - Order By sorting only one type incorrectly

I'm working on an ASP.NET application which is supposed to output detector data for a chosen interstate, sorted by mile marker. We determined the best way to do this would be sorting it by longitude (West and East) or latitude(North and South) depending on which direction it goes. Here's the query that populates it. SELECT [ShortWebID],...