asp.net

Web.config Location element functioning incorrectly

Hi, Environment: ASP.NET 3.5, C#, Forms Authentication, IIS 6 Problem details: I have a web.config file set up with forms authentication and the following are the location element, as appearing: <location path="Home/Common"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> <...

ASP.NET grid in 2.0 having trouble with paging to retain value of check box on save button click

this is my button click code which fills the grid view protected void Btnok_Click(object sender, EventArgs e) { try { if (Page.IsValid) { int passoutYear = Convert.ToInt32(passout.SelectedValue); int courseList = Convert.ToInt32(course.SelectedValue); ...

Looping trough controls in ASP.Net C#

Hi, I have a page, which contains a table, with a couple of rows, and in that row there are checkboxes. Now the thing I want, is to loop trough all checkboxes to see if they are checked or not. This is my current approach: foreach (Control c in Page.Controls) { if(c is Checkbox){ } } Now the problem is that I receive only 2...

Lazy loading of Session variables in ASP.NET SQL Server Mode

Would like to know whether the ASP.NET Session Provider in SQL Mode, would optimistically fetch the entire Session State object (i.e all the keys and their values when we request one) or fetch them in a lazy fashion (i.e goes to the Database and fetch only the requested key and corresponding value)? ...

Using List of (T) with Lucene.net in vb.net

hello, i want to use an List to store the title, path,... from Documents. I declared the list like this: Dim MyDocuments As New List(Of Document) But i don't really know how to handle the list. i want to use the list instead of an ReDim Array. For i = 0 To results - 1 Step 1 ' forschleife zum durchlaufen der Ergebnisse ...

grid view databound event

how data bound event of grid view is used and how is it called could somebody elaborate a bit on this please i bind gridview on button click like this DataTable dt = placedStudentManager.GetPlacedStudentList(sb, passoutYear, courseList); if (dt != null && dt.Rows.Count != 0) { GridView...

Asp.net mvc 2 model binders what's behind scene

Hello, Im starting with MVC2 and i have a simple question: If i have a typed view with a form inside, and this textbox created with lambda expressions: <%: Html.TextBoxFor(e => e.Name)%> When i submit this form the default model binder take the request form, takes the model typed to the view, serialize the data posted (as a this m...

How do I selectivly print elements on a page

I have a requirement to print only part of a page. I cannot use css(media=print) to do this since I have no clue what the page contains. All the html in the page is dynamically generated. Also is there any limitation on the css properties that are recognized in Print mode. Many of my css properties like background-image are not applied...

Can I call a modal popup extender's (which is in one user control) show method from other user control?

I have two user controls. One is having a ModalPopupExtender which I need to show on a click of hyperlink button which is other user control. Is it possible? Can I anyhow call a modal popup extender's Show() method from other user control? ...

Save updated object in Generic List

Hello fellows, I am trying hard to update a business object inside a List<>. I am using a checkbox list When a checkbox list item is clicked I check if it exists, if yes I mark it as Dirty (means the user unchecks an item) If not, I add a new item to the list (means the user clicks a new item) and store it in view state How do I up...

asp.net ajax popupextender aligment issue

I have used the ajax popup in my application where one link opens a popup and from the popup, there is another popupextender that gets opened. This popup is not center aligned. Is there any way i can align this popup to the center of the screen. Note that the first popup is center aligned but second one is not. ...

NHibernate unable to load assemblies (NHibernate.ByteCode.Castle and BusinessLogic) from GAC

I was lookin all over the internet for this particular problem of mine. I found some suggested solutions but they don't work. Here is the setup: I am using ActiveRecord/NHibernate. I created an assembly wrapping ActiveRecord called the BusinessLogic. The idea is that all my projects should use the BusinessLogic instead of referencing A...

HttpContext at Handler

For protect download files purposing I created http handler liket this: public void ProcessRequest(HttpContext context) { string user = HttpContext.Current.User.Identity.Name; FilePermissionHelper helper = new FilePermissionHelper(user); string path = context.Request.Form["file"]; bool canDownload = h...

Best way to display & fade out a status message in asp.net ?

Hello fellows, I am using VSS 2005 & webforms with AJAX Control Toolkit. I am using Update panels for saving different parts of my form. Problem being I update the user with the status setting either a label or literal value. This value is visible on the form untill the page is refreshed. Is there any way to display a message and fade i...

checking if gridview has a selected item

Hi, I have a grideview and 2 buttons. I need to only show the buttons when the gridview has a selected item. My code looks like this: protected void Page_Load(object sender, EventArgs e) { btactivate.Visible = false; btdeactivate.Visible = false; //Show Activate and Deactivate Buttons only if an item in the gridview is sele...

Change UserControl template at runtime

Is it possible to change the ascx file used by a usercontrol at runtime? For example in my page i have <ctl:SampleControl runat="server" /> in the web.config I have <controls> <add tagPrefix="ctl" tagName="SampleControl" src="~/UserControls/SampleControl.ascx" /> </controls> At runtime I would like to be able to change the ascx to...

Disable asp.net button on when clicked.

I have the javascript code below which disables an asp.net button during page postback. I also have a dropdownlist whose Autopostback property is set to true. Unfortunately, when i change the selectedItem in the dropdownlist, the button is disabled. I want the Button disabled only when the page postback is caused by that same button, b...

How to programattically access GridView & DetailsView auto generated columns/fields

I have a page that contains both GridView and DetailsView each is set to generate columns/fields automatically and has a few column/fields set manually by me as well and are connected to the same SqlDataSource I would like to change the generated columns problematically before the HTML is generated. Columns/fields that are NOT auto gen...

showmodal return value problem after postback

I have a showmodal dialog that return value to a parent page. all works fins beside when i have postback in the aspx dilaog page, the dialog return null. I try adding . The problem apeear only on chorme and safari, on IE 8 and FF its work fine. Thanks. ...

Gridview text box edit

I have a textbox inside the gridview. IF i enter any non-numeric values it has to show error message. How to handle this in row edit event ...