Is there a way where I can actually view the name of a post back element? Below code goves me an alert but all it says is "object HTMLSelectElement". In my case it should be DropDownList3 based upon a "selectedindexchanged" event with autoppostback=true.
Code:
var pbControl = null;
pbControl = args.get_postBackElement();
alert(pbControl);
var ExecutingControl = "DropDownList3"
if (ExecutingControl == pbControl) {
alert("DropDownList3 - is the post back element");
I'm implementing a custom page caching solution and I don't want the request to be cached or retrieved from the cache if it's in response to a form submission or some sort of asp.net postback.I'm trying to figure out if the current HttpRequest is a postback. Is there a way of doing this outside the context of a page or other usercontrol? In otherwords if I'm inside an HttpModule I don't have access to this.IsPostBack but I still need to determine if it is in fact a postback.
I have 5 infragistics webdatagrid controls on page, I am using paging and sorting features for the grids. For paging to work for a grid, I need to rebind the grid on every postback in Page_Init or Page_Load event and after that page_indexchanged event gets fired.
Now, when I click on any page number in second grid, I don't want data of other 4grids to be re-bind. I just want to know which grid has done postback and bind that particular grid.
I checked out Request.Forms["__eventargument"] but its value is comma (",").
Consider the scenario for asp.net gridviews and depending upon that I'll get idea to proceed with Infragistics controls.
I have a method that takes a LINQtoSQL object and a field name and will tell me the length of that field based on the attributes of that field within the class object. I want to use this method to set the maxlength of any bound textboxes in a gridview. I can loop through all textboxes, and if the textbox created from a bound field then i can get at the fieldname ok, however if it's created from a template i can't find any way of getting to the field name the textbox is bound to (since a template isn't bound to anything). What i'm after is a way of getting the field name the Text property of a TextBox is bound to in (ideally) any case, not just the case where it was created from a bound field.
I have a web application which has rather a lot of controls. I also have several buttons (add, edit, save, cancel). Most of my content page is in an update panel so it does not process the whole page. On form submit I have some javascript code which shows a div 50% opacity and an animated gif to prevent users clicking on the buttons more than once whilst it is processing the data to the server. Here is the javascript / call:
Code: onsubmit="overlay();" function overlay() { el = document.getElementById('overlay'); el.style.display = "inline"; document.getElementById('Image2').src = "../Images/loader.gif"; } function removeoverlay() { el = document.getElementById('overlay'); el.style.display = "none"; }
The problem is it the form disables like I want it and the giff animates for about 1.5 seconds but it does not enable the form for a further 4 seconds.
Is there anyway to see what it happpening at this point. If I put some watches in my code behind it runs through less than a second so what else can it be doing.
Also on some laptops the form does not fit vertically so there is a scroll bar. When the div is shown on a submit it does not do the full screen including the scroll area.
One site would take data from the site var. C# PostBack method.But when the page's source code as submitted does not renewed. Object Can not Be Coming Referanced error. So I do post but the page refresh itself. This post has been displayed next to new data coming from the user how can I get?
I'm looking at an asp.net application, i notice that there are assemblies defined into two places. In web.config there is configuration/system.web/compilation/assemblies/add elements. In the project file there are references setup under the Project/ItemGroup/Reference elements.
I was wondering, what is the difference between assemblies/references added in either location?
This doesn't happen when I create the site in my local drive. Is there a workaround to this. Even if I add the missing parts, I keep getting the same error.
I would like to select an element that is in the same TR as another element I found with a selector. The selector itself: $("input[name='sMessageValue']","#messageTable") Now I have this element and got its value I would like to find a checkbox located in the same TR, i tried this as starting point : $(this).(':parent').val(). But seems not the right thing to do.
You're making a website with ASP.NET 4.0/C#, although xml alone is suitable for this example. The site will have a site map and a default page with a menu control, as follows:Web.sitemap
Element 'content' is not a known element. this can occur if there is a compilation error in the website, or the web.config file is missing.
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Content --- showed a green wavy line , and on hover displayed the above error.
Now I am having certain problems.
1. Visual Studio 2010 hangs when I try to use ToolBox.
2. Intellisense for asp.net controls is not working.
I have tried replacing web.config file (frm backup) , tried to debug - it doesnt show anything.
All other websites are working alright. Have problem with only one of the websites.
I upgraded from VS 2008 to VS 2010 and now the AJAX elements are not recognised by the source code editor, e.g. UpdatePanel, ScriptManager, etc. I get warnings in VS and no intellisense for those elements. When I run the site, all the AJAX controls work OK though.
While writing some web apps with VS2008 there are times I have to do a postback. Such as when I select a certain value in a dropdown, I have to load new data an another dropdown. Well, I was reviewing a web site already written by another company and they did the same method. But when the second dropdown was reloaded with data, the page did not reload. How are they doing this? I owuld love to not have the page reload if possible. All I could think of is they are possibly using javascript maybe to do this?
I have a datasource that is connected to a stored procedure and I need to do a postback on the web page but do not want the sqldatasource to do a databind. What I am doing is when I change a dropdown box to fill in some textboxes with specific dates, I do this on a postback so the textboxes are filled in with the dates. But the SQLDatasource control data binds again and shows new results in my gridview.
Is there any way to prevent this so I can just postback to fill in the textboxes?
I'm having a problem with entering edit mode in Gridview. When I click edit, it shows it in normal mode (labels) even though RowCommand does successfully fire.
But I have to click it AGAIN to get it to show the TextBoxes of 'Edit' mode.
How can I fix this? Is there a way to force a 'postback' on the entire page, or re-render a control? (i'm assuming thats the problem)
Here's the pseudo code:
GridView1_RowCommand(....) If e.CommandArgument = "EDIT" then GridView1.EditIndex = 5 End IF End Function
A click of the 'edit' button returns the gridview with the normal labels. Then when I click it again, the TextBoxes show up.
On my form I have a button that pops up a panel to select an option from. It does a postback to fill in a textbox with the selected data. The other controls such as other textboxes and dropdowns are reset. Any way to stop this? Or do I have to save the settings and set it back on the postback?
I am using an AJAX extender on a panel that lets me expand and collapse a panel when I click a button. Does anyone know how to collapse a panel by code without doing a postback? I looked at the properties and methods on the ajax toolkit page and either it is not possible or I am missing it. Actually there is a postback on what I am doing - I forgot. But the page comes back with it open still.
I got this errors while trying to use an example from the ASP.NET 3.5 Unleashed book.
Webform1.aspx
[Code]....
LengthValidator.cs
[Code]....
As from the book's note, I think I added this line correctly:
[Code]....
However, the compiler kept complaining that:
Warning 1 Element 'LengthValidator' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. C:Visual Studio 2010 ASP.NET ProjectsWebApplicationFourWebApplicationFourWebForm1.aspx 16 17 WebApplicationFour
I am using dotnetCHARTING: the dll is installed in the GAC and referenced in my web.config (all versions appear to match). The project has a reference to the dll.
The site code compiles ok, but all aspx pages using the charting library complain that the Chart tag does not exist (warning that it might be a compile error). The aspx pages do not render the charts.