Runtime HttpException Affecting Only One Page / Usercontrol?

May 26, 2010

We're having an issue with a .NET 3.5 WebForms site where occasionally our error logs start filling up with the following error message:

"Multiple controls with the same ID 'ctl09' were found. FindControl requires that controls have unique IDs."

I know very little about the exception as I have never seen it while debugging locally and have never caught it in the error logs soon enough to run a remote debugging session. I do know that an application pool recycle fixes the issue.

This only affects a single [high traffic] page in the site. The strange thing is that the site uses the pre-4.0 ID generation logic. So, when the page is working, there isn't an html element in the entire view source that isn't some autogenerated control ID prefix followed by a the 'actual' IDs (i.e. ctl09_someID_someOtherID).

What would case a control to randomly stop being built correctly? Other than the Global.asax, how can I trap this error and force the control to ... recompile? App pool to recycle?

View 1 Replies


Similar Messages:

C# - Loading Usercontrol On Runtime And Reloading The Page?

Jan 29, 2011

On my page I have a placeholder where I load a usercontrol when I select an item in dropdownlist.

protected void ddlLoadCtr_SelectedIndexChanged(object sender, EventArgs e)
{
Control userControl = LoadControl("../AleSettings1.ascx");
plchldSettingsControl.Controls.Add(userControl);
}

If I press F5 (IE) after user control was rendered, I get IE's warning window that IE needs to resend the information....
How can I prevent it and why does it happen?

UPDATE:Maybe there is another approach? I want to load specific control (with it's markup) when user selects it from the dropdownlist.
if a postback is made the control shouldn't disappear(only if another control was selected from the dropdownlist) Everything is inside update panel!

View 2 Replies

Web Forms :: Monitor Screen Size And Resolution Affecting Page Design?

May 26, 2013

my asp net site views are different on 15" monitor than 21" screen.

site layout ruin on 21" screen however it works fine on 15".

View 1 Replies

Web Forms :: How To Add Usercontrol At Runtime

Feb 25, 2010

have one master page and one user control

I want to add and use the user control at runtime in the master page.

I have used LoadControl Method to add usercontrol but in that case i was unable in getting the tagprefix and tagname value of the user control so that i can use it on master page file also.

View 3 Replies

MVC - JSON + HttpException - Return An Error Page

Jan 30, 2011

I'm trying to return an error page indicating that the user couldnt be found and therefore I throw a HttpException with status code 404, however for some reason it wont redirect to the error page? - Is there some sort of trick to handle error pages with JSON that I should be aware of? My current code:

public ActionResult Details(int id)
{
User userToGet = _session.Query(new GetUserById(id));
if(userToGet == null)
{
throw new HttpException(404, "User not found");
}
DetailsUserViewModel userToViewModel = AutoMapper.Mapper.Map<User, DetailsUserViewModel>(userToGet);
return Json(new
{
HTML = RenderPartialViewToString("Partials/Details", userToViewModel)
}, JsonRequestBehavior.AllowGet);
}

Update - Some more code:

// MyJs.js
function openBox(object) {
$("body").append("<div id='fadeBox'></div><div id='overlay' style='display:none;'></div>");
$("#fadeBox").html("<div style='position:absolute;top:0;right:0;margin-right:2px;margin-top:2px;'><a id='closeBox' href='#'>x</a></div>" + object["HTML"])
$("#fadeBox").fadeIn("slow");
$('#wrapper').attr('disabled', 'disabled');
$("#overlay").show();
jQuery.validator.unobtrusive.parse('#mybox') /* Enable client-side validation for partial view */
}
// List.cshtml
@model IEnumerable<MyDemon.ViewModels.ListUsersViewModel>
<table style="width:100%;">
<tr style="font-weight:bold;">
<td>UserId</td>
<td>UserName</td>
</tr>
@foreach (var user in Model)
{
<tr>
<td>@user.UserId</td>
<td>@user.UserName</td>
<td>@Ajax.ActionLink("Details", "details", "account", new { id = @user.UserId }, new AjaxOptions() { HttpMethod = "GET", OnSuccess = "openBox" })</td>
</tr>
}
</table>

View 1 Replies

Change UserControl Template At Runtime?

Aug 30, 2010

Is it possible to change the ascx file used by a usercontrol at runtime?

For example in my page i have

<ctl:SampleControl runat="server" />

in the web.config I have

<controls>
<add tagPrefix="ctl" tagName="SampleControl" src="~/UserControls/SampleControl.ascx" />
</controls>

At runtime I would like to be able to change the ascx to another path, it would still be inheriting from the same usercontrol codebehind, it would just be a different template.

View 1 Replies

Web Forms :: Send A Value To UserControl At Runtime?

Dec 8, 2010

i have a User Control that have a property named Meassage i am showing the UserControl by ModalPopupExtender

how can i send a value to the property in runtime by this code i can do that

[Code]....

View 4 Replies

C# - Validating Textbox Content On Blur By Calling Server - Side Method Without Affecting Page Behaviour

Oct 21, 2010

I have a textbox in one grid-view column where upon entering a particular value and losing focus of the textbox, should post to the server to get the text validated through a server-side method. If the entry is valid, a result set to fill rest of row cells would be returned, else the bgcolor of the textbox needs to be changed to Red.

I tried posting back through the obvious way, i.e. making the textbox's autopostback as true and wiring up a server-side OnTextChanged event handler to validate the entered value.

It is working with this setup, but is also affecting the remaining page controls behaviour. For example, if I click a button in some other grid after entering some text in the textbox, the OnTextChanged handler gets called thus preventing the button's click event, which I also wish to call to execute its functionality.

View 2 Replies

Web Forms :: Dynamically Upload And Use Usercontrol At Runtime?

Oct 9, 2010

I was wondering if it is possible to upload the .ascx and .ascx.vb of a custom usercontrol into my project directory at runtime via an upload control and then after that use through a database query point my page to load that newly uploaded control via (LoadControl(<newlyUploadedControl>)?

View 7 Replies

Web Forms :: Compile And Add Usercontrol At Runtime Like DotNetNuke?

Feb 25, 2010

i think u see DotNetNuke?

you can create a usercontrol then atach it online to your website?

how i can implement this attribute for my portal?

View 3 Replies

Web Forms :: Load UserControl At Runtime And Invoke Methods Present - Dynamically?

Jun 20, 2010

How to load UserControl at runtime and invoke the methods present in that usercontrol dynamically( at runtime)?

View 4 Replies

Web Forms :: Loading UserControl At Runtime And Invoke Method Of User Control?

Jun 5, 2010

I have usercontrols which are loading at runtime in my aspx... (This part is working fine).

Now i need to invoke the methods of the user control which has been loaded..

How to invoke those methods??

like if i have 3 methods in usercontrol which is loaded at runtime:

[Code]....

Now how to invoke these methods at runtime?

View 11 Replies

AJAX :: Update Panel In Master Page Is Affecting Another Update Panel In Child Page?

Aug 4, 2010

i have my master page with one update panel working like a banner, so when the timer do tick every 5 sec

the image change. That works fine, but i have an update panel in my index page, this update panel works with some buttons that change the text inside the panel when click.

Now, the problem.

When i click one button to change the text and the banner change, the text returns to his default text. The update in master page is affecting the update on index page.

View 2 Replies

AJAX :: Multiple UpdatePanels Are Affecting Each Other?

Jan 5, 2010

On my page which uses nested master pages, I have several user controls which are in their own UpdatePanels.

I've noticed that when I update something which is in UpdatePanel 2, things are shifting slightly in UpdatePanel 1. Someone told me that when UpdatePanels are used, the page is reloading anyway. Is this true?

How do I prevent UpdatePanel 2 affecting UpdatePanel 1?

P.S. All update panels are set to Conditional in their UpdateMode's.

View 4 Replies

Is It Possible To Change This Folder Without Affecting Other Accounts On Machine

Mar 26, 2010

I have an asp.net app that uses System.IO.Path.GetTempFileName() for temporary files. In the production IIS environment (W2K3), the temp folder (System.IO.Path.GetTempPath()) points to C:WindowsTemp. But on my XP dev machine it's C:documents and settingsmachinenameASPNET emp.

Is it possible to change this folder without affecting other accounts on machine?

View 1 Replies

Update Webapplicaiton Without Affecting Current Transactions?

May 26, 2010

I need to modifiy my web applicaiton without affecting current transaction.

i will be having some modification in almost all days.

Right now " i stop my application and update the necessary files and strat the application again". Means i am loosing all transaction in between that modification.

Is there any way i can update my changes without affecting transaction.

View 2 Replies

Examine WebResponse Without Affecting The Underlying Response Stream In .NET?

Oct 27, 2010

After a call to initial HttpWebResponse.GetResponseStream() and reading through the stream, that stream is done for and cannot be reused.

I have a situation where I need to examine the content of the response and if it is of a certain data, get another page and then pass the new response down the line. Otherwise, pass down the original response as is. The only problem is that after examining the response to check for this "special data", that response is no good to the downstream code.

The only way, I can think of, to make this transparent to the downstream code, is to create a derived class of HttpWebResponse, and somehow cache the data streamed, and pass that cached stream down the line instead of the initial stream. I'm not sure if that's even feasible since I haven't looked into it further.

View 3 Replies

Web Forms :: How To Prevent An Image In A Floating Div From Affecting The Text In A Separate Div

Mar 26, 2011

I have a floating div on my page that contains an image. While everything looks ok in VisualStudio 2008, when I post the page to my server, the text in the image below the upper div shifts to the left of the div.

You can see the problem in the top paragraph at this url [URL]

<%@ Page Language="VB" MasterPageFile="~/MasterPageMain.master" AutoEventWireup="false" CodeFile="About.aspx.vb" Inherits="About" title="About Us" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />....

View 2 Replies

Forms Data Controls :: Gridview Paging Is Affecting My Sorting All?

Feb 3, 2011

I modified my gridview to include paging and it messed up my sorting.See a sample code below and it is not working unfortunately

[Code]...

View 4 Replies

MVC :: ControllerActionInvoker First Chance HttpException?

Jul 14, 2010

For the heck of it, I decided to run my ASP.NET MVC 2 app in VS2010 with first chance exceptions enabled. I noticed a first chance exception in our custom ControllerActionInvoker. It appears to be non-fatal but seems to happen frequently. Concerned this could be slowing the web app down.

[Code]....

View 3 Replies

C# - Avoid An HttpException Due To Timeout?

Apr 26, 2010

I'm working on a website powered by .NET asp/C# code. The clients require that sessions have a 25 minute timeout. However, sometimes the site is used, and a user stays connected for long periods of time (longer than 25 mins). Session_End is triggered:

protected void Session_End(Object sender, EventArgs e)
{
Hashtable trackingInformaiton = (Hashtable)Application["trackingInformation"];
trackingInformaiton.Remove(Session["trackingID"]);
}

The user returns some time later, but when they interact with the website, they get an error, and we get this email notification:

User: Unauthenticated User
Error: System.Web.HttpException

Description: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request...

The telling part of the stack trace is System.Web.UI.Control.AddedControl. Apparently, the server has thrown away the session data, and is sending new data, but the client is trying to deal with old data. Hence the error that "the control tree into which viewstate is being loaded [doesn't] match the control tree that was used to save the viewstate during the prevoius request."

So here's the question. How can I force instruct the user's browser to redirect to a "you're logged out" screen when the connection times out? (Is it something I should add to the Session_End method?)

View 3 Replies

C# - Server.transfer Causing HttpException

Apr 15, 2010

I am developing a C#/SQL ASP.NET web application in VS 2008. Currently I am using the Server.Transfer method to transfer control from one ASPX.CS file to another ASPX file. The first time through, this works. But after control is transferred to this new file it encounters a condition:

if (restart == false)
{

where "restart" is a boolean variable. After this statement it immediately transfers control back to the same ASPX.CS file and tries to reexecute the Server.Transfer method. This time it gives me the following exception and stack trace. Do you know what is causing this? I tried to read this but it didn't make much sense to me.

System.Web.HttpException was unhandled by user code
Message="Error executing child request for DataMatch.aspx."
Source="System.Web"
ErrorCode=-2147467259
StackTrace:
at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(String path)
at AddFileToSQL._Default.btnAppend_Click(Object sender, EventArgs e) in C:Documents and SettingsAdminMy DocumentsVisual Studio 2008ProjectsAddFileToSQLAddFileToSQLDefault.aspx.cs:line 109

View 1 Replies

System.Web.HttpException - Validation Of Viewstate MAC Failed?

Apr 10, 2010

I have a website(connect to active directory and pull the required details) deployed on the production web server and it is working fine from last one year.

But from last two days users are getting the following error frequently and find the error details below:-

how i can proceed on this error so that i will apply the fix in the webserver.

Error Details:

[code]....

View 3 Replies

System.Web.HttpException File XXX.has Not Been Pre-compiled, And Cannot Be Requested?

Nov 10, 2010

I ran into this error today and much googling didn't get me the answer. I have been for years now publishing this particular site by simply doing "Publish web site" and then supplying it a UNC path, then I go to the server delete the old bin and copy to the new bin folder to the live site, this has always worked except today I started getting the "cannot be requested" error for certian pages in certain directories. Everything else worked and after several attempts nothing else broke and only these same certain few pages where screwed up - there was nothing exciting about any of these pages, in fact they were part of the admin portion of the site and were very simple

View 2 Replies

MVC - HttpException Visible In View Source In Browser?

May 24, 2010

I developed an asp.net mvc application. In one of my forms, I'm getting a following
exception:

A public action method 'UpdateBasket' could not be found on controller 'App.Controllers.WebShopController'

But the funny thing is, that form submit works (even in debug mode) and finds an
ActionMethod UpdateBasket and returns View. The problem is that because of that html generated error w3c validators and google crawlers can't access the site (I think so, correct me if I'm wrong).

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved