asp.net

Confused over global.asax?

I have a class called Global that derives from HttpApplication. Oddly, I see a lot of methods inside Global that look like: void Application_Start(object sender, EventArgs e) { } The code is definitely executing inside this method, so the method is being called from somewhere, but where? The methods aren't marked overload? Secondly,...

Auto refresh data in ASP.Net page

I am using ajax UpdatePanel in my asp.net page, and I wanted to know can I auto refresh data in my gridview control? ...

checkbox list -javascript

Hi all.. In my aspx page i am having a checkbox list ..It has binded values from a table.. I need to validate the checkbox list ..I tried the following script var checkBoxCount = 0; var elements = document.getElementById('<%=ChkBoxList.ClientID%>'); for(i=0; i<elements.length;i++) { if(e...

httpRuntime executionTimeout value not applied

Hi, I'm working on Windows 2008R2 with IIS 7.5. In web.config there is config value: httpRuntime executionTimeout="90" Now, web request calls WCF service, which is very time consuming (timeouts for WCF are set to 5minutes). Whilst waiting for WCF to finish, web application throws exception: Exception Type: System.Web.HttpExce...

ASP.net - Simple list all users

Given a profile field I store with each user the following way: Context.Profile.SetPropertyValue("IsSubscribed", isSubscribed.Checked); Context.Profile.Save(); How would I on another page fetch all users email addresses where isSubscribed = true? ...

How unloading an application can affect another running application

Application domains allow applications to be unloaded separately. My question is how unloading an apllication can crash another application. Any example? ...

SubDomain Redirection Problem - IE

Does IE have Sub-domain Redirection Problem..... My Application has sub-domain concept. To Explain - For Example: abc12.test.in/view.aspx xyz14.test.in/view.aspx From "abc12" site, am Clicking "xyz14" site-URL, it redirects exactly with URL "xyz14.test.in/view.aspx" in new Window. But the contents corresponds to "abc12" site. Su...

ASP.NET MVC form submitted in FF/Chrome, not in IE

Hey guys, I'm going slightly insane here. I've been trying to figure out what is the problem for the past 24 hours, but I simply can't figure out what is wrong. I have an article submission framework. First the user inputs some article text fields, then he uploads 2 pictures, then he crops them. The problem occurs when I try to crop t...

How to add one month in current month?

Suppose the current month is "Oct". I want that it will add one month in current month i.e it will show "Nov". For this my code is written below but it gives exception that Input string was not in a correct format. So please correct the code? if (Convert.ToInt32(ddlMonth.SelectedIndex ) <= Convert.ToInt32(DateTime.Now.AddMonths(1).ToS...

Repeater Controls' ItemDataBound - Handle Inline or Codebehind?

Are there any differences between coding row-specific stuff inline within the repeater's template and doing so in the codebehind file in ItemDataBound? EDIT: Re: differences - I think we're all agreed it makes for markup that's nasty to read/maintain :) I was thinking of performance benefits. ...

Problem with storing file in SQL Server

Hi everyone! I'm trying to save in SQL Server DB a file. (It doesn't mutter which type of file) I use for fileContent field with image type that allow NULL. When I executed Command.ExecuteNonQuery() I'm having error-message: "String or binary data would be truncated.\r\nThe statement has been terminated." Below you may see my code: ...

dotnet json webservice for vfp program to pass data as solution?

I am searching for a solution to pass a large dataset from visual foxpro(vfp) to a .net web service. The data is personal information such as names, address, phone numbers, etc. with 7 more columns containing id's and other parameters. We tried cursor to xml dataset but the file size is very large. So my idea is to pass json formatted...

How do I share my asp.net identity with an ajax enabled web service

I have an Asp.net application with Forms mode authentication <authentication mode="Forms"> <forms loginUrl="Login.aspx" /> </authentication> I have also created an Ajax enabled web service to support a 'vote' function from the page.. <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="VoteServiceAspNetAjax...

In a repeater, how can determine the RepeaterItem of the button clicked during a CustomValidator OnServerValidate event?

I have a repeater with Remove buttons (LinkButton). Expensive database calls determine if a row can be removed (weird and not ideal, I know). In each row, I've got a CustomValidator that has a OnServerValidate event hander. The problem is that I don't know which RepeaterItem the user is attempting to remove during the multiple calls t...

Multiple ModalPopUpExtenders on one page inside a UserControl

I have 1 ModalPopupExtender inside a UserControl. Everything works great until I start adding the same usercontrol to the page. I am getting this error message in the javascript console:: Message: Sys.InvalidOperationException: Two components with the same id 'MPE1' can't be added to the application. I understand the error, it obvious...

timeout and session timeout issue

I have a problem with timeout. firstly the timeout happens every 20 minutes on server even if the time in webconfig is set to 120 mins. second, when the timeout happens it goes to the login page, which is correct but on logging back in it sometimes goes to the default page and sometimes to the page it was previously on. I want it to go...

Changing your web.config from your ASP.NET application

I need to change the database connection string in the web.config file but havent got a clue how to go about this. Does anyone have any experience with that? UPDATE Sorry, not very clear above, I want to be able to change a connection string from the web application after it has been deployed ...

Web service - method naming?

I know naming a webservice method is probably a personal preference, however I'm interested to know what you guys would name it, and why? 1: AccountCreate AccountDelete AccountList AccountUpdate or 2: CreateAccount DeleteAccount ListAccount UpdateAccount ...

asp.net required field validator for at least one textbox contains text

I have three textboxes on an asp.net webform, how/can I use a required field validator to ensure that at least one of them contains text? ...

dropdown selected value

Hi All I have a little problem. How can I select value with value id? this is my code: string actionId = new MyRptSubReportEntity().GetReportAction(this.SubReportId).ToString(); if (actionId == "0") actionId = "4"; // this.drpActionList.SelectedIndex =int.Parse(actionId); this.drpActionList.SelectedValue = actionId; but it is not ...