UpdatePanel does not fire on first click of link button - ajax

I have an update panel on an .aspx page. Within this aspx page I have a few ascx controls. One of the controls has my link button. When that button is pressed I'd expect to get the results I intend to get, but I expect to not see a page flicker or see the page postback. It does both. After I change some search information and click the link button again the page does an async postback (which is what I expected on the first click). After running this sequence through fiddler I see that the first time I click the button I am missing some information that is included in all subsequent requests.
ctl00$ScriptManager1=ctl00$cplContents$updatePanelOrderSearch|ctl00$cplContents$ucOrderSearchControl$btnRange&EVENTTARGET=ctl00%24cplContents%24ucOrderSearchControl%24btnRange&.....
Above is what I get on clicks 2, 3, etc.. This is not in the request when I click on the link button the very first time. Im wondering if this is why I am get a full, non async postback the first time.
Any help would be appreciated. My update panel code is below.
<asp:UpdatePanel ID="updatePanelOrderSearch" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
<ContentTemplate>
<uc:control1 "this control has the link button" />
<hr />
<div id="SearchResults">
<div id="SearchResultsMessage">
<asp:Literal ID="lblMessage" Text="No orders found" Visible="false" runat="server" />
</div>
<uc:contorl 2 />
</div>
<uc: control3 />
</ContentTemplate>
</asp:UpdatePanel>
Thanks

this was an issue from months ago and we wound up not using this solution

Related

Load-On-Demand data bound controls in RadPageView when they are selected by RadTab

In my webpage, I have a RadTabStrip containing RadTab:s which will decide which page view the webpage that is shown.
<telerik:RadTabStrip ID="rtsTabs2" runat="server" MultiPageID="rmpMultiPage2"
AutoPostBack="True" SelectedIndex="0" OnTabClick="rtsTabs2_TabClick">
<Tabs>
<telerik:RadTab Text="Page 1" PageViewID="pvPage1" />
<telerik:RadTab Text="Page 2" PageViewID="pvPage2" />
</Tabs>
</telerik:RadTabStrip>
The page views are defined like this:
<telerik:RadMultiPage ID="rmpMultiPage2" runat="server">
<telerik:RadPageView ID="pvPage1" runat="server">
RadGrids etc
</telerik:RadPageView>
<telerik:RadPageView ID="pvPage2" runat="server">
More RadGrids etc
</telerik:RadPageView>
</telerik:RadMultiPage>
The page views contains numerous components that will be populated from the database.
However, I will only be interested in populate those when a page view containing them is displayed.
Which event should I listed at to determine when to populate components?
The OnLoad event in RadPageView is triggered when the page load, regardless if the page view is shown or not.
The OnPreRender event in RadPageView is also triggered on page load.
The OnNeedDataSource event in GridView is the same, the event triggers when the page loads.
Using Visible="False" in a RadPageView only results in page views that will never show up even if the corresponding RadTab is clicked.

ajax popup extender with aspx page inside iframe inside panel

I am trying to implement a popup login screen using ajaxpopupextender.
Is it possible to use an aspx page(which is the login page ) to show in the Panel using iframe?
Is there any advantage of using page instead of user control inside the panel? Does both gets loaded on parent page_load? considering faster page load Plase suggest which method to be used?
Try this way
<asp:Panel ID="pnlPopUp" Style="display: none ;padding:3px;" runat="server" >
//Test.aspx page is a page which you want to show as a popup
<iframe id="frame1" src="Test.aspx" style="overflow: auto;height:200px; width: 100%;" scrolling="auto"></iframe>
</asp:Panel>
<asp:ModalPopupExtender ID="mdlPopup" Y="50" runat="server" BehaviorID="mpe" TargetControlID="btnShowPopup" PopupControlID="pnlPopUp" BackgroundCssClass="bModal">
</asp:ModalPopupExtender>

Page update after asyncfileupload completes upload

I see this question asked frequently and I have done extensive experimentation to try to get this to work. However everyone else's examples and answers have so far failed me. I am bemused. Here is the situation:
AsyncFileUpload is NOT in an UpdatePanel
Image and Label to be updated are in an UpdatePanel
Update should occur after the upload completes
The upload is indeed saving the file as expected. My problem is regarding getting the page to update after that happens. The file being uploaded is an image, and I would like that image to update. I am aware of some problems with images not updating on the client if you reuse filenames, but I am also printing it to a label just to be sure. I am certain the UpdatePanel I am targeting is not updating.
I have tried the following approaches:
Using the server side method to manually update a conditional UpdatePanel - this fails because the file upload is done in a frame. Sniffing the returned HTML shows that the correct HTML is actually sent back after the post, but of course to the wrong frame.
Using the client side method to trigger a javascript postback to my UpdatePanel. This does not work and I cannot tell why.
Using the client side method to trigger a javascript button click inside the UpdatePanel. Again, nothing happens and I don't know why.
Setting the UpdatePanel's trigger up so that it points directly at the AsyncFileUpload. No joy, but I knew that would be a long shot, keeping in mind the hidden frame.
Moving the AsyncFileUpload into the UpdatePanel and trying some variety of the above. When I do this, I lose all handle of the file being posted to the server and I cannot save the file in the first place.
Normally when I get this kind of error, where all the tutorials appear to be wrong, it turns out that my error is because I didn't set an ID on a control somewhere and it somehow mattered. I can't even see that in this case. Here is some code.
<fieldset class="pj_Pics">
<ul>
<li>
<label>Picture 1</label>
<asp:UpdatePanel ID="ajax_Pic1" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Image ID="img_Pic1" runat="server" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
<div style="position:relative;">
<div class="photoChooser">
<ajaxToolkit:AsyncFileUpload ID="fu_Pic1" runat="server" CssClass="pj_PicChoose" Width="84px" OnClientUploadComplete="picPost1" OnUploadedComplete="fu_PictureFile_UploadedComplete" ThrobberID="throb1" />
<span><asp:Literal runat="server" Text="click to change"></asp:Literal></span>
<asp:Image ID="throb1" runat="server" ImageUrl="~/images/throbber.gif" AlternateText="uploading image" />
</div>
</div>
</li>
</ul>
</fieldset>
protected void fu_PictureFile_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
bla bla bla;
// and update the image
img.ImageUrl = "~/" + webfolder + imageFileName;
thing.Text = img.ImageUrl;
}
function picPost1(sender, args) {
document.getElementById('<%# Button1.ClientID %>').click();
}
Any help greatly appreciated. There is obviously a ScriptManager on the page and the code I've shown is just the last thing I have attempted. Let me know if there is anything else you need to see.
Thank you!
I happen to face the same situation today, and this is how I solved it.
According to this LINK, there's no Postback is happening or even a ViewState since its Asynchronous FileUpload.
So in OnUploadedComplete I test file type and size before executing the SaveAs() in codebehind, then I test the same in OnClientUploadComplete to display messages and carry on the rest of the work like setting Images URL. Hope this helps.

RadWindow Modal Ajax Popup hide and show from code behind

I really need some help with this. I need to, using a RadWindow control, pop up a modal window containing a dynamically populated CheckBoxList based on user selection on dropdownlist changed. Please help with any sample or information to help me achieve this.
<telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Width="250" Height="536" VisibleOnPageLoad="false" Modal=true Behaviors="Minimize, Move, Resize,Maximize" Left="580" Top="-8" EnableShadow="true">
<ContentTemplate>
<div style="text-align: center;">
LIST OF STUFF TO DISPLAY
</div>
</ContentTemplate>
</telerik:RadWindow>
When using ContentTemplate, RadWindow behaves and can be used just like any other standard INamingConatiner.
For more details, check the help article and the demo on the subject.

ASP.Net AJAX ValidatorCalloutExtender issue

I am building a User Control (requirement – has to be User Control).
This user control is inside an AJAX Update Panel on the parent page.
The user control has two Infragistics Web Date Chooser controls on it.
Both dates are required.
I have placed asp.net RequiredFieldValicators on both controls.
I have placed ValidatorCalloutExtenders on both.
One control gets validated every time without fail. The other is intermittent. To debug I first removed the ValidatorCalloutExtender from the failing control and sure enough the RequiredFieldValidator fires correctly every time so it appears that the problem is with the ValidatorCalloutExtender. There are not a lot of options for the ValidatorCalloutExtender but I did play with them every way feasible and nothing seems to make any difference. The TargetControlID has to point to the validation control you are extending. Any help appreciated.
Here is the code that works correctly every time:
<igsch:WebDateChooser ID="wdcEndDatePop" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
Width="200px" MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvEndDate" runat="server"
ControlToValidate="wdcEndDatePop" Display="None"
ErrorMessage="End date required." ValidationGroup="endDatePop" />
<cc1:ValidatorCalloutExtender
ID="vceEndDatePop"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvEndDate"
WarningIconImageUrl="~/images/back_warning2.gif" />
And here is the code that works intermitemtly:
<igsch:WebDateChooser ID="wdcStartDate" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvStartDate" runat="server"
ControlToValidate="wdcStartDate" Display="None"
ErrorMessage="Start date required." ValidationGroup="access" />
<cc1:ValidatorCalloutExtender
ID="vceStartDate"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvStartDate"
WarningIconImageUrl="~/images/back_warning2.gif" />

Resources