asp.net

Optimal Method to Minify an XML in C# 3.0

Coding Platform: ASP.NET C# I have an XML like this. <Items> <Map id="35"> <Terrains> <Item id="1" row="0" column="0"/> <Item id="1" row="0" column="1"/> <Item id="1" row="0" column="2"/> <Item id="1" row="0" column="3"/> <Item id="1" row="0" column="4"/> ...

How can i reference Server.UrlEncode in an ASP.NET class?

I have created an ASP.NET class. In that class i would like to use the Server.UrlEncode. Why intellisense is not helping me at all and instead of Server.UrlEncode it displays the HttpServerUtility? I have already a reference to system.web ...

javascript onclick to select item with asp.net ListView control

I'm trying to implement a onclick event to select an item in a asp:ListViewControl. <ItemTemplate> <tr runat="server" id="MemberRow" onclick='<%#ClientScript.GetPostBackClientHyperlink(LvMembers, string.Format("Select${0}", Container.DataItemIndex)) %>'> <td> <asp:Literal runat="server" ID="LtlMember...

How do i know id of ListView item on OnItemUpdated?

I have suppliers table with id int value for each supplier. I'm trying to edit columns of this table inside of ListView. i'm trying to access e arg but it doesn't have any data on id of the row i'm trying to update? ...

a large paged GridView, Rollup and Grand Totals with SQLdataSource

If I get my dataset into a DataTable then I can do with it as I like, but I have the complexity of handling sort, paging and caching manually. I'm trying to avoid this for now. If I instead use a SQLdataSource that's all free. I need a grand total row, the contents of which I display outside the gridview. I know that I can get that b...

Which is the best platform to develop an external corporate website - .Net or Sharepoint.

The website needs to be equipped with a content management system and should provide for social media integration and localization. What are the pros and cons of each technology platform and when should we opt for sharepoint? ...

Which is the way to add MVC behavior to existing classes?

Hello, I have a Windows Form project that I would like to migrate toward a web application using ASP.NET MVC2. In this project I have some POCO classes as in this example that are part of a class library and that I would like to use with a binary reference public class Person { public int PersonID { get; set; } public string ...

Explicit __doPostBack()

Hi all, I have explicitly added __doPostBack() on Button onclientClick event . <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="__doPostBack('Button1','')"/> When I am clicking the button the Page_Load is calling twice. But if I am adding below code inside page load ,page load is calling only once on bu...

Supress HTML Validation Error in Visual Studio

I have a custom attribute that I use in various elements in my ASP.NET HTML markup. Obviously it violates the DTD, and I get a validation error from Visual Studio. I hate ignoring errors in the error output window. Is there a way to suppress this error message? For example: <label id="MyId" cid="MyCID" runat="server" /> cid is a custo...

URL handling in ASP.NET WebForms

What's the best approach to provide URL handling in an ASP.NET application to produce results similar to Craigslist. Specifically, I'm looking to handle something like "newyork.mysite.com" and "california.mysite.com", along with parameters such as "newyork.mysite.com/products/hardware". Based on the "location" (newyork.), my goal is to...

Send parameters into dynamically loaded user controls

I load the content of some User Controls into my page with the use of jQuery. So I have this function that extracts the content from my User Control, and it works like a charm. public string GetObjectHtml(string pathToControl) { // Create instance of the page control Page page = new Page(); // Create ins...

print a page with out print url of page?

I'm using window.print() to print a page. It is also printing the url of the page. How can I avoid this (using code)? ...

Error when running my Asp.net 4 application

I am getting this error, and cant figure out what the issue is. Server Error in '/' Application. -------------------------------------------------------------------------------- Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse ...

null and default values in page template

Very often i write code like: <img class="hasMenu" src="<%= (Model.Image==null)?Url.Content("~/Content/NoImage.jpg"):Model.Image.standard %>" alt="Main image" /> Is there any predefined function which could beauty this code? Something like: ValueOrDefault(Model.Image.standard,Url.Content("~/Content/NoImage.jpg")) ...

Forms authentication infinite loop

I have an application that works great on localhost with forms authentication. I deployed it to the deployment machine and it to the build machine and received and endless set of 302 redirects. I try logging onto the deployment machine and access the page via the deployment machines ip and it works again. So it is not working when I t...

wcf returning a list from wcf sservice

How is it possible to return some kind of list from a WCF service, this the method in my WCF service. My interface: [OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "Locations")] IList<Location> GetLocations(); public IList<Location> GetLoc...

How do you pass an argument in Telerik's RadListBox OnClientSelectedIndexChanged event?

How do you pass an argument in Telerik's RadListBox OnClientSelectedIndexChanged event? It seems the method you call with this event is <script type="text/javascript"> someMethod(sender, eventArgs) { var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); if (ajaxManager != null) ajaxManager.ajaxRequest("Lis...

building a website supporting many languages/cultures

I am building my first ASP.NET MVC site and this site needs to be in 2 languages. When a user selects a language from the menu, the site would present itself in that language. The content likely will be loaded all from resource files. Can I respond to a change in the culture definition at runtime so it load the correct resource file? ...

Asp.net page routing not working

I am trying to add page routing (I use regular asp.net 4.0, not mvc), so that when a user goes to: http://sitename.com/public/member/view/andrey they would get to: http://sitename.com/public/memberprofile.aspx?userName=andrey I added following in Global.asax: protected void Application_Start(object sender, EventArgs e) { RouteTab...

How to build Facebook style Ajax site

I understand that the title is a little vague and all-encompassing, so please let me try to narrow it down. What I would like is advice on how to develop a mostly Ajax website, where portions of the UI are asynchronously loaded. Here's the catch: I'd like to have the browser back/forward buttons work intuitively - something that Faceboo...