asp.net

Set "text" property to a CustomValidator in ASP.NET (Webforms)

In my .aspx page, I've a ValidationSummary where I put error messages returned by my Business Layer. The error messages appears in the summary, ok, but not the "*" that normally appears next to the field =( In the code behind, I've the following code: CustomValidator cv = new CustomValidator(); cv.ControlToValidate = field.ID; cv.Erro...

ASP.NET C# - Context.RewritePath in Global.asax Makes my site super slow.

I have multiple domain names, all pointing to the same wwwroot. www.domain1.com www.domain2.com www.domain3.com my folders look like this: /domain1-folder -->/domain2-folder -->/domain3-folder I use the global.asax as following: protected void Application_BeginRequest(Object sender, EventArgs e) { if (Request.Url.Host == "...

can i use a session variable as the text of a listitem in a radiobutton list?

I have this code <asp:RadioButtonList ID="rblSplitWeek" runat="server"> <asp:ListItem selected="true">No Choice</asp:ListItem> <asp:ListItem Text = "First" Value = "Session('s_price_1')"></asp:ListItem> <asp:ListItem Text = "Second"></asp:ListItem> </asp:RadioButtonList> But keep getting...

VB.net to C# conversion in asp.net

Hi, I am very new at this area. I have script written in vb.net but I want to convert in C# but it is not working as the vb.net code.so please help. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="2" ForeColor="#333333" GridLines="None" AllowPaging="True"> <Columns> ...

Url Rewriting in asp.net but maintaining the original url

Page aspxHandler = (Page)PageParser.GetCompiledPageInstance(virtualPath, context.Server.MapPath(virtualPath), context); aspxHandler.PreRenderComplete += AspxPage_PreRenderComplete; aspxHandler.ProcessRequest(context); When you call Page.Request.Url after this, you get the Url of the page you rewrote to ...what I'm looking for is to d...

ASP.NET MVC 2: Avoiding loop when accessing 404 action directly

Like many people using ASP.NET MVC, I've implemented my own custom 404 error handling scheme using an approach similar to the one described here: http://stackoverflow.com/questions/619895/how-can-i-properly-handle-404s-in-asp-net-mvc/2577095#2577095 (I actually discovered that post after implementing my own solution, but what I came up ...

add stuff to Master page's <html> tags from child page in asp.net?

I am trying to add xfbml code in one of my child page and i realize that i have to add this line: xmlns:fb="http://www.facebook.com/2008/fbml" to HTML section of the page like this: <html xmlns:fb="http://www.facebook.com/2008/fbml"&gt; But I dont want to add it to the master page because i am using like button on only ONE child ...

Displaying Nested Class Data in an ASP.Net DataGrid

Hey, I have a user object which consist of some data and other classes of data: [DataContract] public class User { [DataMember(Order = 0)] public int UserId { get; set; } public UserCredentials UserCredentials { get; set; } [DataMember(Order = 1)...

using HttpHandlerFactory to render CMS and physical pages

Hi, I am in the middle of writing a CMS system and after reading and working through a few examples, I have settled on HttpHandlerFactory to perform what I need. the key point is our sites are generally a mix of copy and registration processes. So I currently need to use the default HttpHandler for aspx to render the physical registrat...

One Hyperlink In Many Different Locations

I'd like to implement a hyperlink in many locations on my website, however I just want to have it defined once not several times over. What is the best way to achieve this? I started down the road of listing it in the node of web.config but I was only able to get that to list as a literal and wasn't successful in having it end up as a...

FormsAuthentication for multiple subfolders

When i tried to implement form authentication in various subfolders i am getting an error as follows:it is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. implementation in my webconfig ...

Error compiling ASMX while accessing the web service

I have a ASMX web service. When I access it from a client the ASMX get compiled but I get this error: Looking at csc.exe command line from the error detail the System.Windows.Forms asseembly is not referenced. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Ple...

Visual Studio | ASP.NET Configuration error

Hi developers! I have a problem as I have struggled with for a week. Now I give up! I really can not figure out how to solve it. Every time I open the ASP.NET Configuration in VS10, then comes the first with this error: *An error was encountered. Please return to the previous page and try again. * If I then press: How do I Use this Tool...

unknown string on ASP .net page

Hi In one of my aspx page I have a option to connect to facebook , twitter . When I load this page an unkown string like "adkadkskekkdkskdasf323dsk" is added before my html tag. something like that =========== abbfdabfdakadfkdafkdas <html> <body> </body> </html> =========== This unknown string is visible on browser. It's look...

jQuery: function not working when clicking button inside <form runat="server">

With jQuery, in (document).ready I assigned a click function to all buttons of my asp.net (aspx) page. When I click a button outside , the function works properly. When clicking a button INSIDE the form, it doesn't work. Why? Here my default.aspx page: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits=...

How to automate OpenID login with a google apps domain using DotNetOpenAuth

I am trying to implement OpenId for an internal web app. Our college is on Google Apps for Edu, so we have the suite of Google OpenID and OAuth exposed to us. I would like my login page to have the standard username and password, and additionally a button on the side that will authenticate internal users to our app domain. I have ...

How do I build a self-referencing Model Object for Hierarchical data in asp.net MVC?

Hello SO, I'm trying to understand how to build a self referencing model for hierachical data. Eventually i will be creating a category tree. I don't anything in tables yet. After I have the structure nailed down then I will create the tables. My existing Object is defined like this: public class Categories { public Int64 catID { ...

Scraping ASP.Net website with POST variables in PHP

Hi everyone, For the past few days I have been trying to scrape a website but so far with no luck. The situation is as following: The website I am trying to scrape requires data from a form submitted previously. I have recognized the variables that are required by the web app and have investigated what HTTP headers are sent by the orig...

JavaScriptSerializer to serialize a javascript function name

Hello, I am using Flexigrid in my project to add a button on the grid toolbar I can use code like this: ... "buttons":[ {"name":"Modifica","bclass":"edit","onpress":"doCommand"}, {"name":"Elimina","bclass":"delete","onpress":"doCommand"} ], ... Anyway the "onpress" attribute shall contain a reference to a js callback and ...

Where to write Database and Business logic in MVC?

Hi All, As I am learning and working on Asp.Net MVC application, I want to know that what is the better place to write Business Logic and Data Access logic in MVC. Where should I write DataAccess and Business Logic among three layers (Model, View and Controller) ?? Could anybody please tell me the correct way to write the code for thi...