asp.net

Load an Assembly from Bin in ASP.NET

I have a file name, like "Foo.dll," for a library that I know is in the bin directory. I want to create an Assembly object for it. I'm trying to instantiate this object from a class that's not a page, so I don't have the Request object to get the path. How do I get the path I need to use Assembly.Load()? ...

Cache-Control/max-age always set to 0 for Anonymous users

I have blobcaching enabled on a publishing site. For authenticated users the max-age property in the Cache-Control HTTP header is set properly according the setting in the blobCache element in web.config, for anonymous users it is set to 0. This causes a lot of 304 requests by the browser trying to see if an image has changed and affec...

Duplicating DropDownListItems Without Looping

This works like a charm... loading DropDownList2 with all the items from DropDownList1 without looping: DropDownList2.DataSource = DropDownList1.Items; DropDownList2.DataBind(); But, the data from the item text of DropDownList1 is copied into both the text and value fields of DropDownList2. Is there anyway to get both the text and the...

IP check using ASP.NET Forms Authentication

I'm implementing simple authentication on an asp.net web site. Using the basic forms authentication is almost perfect: I set the auth mode to Forms and have a short credentials section in web.config, and use a simple Login aspx page that uses FormsAuthentication.Authenticate() and FormsAuthentication.RedirectFromLoginPage(). However, I...

Call Javascript from function based on condition

I have a jQuery modal system that I have built and would like to trigger the modal to popup if the username or password entered by a user is invalid. I need to do these checks from the C# codebehind in ASP, and then if there is an invalid username or password trigger my javascript function: showModal("errorDiv"). Is this possible? I do...

"System.Web.HttpException: Request timed out." errors on Response.write

I am getting an intermittent "System.Web.HttpException: Request timed out." error when my code hits the line response.write(): sMessage = "Searching...0% complete."<br> sSetVal = "&lt;script>document.getElementById('MessageDiv').innerHTML='" & sMessage & "';&lt;/script>"<br> Response.write(sSetVal) Note that Response.BufferOutput = fa...

Can I control cleaning items when user leaves the request?

Hi all. I have a page that allows uploading of multiple files, the files are uploaded constantly, i.e. there are many FileUpload controls and a submit button near each of them and it uploads immediately. I want, that once the user leaves the page and goes to another page without saving the main container (e.g. the 'item' = a product/no...

Global.asax's Application_BeginRequest is not being hit

I have a Website that is using .NET 1.1 app pool and then I also have a Virtual Directory within that website that is .NET 3.5. This Virtual Directory's contents are built with Visual Studio 2008 as a separate project. When testing, everything works fine and all Global.asax events are hit and the app goes through the execution pipe lin...

Grid View Generic Functions

currently I am using few generic functions/methods in gridview for Sorting Images and Getting Header Row in TH and merge Header Row. http://geekswithblogs.net/ram/archive/2006/07/13/GridViewGenericSortImagesFunction.aspx http://marss.co.ua/MergingGridViewHeaderColumns.aspx problem is i have to write these function for every Grid. I loo...

dissable image buttons

I am trying to compare a session variable to another string so that i can enable or disable image buttons. i am using asp.net vb with a sql2005 express backend i was using string.compare to compare the session variable sent from the login page to a string i set to "medev" which is a username in my database, if the condition is true and...

How to avoid single point of failure when using state server in ASP.NET website

In my current project, we have to create a website (ASP.NET MVC) which is likely to have sufficient load to demand a server farm. I understand that if server farm is used, session states must be stored on somewhere else such as SQL server database or state server. After some experimentation, we are inclined to use the state server mecha...

asp.net-mvc shared menu code in table

i have a page where the left hand side is a list of bulleted items and the right hand side the actual page of the selected item on the left. right now i am using a table to split the two sections. i have a seperate page for each link but i want to avoid repeating the left hand side menu code in every page so there is only one place to ...

ASP.net gridview multirow detailed header

Hey guys, I've browsed what SO gives me as possible answers but I can't find a solution to my problem. I have a gridview which should allow rows to be in edit mode. this more or less cancels out the use of a repeater I think. The thing is, the header is "special". It should have multiple rows with some cells spanning multiple columns....

Need help in gridview displaying data

Hi all, I want to display all the data in gridview which i am inserting in runtime. For that i have written code but getting this error. "Both DataSource and DataSourceID are defined on 'GridView1'. Remove one definition." protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindData(...

javascript window.parent issue

Hello everyone, I am new to Javascript and after reading related books for quite some time, I am still confused what is the meaning and what is the function of window.parent? Appreciate if someone could show me some simple samples to let me know what does window.parent mean? Thanks! Here is the code I am confused, and it is a part of J...

asp to asp.net migration

i am migrating a website from asp to asp.net. i have some asp pages that have this in them: <!--#include file="inc_search_form.asp" --> what is the translation for doing this in asp.net? ...

http redirection issue

Hello everyone, As far as I know, we can use two method to redirects http response. Using Java script window.location; Using HttpContext.Current.Response.Redirect in ASP.Net From function and end user perspective, are the two methods interchangeable? thanks in advance, George ...

Embed asp page inside of an asp.net website

i have a current asp website that i need to keep in sync but it has stuff like this: <!--#include file="inc_search_form.asp" --> i can't change this file at all as it exists in another asp website so i can't break that compatibility.. is there anyway i can just shove this same file into my asp website and have it work the same? ...

how to populate the textboxes inside a gridview from a datagrid in asp.net?

I am using a gridview in my form.aspx page. The textboxes in each row of the gridview are to be populated from a datagrid upon clicking a particular field of the datagrid. Is there any way to do the same.....? ...

how do you create a dynamic tabs using jquery?

Hi, i'm new to jquery and I like to know how to do the following: 1) Dynamically create tabs with iFrame inside 2) ability to remove tabs on the fly without postback 3) tabs are unlimited and can shrink depending on the length of the browser Sorry if this may be too much to ask, but i'd like to learn how to do this. A perfect example...