Losing Most Of The Page Content On Second Postback?
Jul 5, 2010
I have a form with a update panel. This posts the form and validates it. Returning a errorMessage string of any invalid field such as "Field xyz is a required field, Field abc needs to be a quantity"
When I enter incorrect date it posts back fine and displays the text in a div at the bottom of the page which the update panel is aimed at to update. (and only this it should be changing)
This works but the second time I hit say (say i enter invalid data twice) the Complete form will disappear leaving me with just the banner of the site and the error message that is returned.
Ive tried commenting out the entire of the code post back so that the button doesn't actually do anything but it still has the same problem(of course this time it wouldnt have a error message created)
So i can only think it is something to do with the updatepanel itself and how it works but i have been staring at this for ages and have no more ideas!
View 2 Replies
Similar Messages:
Aug 26, 2010
I'm using Request.PathInfo to response.redirect as user to a different page ( based on the content after .aspx ). It redirect just fine however, once redirected, the page loses all content from the master page and the CSS link.
View 6 Replies
Jan 4, 2010
I am building a website in which all of the site layout is in Master page and the content of the site is in the inherited pages. I have various links for navigation in which i simple use Response.Redirect to transfer to different pages. Now the problem is that I want to put the content place holder inside Ajax Update panel so that the postbacks are Asynchronous and I want to show the postback by an animated image inside Update Panel progress control. The problem is that I am unable to achieve this result and the entire page is posted back and rendered again. I have placed the content place holder inside the Ajax control toolkit's Update panel but it does not work. Is there any way that I can change the content of the content place holder to a new page with asynchronous postback.
View 9 Replies
Sep 1, 2010
I have been using session variables in my asp.net application for passing the next property:
[DefaultValue(true)]
public bool IsModificationMode
{
get
{
return (bool)Session["ModificationMode"];
}
set { Session["ModificationMode"] = value; }
}
In the PageLoad, I set it's value.
Now after the Postback, I am losing it's value having a a NullReferenceException
View 4 Replies
Jun 9, 2010
In a page I have a link; clicking on it opens a dialog and sets a textbox value for that dialog.
However, once I click on submit in that dialog, the textbox value is null.
Link:
<a href="#" onclick="javascript:expand('https://me.yahoo.com');
jQuery('#openiddialog').dialog('open'); return false;">
<img id="yahoo" class="spacehw" src="/Content/Images/spacer.gif" /></a>
[Code].....
View 2 Replies
Feb 19, 2010
I have an upload control (csv file) of which I use the stream to retrieve data in a datatable that I then bind to a datagrid, sitting in a repeater control.I have to bind more than one record to the repeater, therefore I need to find a way of storing the stream for each binding, so that I can bind it to the datagrid again, via itemdatabound event of repeater.
I have tried storing the stream in the repeater's datatable but on each postback, the content of the stream gets lost. The stream still exists, but its length is set to 0.I have tried storing it in a session object, but again it is reset to 0.
I have tried using viewstate but I get a xmlserialization error. Saying IXmlSerialization is not implemented.I am desperate to find a work around as I am feeling the pressure at work.
View 3 Replies
Jun 7, 2010
I have a ascx page where I am using a hidden field to store the value of a the drop down box as it is generated using a google address finder. My problem is that when I try to store the value directly in the hidden field :
hfDdlVerifyID.Value = ddlVerifySS.SelectedValue;
in the event of a button click, the value is stored but on postback is lost again. Whereas, if i try to use Scriptmanager to do it, nothing is stored.
getBuild.AppendLine("$get('" + hfDdlVerifyID.ClientID + "').value = $get('" + ddlVerifySS.ClientID + ").value;");
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "storeHidden", getBuild.ToString(), true);
// Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "storeHidden", getBuild.ToString(), true);
string test = hfDdlVerifyID.Value.ToString();
[Code].....
View 1 Replies
Mar 27, 2010
I am in beginner level on developing web pages. I was coding on desktop applications and as you know it is easy to say that web applications are extremely different than desktop applications.
I wonder why data are lost between postbacks.???? And what is the best way not to lose the data belonging to a specific control (especially gridview). Session or viewstate or anything else?
View 10 Replies
Dec 13, 2010
Never had this happen before. I just upgraded my site from 3.5 to 4.0. Here's the scenario:
1.) I have a literal on a web form, in an UpdatePanel.
2.) On PostBack, the Literal's "Text" property loses it's value. The ViewState is enabled throughout the page. Further, I changed the Literal to a label and it also has this problem. The TextBox's appear to keep their values.
3.) If I remove all of the Ajax controls (which currently is just the UpdatePanel and the ScriptManager) then the Literal control keeps it's value through PostBacks.
4.) There is no client side JavaScript where I'm manually changing the values of these controls. They are only editted in the server side events.
I have read that setting the AutomaticDataBind property in the web.config could remedy this but I can't find any documentation on it and I don't know where to put it in the web.config to even try it.
View 7 Replies
Nov 19, 2010
I am using the AJAX Contol Toolkit and 4 CascadingDropDown extenders with an ODBC connection in a Web Service. The original load of values in each level works great. I then use these values to set the create the SQL for the SelectCommand for a Gridview.
The problem I am having is that when I submit the page to perform the search, the first 2 dropdowns repopulate and set the selected index accordingly, but the 3rd dropdown does not retain its selected value. It does populate with the values, but the selected value does not get set.
The correct values are available for the SelectCommand which returns the correct values.
View 1 Replies
Jul 3, 2010
Private Sub UpdateOffensiveStats()
Repeater losing data on postback
View 2 Replies
Feb 14, 2011
I have two radio buttons that are disabled with javascript when the page loads. RadioButton1 is checked by default. When I click the button to do a postback, the RadioButton1 is no longer checked.
Here's my code sample. The code behind is empty.
<asp:RadioButton ID="RadioButton1" runat="server" GroupName="group" Checked="true"/>
<asp:RadioButton ID="RadioButton2" runat="server" GroupName="group" />
<asp:Button ID="Button1" runat="server" Text="Button"></asp:Button>
<script type="text/javascript">
window.onload = function () {
var RadioButton1 = document.getElementById('<%= RadioButton1.ClientID %>');
var RadioButton2 = document.getElementById('<%= RadioButton2.ClientID %>');
RadioButton1.disabled = true;
RadioButton2.disabled = true;
};
</script>
View 4 Replies
Feb 1, 2011
I have a simple asp:RadioButtonList within a form tag but for some reason it isn't keeping it's value on postback
Here's what I've got
[code]....
View 3 Replies
Apr 27, 2010
I am creating a ASP.Net server control to manage locations. The control is a composite control containing several text-boxes, labels, and a link button. I use the AJAX Control Toolkit to provide a modal popup which contains a Bing map. All the Javascript is in its own file and used as an embedded web resource.
The link button is what opens the modal popup. It also needs to call a Javascript function that initializes the Bing map (onclick = "GetMap();"). There are instances when this server control is placed within an Update Panel (and there is no way to avoid this). When in an Update Panel the link button loses its onclick event. I understand that this is because during an async postback the portion of the DOM that defines the content of the Update Panel is thrown out and reinitialized, resulting in the event breaking. When the control is not in an Update Panel everything works as intended.
I have tried registering events on Page.Load and Page.Init, like so:
[Code]....
I have also tried flat out writing the function call to the page:
[Code]....
I have put breakpoints on the lines inside each delegate and they do not get hit. I am not aware of any special way to register events of a composite control's child control or the Page.Load/Page.Init events when being done inside a server control. Is there some special way to register these events? (Note: Both those code blocks above are in my CreateChildControls() method)
Below is the GetMap() Javascript function. As you can see it is pretty straight forward.
[Code]....
View 3 Replies
Nov 3, 2010
i have a global field called hotelId. i then have this piece of code that gets a value from gridview row:
[Code]....
the local variable is assigned to my global one, which gets passed to my method along with other variables. while stepping through i can see the value is set, but when i hit the submit button variabl is passed to another method except my hoteId. it gets lost...
View 3 Replies
Feb 23, 2010
I am building a composite server control that currently only has a TextBox and a DropDownList. Here is the code in all its foetal glory:
[Code]....
The control appears to work correctly across postbacks, that is until declarative values are set, e.g.:
<squee:Address runat="server" ID="a" Street="123 Fake St" State="VIC" />
After this, the text box continues to work correctly, but the _state member does not pick up the posted back values and instead just sticks to the declared value. I've checked the raw posted values in the Request object, and the new value for the list's UniqueID is there, but _state doesn't pick it up.
View 1 Replies
Feb 25, 2011
I have a textbox that uses TextboxWaterMarkExtender and jquery-ui's datepicker plugin.Upon postback, my textbox is losing the value selected from jquery datepicker.Below is the sample code to see the behavior. Is there anyway I can make my textbox to retain selected value on postback?One thing to note is, if I use jquery watermark plugin, it does postback the value. But for certain reasons, I think I plan to use AjaxControlToolkit.
[Code]....
View 2 Replies
Jan 30, 2011
How to prevent the content of the UpdatePanel from the PostBack which is occurred in the whole page ?
I have the following code:
<head runat="server">
<title></title>
<script type="text/C#" runat="server">
// I don't want it to call this event handler
[Code]....
The previous code will write in the TextBox2 in spite of it exists inside an UpdatePanel with Conditional for UpdateMode.
I want it to update only when I call UpdatePanel1.Update();
View 2 Replies
Dec 29, 2010
This has been a nagging issue for some time, but very sporadic and difficult to isolate.
From time to time, browsers that have authenticated on a web application, have been open for a while, have logged in and out of the same web application multiple times, have multiple tabs, are pretty much any browser (Chrome, IE, Firefox, Safari), and seemingly at random, lose their ability to retain an AuthCookie after being set and followed by a redirect. Closing the browser and starting a new session resolves the issue, as does opening up a different browser and attempting to authenticate.
Our team uses forms authentication for all of our websites and web application. This is a pretty typical setup where a login form is displayed, the user enters credentials and a cookie is set on the click event of the postback, then a redirect occurs to the same page where the cookie is then referenced and used to complete authentication.
In this situation
FormsAuthentication.FormsCookieName = ".WebAuth"
Within Event:
FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, Username, DateTime.Now, DateTime.Now.AddMinutes(SessionTimeout), false, Username); HttpCookie faCookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(authTicket));
Response.Cookies.Add(faCookie);
Response.Redirect(Request.RawUrl, true);
After the redirect, on PreInit:
HttpCookie authCookie = Request.Cookies[cookieName];
At this point, the authCookie variable is typically not null, but in these isolated circumstances that I've outlined above, the cookie comes back null after the redirect.
This happens very randomly, sometimes weeks before affecting one of our developers. As I said, restarting the browser resolves the issue.
Today I had it happen on our dev server while using Chrome. I had logged into the application, allowed the application to session timeout, and then attempted to login again. The attempted login then failed to set the cookie. I remotely attached Visual Studio to the process on the server to begin debugging. The entire time I could step through my code, even deploy new code versions to the server with updates, restart the app, restart IIS on the server, attach and reattach to the project, and the issue persisted in Chrome. In Firefox, I was able to authenticate without issue.
From Chrome, the login would validate, attempt to set a Response Cookie as outlined above. Prior to redirect, I could see the properly set Response Cookie, as well as its counterpart in the Request Cookies. However, on each redirect after a seemingly successful login, the Response and Request Cookie are gone.
I enabled Trace on the application to view the cookie collection:
There is a .WebAuth in the Request Cookies Collection, as well as ASP.NET_SessionId and several ASPSESSIONIDxxxxxxxx, but when the page loads, only the ASP.NET_SessionId and ASPSESSIONIDxxxxxxxx cookies are available in the Request.Cookies scope, no sign of the .WebAuth. However, in the page's Trace information after render, there multiple .WebAuth cookies listed, it is just that the page seems to have no access to them.
Primarily, on a working version after authentication there is both a .WebAuth Response and Request Cookie in the page's Trace info. But on a non functioning browser window, the Response Cookie is absent.
Has anyone else had any experience with this? It is such a nagging issue, and so sporadic, but I would love to be able to resolve it. My concern is that it may be affecting users and we would have no knowledge since the description of the issue is so convoluted.
View 1 Replies
Nov 24, 2010
I've created loads of user controls, but this is my first time dealing with extending a server control. The problem I'm getting is that the base control's data is not being persisted across postbacks in a Master/Content page.I'm actually trying to get this working using a Telerik control (for my sins), but the same issue happens with a standard Web TextBox control. Code:
[Code]....
Now, I've copied the way I handle the control state as I do it with user controls (ControlState), and it isn't working. Can someone point me in the right direction please? All the examples I find refer to creating user controls, not extending existing controls. Specifically why nothing is being persisted on post back.
View 7 Replies
Oct 6, 2010
My project has the following repeater menu shown on the Master Page. I need this menu to remain hidden until the user logs in. How do I access from content page?
[Code]....
View 2 Replies
Mar 22, 2010
I'm using this Ajax script [URL] to load content from an aspx page on another server than the page calling the content. So far I've learned that this is a no go. The problem seems to be that when using an absolute link to content the script fails as apposed to using a relative link.
I've searched the web for about 10 hours now, and I still haven't found what I'm looking for.
View 2 Replies
Jun 25, 2010
which page need to be checked. Master or Content. I dont think there is anything wrong in the content page.
View 1 Replies
May 12, 2010
So to pretty much make this short and sweet, I have a page variable defined outside of all my methods and functions called buttonpressed. It is used to keep track of which button has been pressed on the app. For example, in the onclick event of my Edit button there is a line:
buttonpressed = "Edit"
I use this to decide what kind of query to perform to my database. My problem is whenever I hit my save button(which uses that buttonpressed value in an if statement to decide what query to perform), the variable value just magically disappears.
I tracked the value to make sure that it is being changed and store correctly based on my add, edit, and delete buttons. As soon as I hit my save button, the value of that variable goes blank.
View 2 Replies
Jan 24, 2011
On my page I have some text boxes that users can enter values in. The first time they submit the page it gets the values from the text box fine. But when the user goes back using their browser back button and changes a value and resubmits, it shows the value from the first time they submitted, not the new value they just entered.
View 6 Replies