RadWindow Modal Ajax Popup hide and show from code behind - ajax

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.

Related

Having trouble hovering and clicking button using Capybara and Xpath

I'm trying to click a button using Capybara. I've tried all combinations I can think of but no luck. Trying to click on the 'delete' link. The delete link only shows up when you hover over the row in the table.
This is the HTML:
<tbody>
<tr class="even" id="informal_6">
<td class="columnOrganizationNameColumnValue" id="informal_7">
<div>
<a id="showLink_0" title="Organization Details" class="viewLink">
Institution / Automation
</a>
</div>
<div class="gridMenuDescription">
</div>
<div class="gridMenu">
<a id="gridMenuDirectLink_1" title="Edit Organization" class="gridMenuItem">
edit
</a>
<a id="gridMenuDirectLink_2" class="gridMenuItem delete">
delete
</a>
</div>
</td>
</tbody>
I'd like to note, that the "gridMenu" div, when you hover over it using Firebug it turns to:
<div class="gridMenu hover gridMenuShow">
Some things I've tried, but no luck:
find(:xpath, '//*[(#id = "gridMenuDirectLink_2")]').click
find("#informal_6").find("#informal_7").find(".gridMenu.hover.gridMenuShow").find(".gridMenuItem.delete").click
Suggestions?
After a crazy amount of attempts trying different things I was able to get it to work with this code:
find('#informal_6').hover.find('.gridMenu').hover.find('.gridMenuItem.delete').click
Try the below code to hover over the row.
page.driver.browser.mouse.move_to(page.driver.browser.find_element(:id=>"locator"))
I have a calendar interface where AJAX edit & delete links appear only when you hover over each calendar entry. It's nice and compact, but I had trouble getting Capybara to click on those dynamically displayed elements, and using .hover on the parent element didn't seem to make a difference. So I tried a brute-force approach that is working nicely so far:
# Use Jquery to force display a hidden element. Useful for getting at links
# that are dynamically displayed.
# Call it like: js_show(".entry.scheduled[data-id=\"#{#da3.id}\"] .actions")
def js_show(selector)
page.execute_script(" $('#{selector}').show(); ")
end
def js_hide(selector)
page.execute_script(" $('#{selector}').hide(); ")
end
Now, when I need to click on an element that's only displayed on hover etc., I can call js_show(".whatever.container.selector") to force the links to display, then page.find(...).click works.

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.

Parent Page shows through Filter Menus in RadWindow embedded RadGrid

I have a RadGrid in a RadWindow set to Modal.
I'm seeing two issues.
The first and most critical ONLY HAPPENS IN IE7 and NOT in FIREFOX is that the Filter Menus of the RadGrid do not display when clicked. Instead a box the size of the menus is opened through which I can see the parent page.
The second and probably related HAPPENS IN BOTH IE AND FIREFOX is that when I drag the RadWindow the content of the RadWindow disappears and is replaced by the same transparency to the parent page.
Any help you could offer would be great. I've spent all day hunting and pecking through CSS trying to find it.
Grid and window declarations follow.
<telerik:RadWindowManager
OnClientClose="OnViewerClose"
Behaviors="Close, Move, Resize,Maximize"
ID="RadWindowManager"
DestroyOnClose="true"
Opacity="99"
runat="server">
<Windows>
<telerik:RadWindow
ID="AssociateUserWindow"
VisibleOnPageLoad="false"
Width="600"
Height="400"
runat="server"
Overlay="true"
KeepInScreenBounds="true"
Modal="true"
Skin="WebBlue">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<telerik:RadGrid
ID="rgUsers"
runat="server"
AllowPaging="true"
AllowSorting="true"
AutoGenerateColumns="false"
CellPadding="1"
CellSpacing="2"
GridLines="Vertical"
Skin="WebBlue"
Width="100%"
OnItemDataBound="rgUsers_ItemDataBound"
OnNeedDataSource="rgUsers_NeedDataSource"
PageSize="5"
>
<PagerStyle Mode="NumericPages"></PagerStyle>
<MasterTableView DataKeyNames="UserId" AllowMultiColumnSorting="True" AllowFilteringByColumn="true" HierarchyDefaultExpanded="true">
<Columns>...ommitted...</Columns>
</MasterTableView>
</telerik:RadGrid>
Are you able to extract a runnable sample that displays the issue? If you can I think the best thing to do here, since the markup that you posted looks completely fine, is to submit this in a support ticket over at Telerik. Their support guys will probably be the best to figure out what the issue might be.
Nevermind. I've found the issue... that opacity setting was the culprit. Removing it from the radwindow manager fixed it.

UpdatePanel does not fire on first click of link button

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

Resources