asp.net

Debugging ASP.NET Session Variables

when the process run in the same browser, it's easy to open a new TAB and check the session variables there, everything works fine in this situation. But when a webpage runs inside a WebBrowser Control (under Windows Forms) for example, I can no longer get any Session Variable that process is using. Does anyone have an idea on how t...

add item to drop dwon list visible but not avialable for select (only show as Title)

How I can add item to drop down list and make some of them visible but no body can select it? ...

how to create a dynamic grid view and a drop down box in its header

how to create a dynamic grid view and a drop down box in its header ? where should this be called like in page load ? where should the events be handled ? ...

Silverlight SSL and WebService

I have recently modified my web service in IIS7 to use SSL. To do this, I have created a self signed certificate and applied that to my web service. I then added https bindings to my site in IIS. I have changed my clientaccesspolicy.xml file to allow https -> <domain uri="https://*" /> Whenever I try to call my service from my SL sit...

Can't keep custom attributes in DOM?

A very simple asp.net webform page. <asp:DronDownList id="ddl" runat="server"> <asp:Button id="btn" runat="server" Text="Do nothing but post back" /> In Page_Load: if (!IsPostBack) { ListItem item = new ListItem("text1","value1"); item.Attributes["custom"] = "CustomValue"; ddl.Items.Add(item); } The html it renders:(which ...

converting a DetailsView TemplateField cell value to short date string

I have a detailsView whose date values in a cell are currently being displayed in longDateFormat, i want to convert all date values in this DetailsView to short date. For example, instead of 6/1/2010 12:00:00 AM, i want to display just 6/1/2010 For a Gridview, i can achieve that by the code blow Protected Sub DetailsView4_DataBound(...

default value in asp.net server control

I have a problem with the default value attribute. When I add my control to page at design mode, default value does not work. This is my code: [DefaultProperty("Text")] [ToolboxData("<{0}:KHTLabel runat=server key=dfd></{0}:KHTLabel>")] public class KHTLabel : Label ,IKHTBaseControl { [Bindable(true)] [Category("Appearance")] ...

get textbox Array from asp.net mvc generates page

Hi guys, My problem is that i have a dynamic loop in which i generate 5 textboxes and now i need get the data of each index because i want to send by in a array to the controller. Can anybody tell me how i get the values from the textbox arrays. All textboxes have the same name and id but they have an index. ...

Avoid page flickering when updating a YUI DataTable

I am using jlinq a library for extending linq to json and hence i filter my json data. Consider i have a json data that draws a yui datatable on page load with 100 rows. I am doing a clientside filter which will reduce my json data and i am now redrawing the same datatable. What happens is it works pretty well but with an annoying flicke...

c# Can someone explain this boolean logic

// Example bool is true bool t = true; // Convert bool to int int i = t ? 1 : 0; Console.WriteLine(i); // 1 This converts false to 0 and true to 1, can someone explain to me how the t ? 1 : 0 works? ...

Is there any other way for email validation in .net?

I'm using a form which ask for email address. I used regular expression for it as .*@.*\..* But it is not working fine for some of my test email id like dsrasdf@@@[email protected] Any one provide me regular expression for the email validation in asp.net or can i use any other method for it. Please give your suggestions. ...

How to get the List of ContentPlaceHolders of a MasterPage on code-behind?

I need to get the list of ContentPlaceHolders of a MasterPage, but the property protected internal IList ContentPlaceHolders { get; } is protected internal, so we can't access them. Is there any way we could pull them up from the MasterPage (including Reflection)? Thanks. ...

Declare variable in C#

Possible Duplicate: Use of var keyword in C# Hi, I am pretty new in C#, I would like to know the best practices in declaring variables. I know it is possible to use VAR (explicit declaration) or the DataType when declaring a variable (implicit). I would appreciate your opinions thanks ...

web service not running from aspx page but running fine with ashx page

Hi, I have a web service which is running fine when i call it from a handler page (.ashx). My web service returns a zip file. But when i call the same code from my aspx page then i get a corrupted zip file. Code for calling is below and is same in both ashx class and aspx page. Please advise Dim service As New doc() Dim b() A...

Access all list DropDownList controls in Asp.net

Hi, I have page which has many DropDownLists. I want to access them all with foreach I had found some codes but they didn't worked for me. Some of them are having page.controls etc. I have using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI.WebControls; using System.Web.UI; Clas...

Mixing Ruby on Rails and ASP .Net

I’ve scoured the Internet via Google and could not find if it is possible to host ASP .Net and Ruby on Rails on the same server! Do you know if it is possible? If not, would I be able to do this? – www.abc.com – redirects to Page A (hosted on Ruby on Rails server) – jobs.abc.com OR www.abc.com/jobs - redirects user to Page B (hoste...

Encrypt user password with jquery and decrypt it with C#

Hello every body, I don't want to use SSL to encrypt signup and signin forms for a website i'm building. I dont have money to pay for a certificate. I need to use enryption with jquery and decryption with C# in my asp.net website. Does someone have an example and how is it secure to adopt this method? ...

ASP.Net GridView with Dropdown List

Hi, As my previous question didn't seem to have much popularity, I decided to change completely the way I approached the problem. Now my issue is that I still have TABLE1 with a foreign key FK, but what I want to do now is have the FK column in the GridView display Dropdown Lists. The Dropdown Lists should have their Text property bound...

ASP.NET MVC Update Address Bar With Ajax Link

Hello, I'm trying to create an ajax-driven gallery where each photo in a sequence is loaded with an Ajax.Actionlink. The user can get to any given photo by passing a parameter to the action method, eg: Gallery/Index?photo=100 The problem is that when the user is cycling through photos with the Ajax.Actionlink's the URL is no longer be...

Performance Tips try/catch blocks

Hi Guys, In ASP.NET I would like your opinion regarding what is the best way for Handling Exceptions. Would you suggest to use try/catch blocks? Better to use try/catch blocks on every single piece of code/component? Or in wich situations? I am new in dev, I really appreciate your help thanks! ...