asp.net

ASYNC postbacks happening when SupportsPartialRendering is set to false.

We're getting a confusing error on two of our pages in our ASP.NET application. Both pages originaly had tags to reload the page every so often if a user sat on it for a while, but opted to remove those in favor of some AJAX flavoring. Specifically, we created timer controls on the page and wired the timer's tick event as a trigger for ...

MVC Rendering (RenderPartial, RenderAction) Html from another MVC Application

I am working in an environment with many teams who are responsible for specific content on pages. Each team is sharing specific information (common class libraries, and master pages) that each are going deliver different types of content. Is it possible for an MVC application to do something similar to RenderPartial and pass a model to...

What's wrong with this linqTOsql self referencing object mapping?

Hey there, I'm trying to create a self referencing object using linqTOsql mapping. So far, I am definitely in over my head. Here's the code I have: [Table] public class Category { [Column(IsPrimaryKey=true, IsDbGenerated=true, AutoSync=AutoSync.OnInsert)] public Int64 catID { get; set; } public Int64 parentCatID { get; set;...

unrecognizable code in classic ASP; need .NET conversion

oXML = Server.CreateObject("Msxml2.DOMDocument.4.0") oNode = oXML.createElement("CommonCustomerSearch") can someone explain what the lines of code above are doing? i'm more interested in the first line as the method it is written in exits when it hits that line, so apparently the variable oXML isn't being set. i know that oXML is supp...

ASP.NET: how to register control implemented in another assembly

I have own control implemented in "CommonControls" assembly (the same namespace). It us 'Custom control' inherited from 'WebControl' class and implemented without ascx file. It is necessary to use this control in "main" web site. Could you please advise how to register this control? I know it should be something like this: <%@ Registe...

How to find control in CommandItemTemplate for RadGrid

Hi All: I'm using RadGrid from Telerik with three LinkButton controls in CommandItem , and i want to hide or show them using switch statement at code behind. <CommandItemTemplate> <LinkButton runat="server" ID="approveAllLink" Text="Approve All" > </LinkButton> <LinkButton runat="server" ID="approveLink" Text="Approve" > </...

How to change HTTP protocol for HTTPS on a MVC2 application???

I have an application developed on MVC2 but I need it to change from HTTP to HTTPS after authentication. How do I manage that and where do I have to put the code? Thank you, Ignacio ...

Why does the DefaultModelBinder not bind to Char properties with value of " "c

I have a class like Public Class Task Property DuplexType As Char Property Name As String End Class In my controller I have an action that looks like <HttpPost()> Function Edit(ByVal task As Task) As ActionResult Dim duplexType = task.DuplexType Dim valid = ModelState.IsValid Return RedirectToAction("Index") End ...

ASP.Net without codebehind

Hello there, I would like to create an ASP.Net page without all the codebehind and designer stuff. Basically I want to go back to ASP classic, but keep the CLR and Base Class Library that makes .Net oh-so-wonderful. I'd like just a page something like this: <html> <body> <div> <% int customerID = Request.QueryString["Customer...

Get Absolute URL from Relative path (refactored method)

I am really surprised that there is no native .NET method to get an absolute url from a relative url. I know this has been discussed many times, but never have come across a satisfactory method that handles this well. Can you help fine tune the method below? I think all I need left is to auto choose the protocol instead of hard coding i...

Is there a jQuery technique to select all the page controls/divs with a non-zero scrollbar position?

Is there a jQuery technique to select all the page controls/divs with a non-zero scrollbar position? I'm trying to solve a problem faced by many; essentially after a partial asp.net postback all the controls/divs that had a scrollbar with a non-zero value (ie: were scrolled down to some position) are reset to the zero (top of the scroll...

Runtime resolution of asp.net webforms routes

I am trying to create dynamic routes using .net 4.0 WebForms. Imagine I need mappings like these: mySite/Canada -> country.aspx mySite/Canada/Ontario/ -> locality.aspx mySite/Canada/Ontario/Toronto -> town.aspx mySite/Canada/population -> country.aspx mySite/Canada/history -> country.aspx mySite/Canada/Ontario/weather -> locality.aspx ...

Forcing SSL (https) on a page by page basis

How can I set up my page load event in my code behind to redirect to an url that has an https prefix? I would need it to work with urls that have query strings attached too. It's one thing to construct a link that goes straight to the https page, but I don't want the user to be able to manually change it to an http page. Also I don't w...

ASP.NET/XML: Convert XmlDataSource to HTML?

How can I parse an remote xml file with XMLDataSource to HTML? Xpath? Can someone show me a quick demo please? Thanks! ...

Possible to stop ASP.NET event using jQuery/javascript?

I have some code like below in an aspx page: ... function CheckEditing() { var answer = confirm('You are currently editing an item. If you continue to the next page your changes will not be saved. Would you like to continue?'); if(!answer) { return false; } ...

I cannot save a file in the root of the server

Hello I am using asp.net 3.5. And i am serializing an object in server, I rent a hosting and i want to modify something in a dinamic way with XML, This is my code : Stream writer = new FileStream(Environment.CurrentDirectory + @"\public_html\" + nombrearchivo.Text, FileMode.Create); serializer.Serialize(writer, p); this is m...

ASP.net/jQuery: JSTree, selecting Node, can't seem to get ID

Currently, I'm using an AJAX Handler to populate the JSTree: $(function () { $("#jstree").jstree({ "json_data": { "ajax": { "url": "AJAXHandler.aspx?action=GetMenu" } }, "plugins": ["themes", "json_data", "dnd"] }) .bin...

Leveraging ASP.NET machineKey For Encrypting My Own Data

I have some data I want to encrypt in an ASP.NET MVC application to prevent users from tampering with it. I can use the Cryptography classes to do the actual encryption/decryption, no problem there. The main problem is figuring out where to store the encryption key and managing changes to it. Since ASP.NET already maintains a machineK...

firefox & object moved to here

We have an asp.net website that uses a flash movie to do HTTP file uploads, it works seamlessly on IE. When using firefox, it fails to upload .. HTTP debugging revealed that the page we are posting to returns the following: HTTP 302 <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="%2fproject_name3%2fDef...

Issues creating an inherited button that can cancel a submit (ASP.NET)

There are no errors with my Javascript. The Javascript returns false, and the form is submitted. Additionally when setting UseSubmitBehavior to false the form still submits. What am I missing to prevent the form from being submitted? // DerivedButton.cs public class DerivedButton : System.Web.UI.WebControls.Button { public DerivedB...