Showing posts with label included. Show all posts
Showing posts with label included. Show all posts

Wednesday, March 28, 2012

Dynamic content for modal popup

Hi -

I want to change the contents of a modal popup dynamically through client side script. For that purpose, I've included a div element and change it's innerhtml property. When I test whether the change got done I can read the new value through javascript but the modal popup extender shows the old html (which loaded when the page was loaded). I think I may have to call a method to let the modal popup extender know I updated the content, but I don't know how to do that.

Any help is greatly appreciated!!

Oliver

I thought I'd add some code so you know what I am talking about.

Thanks,

Oliver

 function showpopup() { event.bubble = false; var d = document.getElementById("popupcontent"); d.innerhtml='<img src="images/spinner.gif" alt="Please wait ..." />'; var popup =$find('BMPNoShow'); popup.show(); alert(d.innerhtml); }<ajaxToolkit:ModalPopupExtender ID="MPNoShow" BehaviorID="BMPNoShow" runat="server" CancelControlID="BNoShowCancel" DropShadow="true" PopupControlID="PNoShow" PopupDragHandleControlID="PNoShow" TargetControlID="PNoShow"> </ajaxToolkit:ModalPopupExtender> <asp:Panel ID="PNoShow" runat="server" Style="background: white; border-color: Gray; border-style: solid; width: auto; padding: 10px" EnableViewState="false"> <div id="popupcontent"> </div> <br /> <asp:Button ID="BNoShowCancel" runat="server" Text="Cancel" UseSubmitBehavior="false" /> <asp:Button ID="BNoShowConfirm" runat="server" Text="Mark as no-show" UseSubmitBehavior="false" /> <asp:HiddenField ID="HFNoShowRequest" runat="server" /> </asp:Panel>

Take a look at the Dynamic* properties of the modalpopup, which allow you to load the content of a modalpopup dynamically using a web service. This will automatically load the content into the modalpopup when it is shown without you having to do anything.


Thanks - that's even better than what I was trying to do :)

Monday, March 26, 2012

dynamic <asp:TextBox> markup not editable

Hi,

I tried to write on the fly <asp:TextBox> markup using c#. Those markup are included in <div> markup.

The problem is that my textboxes are ReadOnly and I did nothing for that !!!
Whorse, when I paste the generated code into a new aspx page, it works, has anyone an idea ?

Here's my code :

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>KING : Saisie des frais</title>
<link rel="stylesheet" type="text/css" href="http://links.10026.com/?link=StyleSheet.css"/>
</head>
<body>
<form id="formulaire" runat="server">
<atlas:ScriptManager ID="ScriptManager" runat="server" />
<div id="conteneur">
<div class="fdcaldate">
<%
string cal;
cal = "";
for (int i = 1; i < 31; i++){
cal += ("<div class=\"jo\"> L"+ i + " </div>") ;
}
Response.Write(cal);
%>
</div>
<div class="fdcalsaisie">
<%
string cal2;
cal2 = "";
for (int j = 1; j < 31; j++){
cal2 += ("<div class=\"jo\"><asp:TextBox ID=\"TextBox"+j+"\" runat=\"server\" BackColor=\"Transparent\" BorderColor=\"Transparent\" BorderStyle=\"None\" Height=\"20px\" Width=\"24px\">ici</asp:TextBox></div>\n") ;
}
Response.Write(cal2);
%>
</div>
</div>
</form
<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
</references>
<components>
</components>
</page>
</script>
</body>
</html

"text/xml-script">//schemas.microsoft.com/xml-script/2005">

hello.

this is not really an atlas question, but...

well, this won't work because you're adding the <asp:textbox> string to the output. you can't create an asp.net controlo like this with c#. to create a textbox, you have to:

TextBox txt = new TextBox();
txt.Text = ":...";

then you tipically have a placeholder on the page and you add the control to that placeholder's control collection.

DropShadowExtender; Showing up on Top

I am using VS2008 and the included AJAX Control ToolKit

I have a master page that includes the scriptmanager and a panel with the DropShadowExtender

I have added a content page, that has a panel with a DropShadowExtender.

When the page displays, the 2nd DropShadow, goes UP, and displays on the top of the box. Basically an UPShadowExtender.

Any ideas to correct?

I have noticed a similar situation in the past if I am using tables or panels (and I would presume divs as well since panels are rendered as divs) I am trying to recall exactly what solved the issue but I do recall it had something to do with the width of each of the elements. I beleive if I had a table and had the extender to another control within that table, and the content in that table forced the outter table (or panel) to expand, I noticed that the dropshadow extender would push upwards.

Basically, what Im trying to say is, check your table, div, panel widths and heights. Make sure the content has ample room.


Hi,

Thank you for your post!

Create a simple repro for this issue if you can,and please post up the whole code of the repro.

Anyway, I agree withjgilmore. you should do moretroubleshoot wok and then you can provide us with more valuable information.

Best Regards,

Wednesday, March 21, 2012

DropDownExtender list is very disconnected from DropDownExtender label...why?

HI,

I have included a DropDownExtender control on my site's master page (currently with only two options to drop down). The DDE is targeting an asp:Label.

My problem is that when I move my mouse over the Label, the drop down list shows up at the bottom of the page! (For what it matters, in the past I have tried replacing the DDE with a HoverMenu and still the same problem occurs; the options that show up after hovering over the list show up at the bottom of the page).

The only styles I have in the table column that the DDE is located in is:

width:30%;text-align:left;

Does anyone have any idea as to why this is occurring...and what the fix could be? I appreciate any help, thank you. Frank

I have included the body of the site here:

******************

<body>

<formid="form1"runat="server">

<asp:ScriptManagerID="ScriptManager1"runat="server"/>

<imgsrc="pics/BGfade.jpg"id="bg"alt=""/>

<divid="content">

<!--Main Table for the body-->

<tableid="maintable">

<!--Title/Navigation Links Row-->

<trid="title">

<tdcolspan="2">

<imgsrc="pics/anomaliestitle.jpg"alt=""/>

<p>

<aid="homelink"runat="server"href="http://www.maybusher.com/Default.aspx">Blog Frankly</a>

<aid="anomalylink"runat="server"href="Default.aspx">Anomalies Home</a>

<aid="emaillink"runat="server"href="Email.aspx">Contact Me</a>

<aid="adminlink"runat="server"href="Login.aspx">Admin</a>

</p>

<p></p>

</td>

</tr>

<!--Main Content-->

<trid="midbody">

<!--Left Content Selection Column-->

<tdid="leftcolumn">

<cc1:DropDownExtenderID="ddeCategories"runat="server"

TargetControlID="lblDropUFO"

DropDownControlID="panelDropUFO">

</cc1:DropDownExtender>

<asp:PanelID="panelDropUFO"runat="server"

Style="display:none; visibility:hidden;">

<asp:LinkButtonID="lbUFOImages"runat="server"

Text="UFO Images"

Width="114px"

OnClick="lbUFOImages_Click"/><br/>

<asp:LinkButtonID="lbUFOVids"runat="server"

Text="UFO Videos"

Width="115px"/>

</asp:Panel>

<asp:LabelID="lblDropUFO"runat="server"

Text="UFO's"Width="119px"/>

</td>

<!--Middle Content Column-->

<tdid="midcolumn">

<asp:contentplaceholderid="body"runat="server">

</asp:contentplaceholder>

<p></p>

</td>

</tr>

<!--Footer Row-->

<trid="footer">

<tdcolspan="2">

<p>©2007 Frank Maybusher. All Rights Reserved.</p>

</td>

</tr>

</table>

</div>

</form>

</body>

Hi Maybush1,

I was failed to reproduce your issue with the sample code so I suspect that your Ajax Control Toolkit lower than V10618. If true, please please upgrade and have a test. Also, I should suggest you add CSS to your Panel (panelDropUFO).

Best regards,

Jonathan


Hi Jonathan,

Thanks for your reply.

I have tried what you suggested: upgraded the Toolkit to version 10920 and also I have tried positioning the Panel using CSS to no avail. The panel just does not want to respond to anything. It it still very disconnected and about 300 pixels down from the actual TargetControl Label. I've been trying to work on this for several weeks now (no kidding)! I'm at a complete loss.

Frank


Hi Maybush1,

I have tested with your code on my machine and it works pretty well. So really sorry that we cannot reproduce your issue and give your further more advices. Here is the test sample.

<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <img src="pic/upg_Business.jpg" id="bg" alt="" /> <div id="content"><!--Main Table for the body--> <table id="maintable"><!--Title/Navigation Links Row--> <tr id="title"> <td colspan="2"> <img src="pic/upg_HomeBasic.jpg" alt="" /> <p> <a id="homelink" runat="server" href="http://www.maybusher.com/Default.aspx">Blog Frankly</a>       <a id="anomalylink" runat="server" href="Default.aspx">Anomalies Home</a>       <a id="emaillink" runat="server" href="Email.aspx">Contact Me</a>       <a id="adminlink" runat="server" href="Login.aspx">Admin</a> </p> <p> </p> </td> </tr><!--Main Content--> <tr id="midbody"><!--Left Content Selection Column--> <td id="leftcolumn"> <ajaxToolkit:DropDownExtender ID="ddeCategories" runat="server" TargetControlID="lblDropUFO" DropDownControlID="panelDropUFO"> </ajaxToolkit:DropDownExtender> <asp:Panel ID="panelDropUFO" runat="server" Style="display: none; visibility: hidden;"> <asp:LinkButton ID="lbUFOImages" runat="server" Text="UFO Images" Width="114px"/><br /> <asp:LinkButton ID="lbUFOVids" runat="server" Text="UFO Videos" Width="115px" /> </asp:Panel> <asp:Label ID="lblDropUFO" runat="server" Text="UFO's" Width="119px" /> </td> </tr><!--Footer Row--> <tr id="footer"> <td colspan="2"> <p> ?2007 Frank Maybusher. All Rights Reserved.</p> </td> </tr> </table> </div> </form>

My Ajax Control Toolkit's version is V10618. Would you please test it on another machine? If your problem is still there, please share more information.

I hope this help.

Best regards,

Jonathan