Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Wednesday, March 28, 2012

Dynamic generated Controls doesnt work, javascript error

I have an ajax enabled control which has a Dropdownlist that changes the Textbox when index gets changed. It is working fine if I use an ASPX page that contains the control in design time.

However, when I dynamically add this control to the ASPX in run time, I got an error when the Dropdownlist is triggered:

Javascript error: System.InvalidOperationException: A control with ID 'myDropDownList' could not be found for the trigger in UpdatePanel..etc..

What should I do? Please help..

There's a good chance that if you look at your page source you'll find that the dynamic control does not have a clientside Id of 'myDropDownList'. It'll probably have something more complex like ct100_myDropDownList or something.

Two possible fixes: 1) wire up your javascript on something other than the id (e.g. iterate over getElementsByTagName), or 2) render the control's ClientID inside a script tag on the page like: var ddl = '<%= myDropDownList.ClientID %>'

HOpe that helps.

Dynamic association between UpdatePanel and UpdateProgress not working

Hi,

I haven't really used the ASP.NET AJAX framework before and I'm trying to get this to work without any luck. On my page is a repeater control and in its itemtemplate I generate an UpdatePanel and an UpdateProgress control (and a couple of other items) along with a LinkButton. The UpdatePanel has another repeater inside it. The idea is when I click on of the LinkButtons, it binds a datasource to the innermost repeater and refreshes the associated UpdatePanel (the panel is set to Conditional updatemode). It all works well but the associated UpdateProgress doesn't show, ever.

I've tried declarative setting the AssociatedUpdatePanelID in my ASP.NET code and I've tried to set it programatically in the ItemDataBound property of the outermost repeater (I've tried setting it to ID, ClientID and UniqueID) with no luck. If I leave the AssociatedUpdatePanelID untouched it sort of work but the problem is that ALL UpdateProgress controlls are displayed when a LinkButton is pressed.

The following experimentation code is the one I've been trying to make it work
 <asp:scriptmanager id="ScriptManager1" runat="server"> </asp:scriptmanager> <asp:repeater id="rptAlternatives" runat="server" onitemcreated="rptAlternatives_ItemCreated" onitemdatabound="rptAlternatives_ItemDataBound"> <itemtemplate> <div style="border: 1px solid #000; width: 300px; height: 100px; margin: 10px 0 10px 0;"> <asp:linkbutton id="lnkToggleSementPanel" runat="server" text="Toggle segments"></asp:linkbutton> <asp:updateprogress id="progress" runat="server" AssociatedUpdatePanelID="updSegmentPanel"> <ProgressTemplate> Loading... </ProgressTemplate> </asp:updateprogress> <asp:updatepanel id="updSegmentPanel" runat="server" updatemode="Conditional"> <contenttemplate> <asp:repeater id="rptSegments" runat="server"> <headertemplate> <div style="background-color: red; width: 100%;"> </headertemplate> <itemtemplate><%# Container.DataItem%> </itemtemplate> <footertemplate> </div> </footertemplate> </asp:repeater> </contenttemplate> </asp:updatepanel> </div> </itemtemplate> </asp:repeater>

using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partialclass _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
List<int> items =new List<int>();
for (int i = 0; i < 5; i++)
items.Add(i);

this.rptAlternatives.DataSource = items;
this.rptAlternatives.DataBind();
}
}
protected void rptAlternatives_ItemCreated(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
LinkButton lnkToggleSementPanel = e.Item.FindControl("lnkToggleSementPanel")as LinkButton;
if (lnkToggleSementPanel !=null)
{
lnkToggleSementPanel.Click +=new EventHandler(lnkToggleSementPanel_Click);
lnkToggleSementPanel.CommandArgument = e.Item.ItemIndex.ToString();
this.ScriptManager1.RegisterAsyncPostBackControl(lnkToggleSementPanel);
}
}
}

protected void rptAlternatives_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
UpdatePanel updSegmentPanel = e.Item.FindControl("updSegmentPanel")as UpdatePanel;
if (updSegmentPanel !=null)
{
UpdateProgress progress = e.Item.FindControl("progress")as UpdateProgress;
if (progress !=null)
{
progress.DisplayAfter = 0;

// NON OF THESE WORK!
//progress.AssociatedUpdatePanelID = updSegmentPanel.ClientID;
//progress.AssociatedUpdatePanelID = updSegmentPanel.UniqueID;
//progress.AssociatedUpdatePanelID = updSegmentPanel.ID;
}
}
}
}

void lnkToggleSementPanel_Click(object sender, EventArgs e)
{
LinkButton lnkToggleSementPanel = senderas LinkButton;
if (lnkToggleSementPanel !=null)
{
Control parentControl =
lnkToggleSementPanel.Parent;
UpdatePanel updSegmentPanel = parentControl.FindControl("updSegmentPanel")as UpdatePanel;

if (updSegmentPanel !=null)
{
Repeater rptSegments = updSegmentPanel.FindControl("rptSegments")as Repeater;
if( rptSegments !=null )
{
List<int> items =new List<int>();
for (int i = 0; i <= Convert.ToInt32(lnkToggleSementPanel.CommandArgument); i++)
items.Add(i);

rptSegments.DataSource = items;
rptSegments.DataBind();
updSegmentPanel.Update();

// Delay added for debugging
System.Threading.Thread.Sleep(1000);
}
}
}


}
}

Another thing that I've found strange is that if I move the assigning of the AssociatedUpdatePanelID property FROM ItemDataBound TO ItemCreated it all stops working and if you check the generated control ID's they've not been given proper IDs, i.e the NamingContainer stops working

No takers on this one? It appears Im just missing one piece of the puzzle but I can't figure out which oneSad


Hi,

Here is a working sample:

<%@. Page Language="C#" %><%@. Import Namespace="System.Collections.Generic" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { List<int> items = new List<int>(); for (int i = 0; i < 5; i++) items.Add(i); this.rptAlternatives.DataSource = items; this.rptAlternatives.DataBind(); } } protected void rptAlternatives_ItemCreated(object sender, RepeaterItemEventArgs e) { //if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) //{ // LinkButton lnkToggleSementPanel = e.Item.FindControl("lnkToggleSementPanel") as LinkButton; // if (lnkToggleSementPanel != null) // { // lnkToggleSementPanel.Click += new EventHandler(lnkToggleSementPanel_Click); // lnkToggleSementPanel.CommandArgument = e.Item.ItemIndex.ToString(); // this.ScriptManager1.RegisterAsyncPostBackControl(lnkToggleSementPanel); // } //} } protected void rptAlternatives_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { UpdatePanel updSegmentPanel = e.Item.FindControl("updSegmentPanel") as UpdatePanel; if (updSegmentPanel != null) { UpdateProgress progress = e.Item.FindControl("progress") as UpdateProgress; if (progress != null) { progress.DisplayAfter = 0; } } } } protected void rptAlternatives_ItemCommand(object source, RepeaterCommandEventArgs e) { LinkButton lnkToggleSementPanel = e.Item.FindControl("lnkToggleSementPanel") as LinkButton; if (lnkToggleSementPanel != null) { Control parentControl = lnkToggleSementPanel.Parent; UpdatePanel updSegmentPanel = parentControl.FindControl("updSegmentPanel") as UpdatePanel; if (updSegmentPanel != null) { Repeater rptSegments = updSegmentPanel.FindControl("rptSegments") as Repeater; if (rptSegments != null) { List<int> items = new List<int>(); for (int i = 0; i <= e.Item.ItemIndex; i++) items.Add(i); rptSegments.DataSource = items; rptSegments.DataBind(); updSegmentPanel.Update(); // Delay added for debugging System.Threading.Thread.Sleep(2000); } } } }html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:scriptmanager id="ScriptManager1" runat="server"> </asp:scriptmanager> <asp:repeater id="rptAlternatives" runat="server" onitemcreated="rptAlternatives_ItemCreated" onitemdatabound="rptAlternatives_ItemDataBound" OnItemCommand="rptAlternatives_ItemCommand"> <itemtemplate> <div style="border: 1px solid #000; width: 300px; height: 100px; margin: 10px 0 10px 0;"> <asp:updatepanel id="updSegmentPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"> <contenttemplate> <asp:linkbutton id="lnkToggleSementPanel" runat="server" text="Toggle segments"></asp:linkbutton> <asp:repeater id="rptSegments" runat="server"> <headertemplate> <div style="background-color: red; width: 100%;"> </headertemplate> <itemtemplate><%# Container.DataItem%> </itemtemplate> <footertemplate> </div> </footertemplate> </asp:repeater> </contenttemplate> <Triggers> </Triggers> </asp:updatepanel> <asp:updateprogress id="progress" runat="server" AssociatedUpdatePanelID="updSegmentPanel"> <ProgressTemplate> Loading... </ProgressTemplate> </asp:updateprogress> </div> </itemtemplate> </asp:repeater> </div> </form></body></html>

Please try it and compare with your own code.

Monday, March 26, 2012

dynamic addhandler not working in update panel

hi all,

i have designed a page, with a place holder in it, the placeholder is inside a updatepanel, the placeholder gets filled with images at load, and when i click the viewcart button it get filled with the image information with few dynamic buttons, i have added addhandler for those buttons, but they are not firring up. i am pasting my code here if some one can help me plz.

Dim

updateorderlnkbtn AsNew button ' this is done at the genearal section of the page to make it globalAddHandler updateorderlnkbtn.click,AddressOf cancelBtn_click ' at page init

please help me

hi all

i have done some other changes to the code but still the same problem, if any one of you can give me some idea that would be highly appreciated

thanks


hi all

I have done some thing here that my 5 static buttons that are created at runtime are working fine now but the problem is with the dynamic table, i am placing a delete button in the dynamic table now the dynamic table is created at runtime and i want the delete button to remove the row.

the other buttons (5 buttons) code is something like this , i have wrote the code behing the load, the problem is that i can't wrote the dynamic table code behind the load, the dynammic table is created when i click a viewcart button

please help

dynamic accordionpanes

I'm trying to create dynamic accordion panes for use in an accordion as a menu. I have the controls inside the accordionpanes working, but I'm trying to format the header for the panels and I'm running into a problem. The code is as follows:

dim mypane as accordionpane

'add controls

dim myLabel as label

mylabel.text = "some label"

mypane.controls.add(mylabel)

'add header

mypane.header = new headerTemplate("someheaderlabel","someurl")

myaccorion .pane.add(mypane)

the code for headerTemplate is:

private class headerTemplate

implements itemplate

dim headerlabel as string

dim headerurl as string

public sub new(byval label as string,byval url as string)

headerlabel = label

headerurl = url

end sub

public sub instantiatein (ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn

dim myheader as new literalcontrol

myheader.text = headerlabel

dim myurl as new linkbutton

myurl.text = "(Show All")

myurl.postbackurl = headerurl

container.controls.add(myheader)

container.controls.add(myurl)

end sub

The 'new' sub is run on the 'mypane.header = new headerTemplate("someheaderlabel","someurl") ' line, but the instantiatein is never fired. What am I doing wrong?

OK - I found an easier way to do it - just add the controls to the accordianpane.headercontrols.

Now when I test it (I have 2 hard coded panes and one that I create programatically), the two hard-coded panes expand and collapse fine, but the one i created programatically doesn't collapse (but does make the hard coded ones collapse when i click on it). Has anybody else run across this before? If so, how did you fix it?


I'm having the same problem. Programatically created accordion panes do not collapse. Can anyone please help?


Hi,

Here is a sample made as your description, it works fine. Please try it:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { //TextBox tb = new TextBox(); //MyAccordion.HeaderSelectedCssClass = ""; //AccordionPane1.HeaderContainer.Controls.Add(tb); AccordionPane ap = new AccordionPane(); MyAccordion.Panes.Add(ap); LinkButton lb = new LinkButton(); lb.Text = "hello"; ap.HeaderContainer.Controls.Add(lb); TextBox tb2 = new TextBox(); ap.ContentContainer.Controls.Add(tb2); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <ajaxToolkit:Accordion ID="MyAccordion" runat="server" SelectedIndex="0" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent" FadeTransitions="false" FramesPerSecond="40" TransitionDuration="250" AutoSize="None" RequireOpenedPane="false" SuppressHeaderPostbacks="true"> <Panes> <ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server"> <Header><a href="http://links.10026.com/?link=">1. Accordion</a></Header> <Content> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator> <asp:Button ID="Button1" runat="server" Text="Button" /> The Accordion is a web control that allows you to provide multiple panes and display them one at a time. It is like having several where only one can be expanded at a time. The Accordion is implemented as a web control that contains AccordionPane web controls. Each AccordionPane control has a template for its Header and its Content. We keep track of the selected pane so it stays visible across postbacks. </Content> </ajaxToolkit:AccordionPane> <ajaxToolkit:AccordionPane ID="AccordionPane2" runat="server"> <Header><a href="http://links.10026.com/?link=">2. AutoSize</a></Header> <Content> <p>It also supports three AutoSize modes so it can fit in a variety of layouts.</p> <ul> <li><b>None</b> - The Accordion grows/shrinks without restriction. This can cause other elements on your page to move up and down with it.</li> <li><b>Limit</b> - The Accordion never grows larger than the value specified by its Height property. This will cause the content to scroll if it is too large to be displayed.</li> <li><b>Fill</b> - The Accordion always stays the exact same size as its Height property. This will cause the content to be expanded or shrunk if it isn't the right size.</li> </ul> <asp:Button ID="Button2" runat="server" Text="Button" /> </Content> </ajaxToolkit:AccordionPane> <ajaxToolkit:AccordionPane ID="AccordionPane3" runat="server"> <Header><a href="http://links.10026.com/?link=">3. Control or Extender</a></Header> <Content> The Accordion is written using an extender like most of the other extenders in the AJAX Control Toolkit. The extender expects its input in a very specific hierarchy of container elements (like divs), so the Accordion and AccordionPane web controls are used to generate the expected input for the extender. The extender can also be used on its own if you provide it appropriate input. </Content> </ajaxToolkit:AccordionPane> </Panes> </ajaxToolkit:Accordion> </div> <script type="text/javascript"> function pageLoad(sender, args) { var behavior = $find('MyAccordion_AccordionExtender'); behavior.add_selectedIndexChanged(onSelectedIndexChanged); } function onSelectedIndexChanged(sender, args) { } </script> </form></body></html>
Hope this helps.

I have solved my problem by changing mypane.controls.add() to mypane.contentcontainer.add().

Dyanmically created linkbuttons, within UpdatePanel, is not working

Hello Folks,

I am updating a placeholder, to create some form controls, from my code behind.

I am successful. Now, I want to create a linkbutton, next to each form control i create, that when clicked on, go to the same generic event and read the control's ID (passed by the linkbutton somehow) and then I will do the logic to remove the control from the placeholder. Right now it creates the linkbuttons, but to ensure i don't have duplicate ID's, I add a unique int.tostring on the end of the ID of the linkbuttons. And I added the handler that should send all clicks, from all the linkbuttons to the same event. But I put a breakpoint in that event and when I click any of the linkbuttons, it just refreshes and no change to the page and the breakpoint in the event is never reached. Please let me know if you have any ideas, questions.. a portion of my code, with notes, below...

I am able to create all form elements except buttons, link buttons, etc.

I think the link button creation should be as simple as:

victorylinkBTN.ID ="victorylinkBTN" & VictoryReplicantCount.ToString

AddHandler victorylinkBTN.Click,AddressOf victorylinkBTN_Click

DCP.Controls.Add(victorylinkBTN)

victorylinkBTN.Text ="Del"

Dim vicEventAsNew System.EventArgs()

Is that right? It does create the linkbuttons, but the click fails. It submits, but nothing happens, it just refreshes with nothing changed, and doesn't land on my breakpoint, in the sub below.

Sub victorylinkBTN_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Dim linkbutAs LinkButton =CType(sender, LinkButton)

Dim linkbutIDAsString = linkbut.ID.ToString

'do more work……

EndSub

If you have any idea what I am doing wrong, please let me know.

Also, if you have experience with update panels, if I make the update panel conditional, then how would I set each of these linkbuttons to have trigger rights to the related update panel?

Again, thanks for any help ...

Folks,

I have found a cheesy way to do this, by adding javascript on each linkButton created that inserts the linkButton ID into a hidden field's value on the page and then on that linkButton submit, in pageLoad, I read the value of the hidden field to decide to perform the action.

This works, and would take some serious time to explain. Please feel free to email me via the forum contact ability, if you want details.

I am leaving this open, hoping someone in the asp.net team will have a better solution.


Since you dynamically add thelink buttons, you should add it to the PlaceHolder in the Page_Load event every time instead of adding it just the page first load. Because when you only add it the first time the page load, after post back, thelink buttonswill disappear. And itdoesn't land on your breakpoint invictorylinkBTN_Click,There is non victorylinkBTN when your postback.

Try this:

publicpartialclassDefault2 : System.Web.UI.Page

{

protectedvoid Page_Load(object sender,EventArgs e)

{

AddControl(PlaceHolder_ContentRight,"~/WebUserControl.ascx",true);

}

privatevoid AddControl(PlaceHolder PlaceHolder,string ControlPath,bool Clear)

{

Control Control_ToAdd;

Control_ToAdd = LoadControl(ControlPath);

if (Clear)

{

PlaceHolder.Controls.Clear();

}

PlaceHolder.Controls.Add(Control_ToAdd);

}

}

If this help you,don't forget mark it as a answer.Thanks!

Best Regards

Jin-Yu Yin

Duplicate Items in dropdownlist inside an Updatepanel

Hi,

I have been working with Atlas for the past couple of weeks and I have a very simple page with a dropdownlist box inside a updatepanel. I have a button that inserts a value in the back-end database and refresh the dropdownlist. This button is also a trigger for the updatepanel. This dropdownlist is bounded to an ObjectDataSource.

The problem is that on the first click, the values in the dropdownlist are duplicated with the original list and plus the new value. So I have the original list show up twice and the new value at the end. However, on the second click, the dropdownlist is updated correctly with only the new value being appended at the end. Doesn't anyone have the same problem?

ThanksSmile

<atlas:UpdatePanelID="UpdatePanelReason"runat="server"Mode="Conditional">

<ContentTemplate>

<asp:DropDownListID="drpReason"runat="server"AppendDataBoundItems="True"DataSourceID="ObjectDataSource1"DataTextField="ITEM_SUB_TYPE_NAME"DataValueField="PK_ITEM_SUB_TYPE_ID">

<asp:ListItemValue="0">Select Reason</asp:ListItem>

</asp:DropDownList>

</ContentTemplate>

<Triggers>

<atlas:ControlEventTriggerControlID="btnAddReason"EventName="Click"/>

</Triggers>

</atlas:UpdatePanel>

My post-back method to insert a new value in the dropdownlist.

ProtectedSub btnAddReason_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles btnAddReason.Click

IfMe.txtNewReason.Text <>String.EmptyThen

Dim lookupMgrAsNew LookupManager

lookupMgr.insertItemSubType(Me.txtNewReason.Text, Session("ItemType"))

Me.drpReason.DataBind()

EndIf

EndSub

Problem solved!! All I have to do is clear all the items in the dropdownlist before calling databinding.

:)

dropshadowextender showing up awkward

Hello,

Having an issue with the dropshadowextender...in Firefox, it's working fine, but when using IE, the dropshadow is appearing above the panel, instead of below it. By that, I mean the shadow is at the very top of the panel, instead of the very bottom. Here's a live example so you can see what I am talking about:

head to: http://moglme.com/viewList.aspx?lid=195 and then click on any of the "Shop this store" links on the right hand side. the shadow starts how it's supposed to be, but moves to the top shortly after. any help would be appreciated :)

anyone? this is a issue that we need to get solved immediately, and i'm having trouble figuring out what is wrong


Hi,

I have looked at this in both IE version 7.0 and Firefox version 2.0.0.4 and the web page displays exactly the same in both. (The shadow is in the correct place.)

What version of IE are you using?

Cheers,

Matt


hello,

after about a week or 2, without changing anything in the code related to the drop shadow, it started behaving as intended. it's like it just magically started to work, don't know how it happened though

DropShadowExtender

Hi,

I am working on an web-solution, where I have a menubar, that consists of an updatePanel, a WebPartZone and some Panels, that represents different menus. It goes something like this:

UPDATEPANEL

WebParZone

Panel 1 = Shop (example)

Panel 2 = Statistics

Panel X = Something

/WebPartZone

/UPDATEPANEL

How can I use a DropShadowExtender on each Panel?

I believe your DropShadowExtender's target control ID should be that of the UpdatePanel...I am not sure if the DropShadowExtender would work with UpdatePanel, i have never tried it.

But, if it does not work, wrap your updatepanel with another asp:panel control and make your dropshadowextender's targetcontrol id to this this dummy wrapper panel..i am sure this would work..

more on DropShadowExtender herehttp://ajax.asp.net/ajaxtoolkit/DropShadow/DropShadow.aspx

DropShadowExtender

DropShadowExtender just working i sample not like in website code?Confused [8-)]

i get it working only onOpacity="1"and width has no effectHuh? [:^)]

Set opacity between "0.1" to "0.9". No effect on opacity = "1" since it will give a sold shadow

I mean that opacity are only working by applaying it in Client code (javascript) code

Huh?

Saturday, March 24, 2012

DropShadow not working.

I am using a DropShadowExtender. Following is my aspxcode:

<%@dotnet.itags.org. Page Language="VB" MasterPageFile="~/Master/Classic/NewMasterPage_CSS.master" AutoEventWireup="false" CodeFile="ClassSchedule.aspx.vb" Inherits="General_Schedule_ClassSchedule" %
<%@dotnet.itags.org. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">
<asp:Panel ID="Panel1" runat="server" BackColor="Gold">
<asp:Button ID="Button1" runat="server" Text="Button" /></asp:Panel>
<cc1:DropShadowExtender ID="DropShadowExtender1" runat="server">
<cc1:DropShadowProperties TargetControlID=Panel1 Opacity=.8 Rounded=true TrackPosition=true ></cc1:DropShadowProperties>
</cc1:DropShadowExtender>
</asp:Content>

When the page is rendered, the dropshadow is rendered somewhere else on the page.

This is likely due to margins, tables, scroll, or padding defined in your CSS and/or master page. This is a known issue that we're working addressing. Thanks!

Any up date on this issue? Is there a fix or a workaround some one knows?

Thanks


I tried to use it. The shadow and the control barely touch (bottom right corner of panel just overlaps top left corner of shadow) when used in the ItemTemplate of a FormView on a Content page. It seems to work properly on a standalone page. If I use negative numbers for the Width, I can get move the shadow up and down, but the X-axis is still off.

I also see that if I turn rounded corners on it behaves very badly. The shadow renders (in the wrong place) and the rounded corners that should enclose my panel render, but my panel and its controls are not rendered at all. If I apply a border to my panel it is rendered in the proper dimensions and it contains the top and bottom rounded corners. The shadow is rendered in the proper size but in the wrong location. It also appears to be in front of the border.

I sure would like to use it.


Does anyone know if this issue of the drop shadow is addressed and fixed in VWD 2008 / .NET 3.5? I'm still using VWD 2005 / .NET 3.0 and I'm wary about upgrading when new things first come out, but if the latest versions are much better, I may reconsider.

Dropdownlist not working within an UpdatePanel

I have a MasterPage with a ScriptManager EnablePartialRendering set to true.

On my AddDeceseadInfo.aspx page I have multipe textboxes and a dropdownlist all wrapped in a UpdatePanel. Also on the AddDeceasedInfo.aspx page (content) I have a ProxyScriptManager.

When I pick a value from the Dropdownlist the value is always "".

When I set AutoPostBack to true my ValidationControl fires and tells me the dropdownlist can not be empty which at that point it is.

When I set the AutoPostBack to false once a pick a value from the dropdownlist all the data in the dropdownlist disappears.

Can somebody help out a AJAX newbie............Cheers!

protectedvoid Page_Load(object sender,EventArgs e)

{

TextBoxFirstName.Focus();

if (!IsPostBack)

{

//Gets the languageID for the current user.

int languageID =LanguageUtility.GetLanguageIDByTwoLetterISOLanguageName();

DropDownListCauseOfDeath.DataSource = BLL.CauseOfDeath.GetCausesOfDeathByLanguageID(languageID);

//The field in the data source which provides the item text.

DropDownListCauseOfDeath.DataTextField ="CauseOfDeath";DropDownListCauseOfDeath.DataValueField ="CauseOfDeathID";

DropDownListCauseOfDeath.DataBind();

}

}

protectedvoid ButtonReset_Click(object sender,EventArgs e)

{

Utility.WebUtility.ClearAllTextBoxes(this);

}

protectedvoid ButtonSubmit_Click(object sender,EventArgs e)

{

if (Page.IsValid)

{

string firstName =HttpUtility.HtmlEncode(TextBoxFirstName.Text).Trim();

string middleName =HttpUtility.HtmlEncode(TextBoxMiddleName.Text).Trim();

string lastName =HttpUtility.HtmlEncode(TextBoxLastName.Text).Trim();

string nickName =HttpUtility.HtmlEncode(TextBoxNickName.Text).Trim();

DateTime dateOfBirth =Convert.ToDateTime(HttpUtility.HtmlEncode(TextBoxDateOfBirth.Text).Trim());

DateTime dateOfDeath =Convert.ToDateTime(HttpUtility.HtmlEncode(TextBoxDateOfDeath.Text).Trim());

int causeOfDeathID =Convert.ToInt32(DropDownListCauseOfDeath.SelectedValue);string birthPlace =HttpUtility.HtmlEncode(TextBoxBirthPlace.Text).Trim();

}

else

{

}

}

}

Set AutoPostBack to true and also set CauseValidation property to false


Set the EnableClientScript property to false on your validation control. Validators aren't supported in an UpdatePanel, this may be causing you issues,see Item #4 for more information

-Damien


I guess my post was not clear but the answers posted did not really help. My DropDownList is inside an UpdatePanel.

The ScriptManager is set to enable patial rendering.

AutoPostBack is set to true.

My UpdatePanel has UpdateMode set to Conditional

I populate the DropDownList with values from my database. When the page loads the values are there in the DropDownList. When I go and pick a value the data from the DropDownList disappears. Basically I end up with a empty DropDownList. Values gone................

When I set the AutoPostBack property to false the data stays in the DropDownList after I pick a value but when I hit the submit button the Validation control fires because the DropDownList is all of a sudden empty again.

I am running the latest Versions of ASP.Net Ajax and was under the impress the validator problems have been solved in the latest version. It seems to work on all my other froms that I use the UpdatePanel. The Validator controls and UpdatePanel work nicely together.

There seem to be no examples on the web where somebody has on DropDownList in an UpdatePanel and simple wants to get the value from that DropDownList and the additional TextBoxes once the Submit button is clicked.

I watched some of the ASP.Net videos and there are some Extenders that might be useful but it is too much work. Isn't there a why of making a simple DropDownList work within a UpdatePanel. So I can get the value from it.


How are you binding the list; are you possibly clearing it on the postback? Do you have ViewState enabled for the DropDownList?

Also, I'm using a DropDownList in an UpdatePanel successfully so it does work.

-Damien


Thanks for your reply, here is my Page_Load

protectedvoid Page_Load(object sender,EventArgs e)

{

TextBoxFirstName.Focus();

if (!IsPostBack)

{

//Gets the languageID for the current user.

int languageID =LanguageUtility.GetLanguageIDByTwoLetterISOLanguageName();

DropDownListCauseOfDeath.DataSource = BLL.CauseOfDeath.GetCausesOfDeathByLanguageID(languageID);

//The field in the data source which provides the item text.

DropDownListCauseOfDeath.DataTextField ="CauseOfDeath";DropDownListCauseOfDeath.DataValueField ="CauseOfDeathID";

DropDownListCauseOfDeath.DataBind();

}

}


If I comment if(!Ispostback) out then the form works as it should the only problem is the that the DropDownList gets bound again after I hit the submit button and therefore the the ID returned by the DropDownList is always 1. Somebody it sitting on my brain and I can't figure this out. Any ideas? Thanks, Newbie

protectedvoid Page_Load(object sender,EventArgs e)

{

TextBoxFirstName.Focus();

//if (!IsPostBack)

//{

//Gets the languageID for the current user.

int languageID =LanguageUtility.GetLanguageIDByTwoLetterISOLanguageName();

DropDownListCauseOfDeath.DataSource = BLL.CauseOfDeath.GetCausesOfDeathByLanguageID(languageID);

//The field in the data source which provides the item text.

DropDownListCauseOfDeath.DataTextField ="CauseOfDeath";DropDownListCauseOfDeath.DataValueField ="CauseOfDeathID";

DropDownListCauseOfDeath.DataBind();

//}

}


Just fixed the problem. I overrode the OnInit event like this

protectedoverridevoid OnInit(EventArgs e)

{

base.OnInit(e);

PopulateDropDownList();

}

and added a PopulateDropDownList() method

privatevoid PopulateDropDownList()

{

//Gets the languageID for the current user.

int languageID =LanguageUtility.GetLanguageIDByTwoLetterISOLanguageName();

DropDownListCauseOfDeath.DataSource = BLL.CauseOfDeath.GetCausesOfDeathByLanguageID(languageID);

//The field in the data source which provides the item text.

DropDownListCauseOfDeath.DataTextField ="CauseOfDeath";DropDownListCauseOfDeath.DataValueField ="CauseOfDeathID";

DropDownListCauseOfDeath.DataBind();

}

Set the AutoPostBack to false

EnableViewState to true

UpdatePanel to Conditional

ScriptManager EnablePartialRendering to true

And it is all working now like a charm. DropDownList works in UpdatePanel and so do the validation controls. Thanks Microsoft.....................


Thank you for posting the solution. You just made my day!

Wednesday, March 21, 2012

DropDownExtender breaks table in Firefox

Hi!

I'm using the DropDownExtender over a tablerow.
It's working ok in IE7 but not in Firefox.

All columns get merged into the first one when the DropDownExtender is created.
I'm using the latest release (Feb 01)
Here's an example

<%

@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server"><title>Untitled Page</title><styletype="text/css">.ContextMenuPanel

{

border:1pxsolid#868686;z-index:1000;background:url(pics/menu-bg.gif)repeat-y00#FAFAFA;cursor:default;padding:1px1px0px1px;font-size:11px;

}

.ContextMenuBreak

{

margin:1px1px1px32px;padding:0;height:1px;overflow:hidden;display:block;border-top:1pxsolid#C5C5C5;

}

a.ContextMenuItem

{

border:0;margin:1px01px0;display:block;color:#003399;text-decoration:none;cursor:pointer;padding:4px19px4px33px;white-space:nowrap;

}

a.ContextMenuItem-Selected

{

font-weight:bold;

}

a.ContextMenuItem:hover

{

background-color:#FFE6A0;color:#003399;border:1pxsolid#D2B47A;padding:3px18px3px32px;

}

</style>

</

head>

<

body><formid="form1"runat="server"><asp:ScriptManagerID="ScriptManager1"runat="server"/><asp:UpdatePanelID="updatePanel"runat="server"><ContentTemplate><asp:PanelID="DropPanel"runat="server"CssClass="ContextMenuPanel"Style="display :none; visibility: hidden;"><asp:LinkButtonrunat="server"ID="Option1"Text="Option 1"CssClass="ContextMenuItem"/><asp:LinkButtonrunat="server"ID="Option2"Text="Option 2"CssClass="ContextMenuItem"/><asp:LinkButtonrunat="server"ID="Option3"Text="Option 3 (Click Me!)"CssClass="ContextMenuItem"/></asp:Panel><ajaxToolkit:DropDownExtenderrunat="server"ID="DDE1"TargetControlID="row2"DropDownControlID="DropPanel"/><asp:TableID="table"runat="server"Border="1"><asp:TableHeaderRowID="row1"><asp:TableHeaderCell>Column 1</asp:TableHeaderCell><asp:TableHeaderCell>Column 2</asp:TableHeaderCell><asp:TableHeaderCell>Column 3</asp:TableHeaderCell><asp:TableHeaderCell>Column 4</asp:TableHeaderCell></asp:TableHeaderRow><asp:TableRowID="row2"><asp:TableCell>Value 1</asp:TableCell><asp:TableCell>Value 2</asp:TableCell><asp:TableCell>Value 3</asp:TableCell><asp:TableCell>Value 4</asp:TableCell></asp:TableRow><asp:TableRowID="row3"><asp:TableCell>Test 1</asp:TableCell><asp:TableCell>Test 2</asp:TableCell><asp:TableCell>Test 3</asp:TableCell><asp:TableCell>Test 4</asp:TableCell></asp:TableRow></asp:Table></ContentTemplate></asp:UpdatePanel><div></div></form>

</

body>

</

html>

Does anyone know why this is happening?

/Mathias

Same exact issue here.