Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Wednesday, March 28, 2012

Dynamic generated control in UpdatePanel

Hi,

I have an updatepanel, a datagrid (initially whose visible property is false) and few buttons on a webpage. On click of one of button I bind the panel with a collection and set visible property to true in turn displaying bounded datagrid.

-Now when I go to view html source for the page I didn't find any grid(or its table equivalent) control there. Why so? I want to know how new rows are displayed without any corresponding markup generated in the html source?

-Now on click of another button I dynamically create a template column in the datagrid and adds some dynamically generated controls say checkbox in that column of the datagrid. Now my questions are :-

--How can I use those dynamically generated controls in my server side code?

--How can I access them in javascript so as to find out which checkboxes are checked and which are not?

--That newly added column is visible till grid is not updated. How can I make newly generated column persists permanently?

-Also I have added CheckedChanged event handler on that dynamic check box but that event doesn't fire. How can I get that event work?

Sorry for a long post.

Thanks in advance.


1. You don't see the HTML because you're only seeing the original HTML the page first rendered with. The update caused by the update panel is done dynamically with script. That is, the HTML content of the page is altered at runtime, and you're only seeing the request time HTML.

2a. You should follow the link to my blog in my signature and read about dynamically creating server controls. Using the controls is easy -- you created them, that means you have a reference to them.

2b. You know their client side IDs with the ClientID property. You can use the ClientID property to render out javascript that uses it. You can pass the ID to document.getElementById or use the shortcut for that, $get. For example, $get("<%= MyControl.ClientID%>");. Exactly how you do this depends on your needs -- but the basic idea is to render the ClientID into javascript code, by whatever means.

2c. Dynamically created controls do not recreate themselves on postbacks, and that includes asynchronous postbacks from an UpdatePanel. When you dynamically create a control it is up to you to make sure that control is recreated each and every request. Creating them from an event handler isn't enough, because that event won't fire again on a postback unless the user performs the same action. Read my articles on dynamic controls to get some ideas of how to handle this better.

3. It doesn't fire because it doesnt exist... for the reason in 2c.

Hope that helps :)


If you'd Like to see the HTML of the partial-render i suggest using opera (http://www.opera.com/) and download the Developer Console and DOM Snapshot plugins for it. It'll allow you to take a snapshot of the DOM of the page at any given moment, not just the original source.

Hello,

I am new to this forun, I have tried my best to explain my problem but sorry for long description.

I am also facing the same problem, dynamically generated server side code is not reflected in the HTML.

I am using AJAX on that page, if enablepartialrender = false then it works fine.

in the custom control i am adding dynamic control as follows.

protectedoverridevoidCreateChildControls{

StringBuilder builder = new StringBuilder();

builder.Append("some script");.

builder.Append("some html");

LiteralControl ctrl =newLiteralControl(builder.ToString());

Controls.Add(ctrl); }

this control is added on page with UpdatePanel & ScriptManger , now I am modifying the builder contents dynamically , during poastback,

but when I check the view source I am it shows me the original source.

I am gone though all your documents about following

Part 1: Dynamic vs. Static
Part 2: Creating Dynamic Controls
Part 3: Adding Dynamic Controls to the Control Tree

but I haven't found any thing which solves my this issue,

I mean in case of AJAX how to add dynamic controls?


The original HTML source is never going to change. The HTML is dynamically updated with javascript as the result of a partial update. The result is, the browser displays the new HTML, but the "source" of the page is unchanged. With a regular postback, the entire source is redownloaded, so you see the updates with View Source. I hope that makes sense.

As for why or why not you are actually seeing the new content (isn't clear whether thats the case), you'll have to post some more code so we can figure that out. But one thing I notice, you have builder.Append("some script"). Statically written script in the html isn't going to execute.. you will need to use the ScriptManager.Register_ APIs (e.g. RegisterStartupScript), or the script simply won't execute. The reason is because browsers do not execute script in dynamically injected HTML, they have to be dealt with specially, which the framework handles for you if you just use the correct API.


Thanks for quick reply,

Following is the code of custom control. In the CreateControl method I am generating the HTML

also m_listItems this list contents are set from page where I am putting this control.

I am modifying this list on postback, now here is the problem , if I debug the code the i found that every thing is OK

but in the browser those changes are not reflecting , when AJAX is enabled.

Please suggest me solution.

--Kiran

-------- Custom Control Code ----------------

[assembly: WebResource("TestNameSpace.CustomControl.ctrl.js", "text/javascript")]

namespace AtlasWeb.MultiSelectDropDown
{
[ParseChildren(true, "ListItems")]
public class CustomControl : CompositeControl, IScriptControl
{
private ArrayList m_listItems = new ArrayList();
private ScriptManager sm;
private StringBuilder builder = new StringBuilder();

public ArrayList ListItems
{
get { return m_listItems; }
set { m_listItems = value; }
}

protected override void OnPreRender(EventArgs e)
{
if (!this.DesignMode)
{
// Test for ScriptManager and register if it exists
sm = ScriptManager.GetCurrent(Page);

if (sm == null)
throw new HttpException("A ScriptManager control must exist on the current page.");

sm.RegisterScriptControl(this);
}

base.OnPreRender(e);
}

protected override void CreateChildControls()
{
CreateControl();
LiteralControl ctrl = new LiteralControl(builder.ToString());
Controls.Add(ctrl);
}

protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
if (!this.DesignMode)
{
sm.RegisterScriptDescriptors(this);
}
}

protected virtual IEnumerable<ScriptReference> GetScriptReferences()
{
ScriptReference htmlEditorReference = new ScriptReference("TestNameSpace.CustomControl.ctrl.js", "TestNameSpace.CustomControl");
return new ScriptReference[] { htmlEditorReference };
}

protected virtual IEnumerable<ScriptDescriptor> GetScriptDescriptors()
{
ScriptControlDescriptor descriptor = new ScriptControlDescriptor("TestNameSpace.CustomControl", this.ClientID);
return new ScriptDescriptor[] { descriptor };
}

IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
{
return GetScriptReferences();
}

IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors()
{
return GetScriptDescriptors();
}

protected void CreateControl()
{
builder.Append("<script language=\"Javascript\">var ms1 = new TestNameSpace.CustomControl([");
int index = 1;
foreach (ListItemData itemData1 in m_listItems)
{
builder.Append("{name:\"");
builder.Append(itemData1.CtrlID.ToString());
builder.Append("\", value: \"");
builder.Append(itemData1.Value.ToString());
builder.Append("\", isSelected: ");
builder.Append(itemData1.IsSelected.ToString());

if (index == m_listItems.Count)
builder.Append("}");
else
builder.Append("},");

index++;
}

builder.Append("],\"ms1\", \"ms1\", \"" + this.ID + "\");");
builder.Append("Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);");
builder.Append("function pageLoaded(sender, args)");
builder.Append("{");
builder.Append("javascript:ms1.RenderHtml();");
builder.Append("}");
builder.Append("</script>");
}
}

/// <summary>
/// Summary description for ListItems.
/// </summary>
public class ListItemData : Control
{
#region Constructors

public ListItemData()
{
m_ID = string.Empty;
m_value = string.Empty;
m_isSelected = "false";
}

#endregion

#region public properties

public string CtrlID
{
get { return m_ID; }
set { m_ID = value; }
}

public string Value
{
get { return m_value; }
set { m_value = value; }
}

public string IsSelected
{
get { return m_isSelected; }
set { m_isSelected = value; }
}

#endregion

#region private class data

private string m_ID;
private string m_value;
private string m_isSelected;

#endregion
}
}
-------- Custom Control Code ----------------


Right... the problem is what I said. You are registering your script by rendering it directly into the HTML from your control, because you just add the script to a literal control. That definitely will not work in an update panel. You have a script descriptor there-- but you aren't using it. That script descriptor will cause an instance of your client side control to be created. All you need to do is feed it the data you want though a property on the client side control. Then you assign the data to a property on the script descriptor (AddProperty or something like that). Then the control is created that value will have been set. Here...

MyType = function(element) {
MyType.initializeBase(this, [element]);
}
MyType.prototype = {
_data: null,
get_data: function() { return this._data; },
set_data: function(value) { this._data = value; },

initialize: function() {
var data = this.get_data();
// render the data, or whatever you want to do with it
MyType.callBaseMethod("initialize");
}

}
MyType.registerClass("MyType", Sys.UI.Control);

Then on the server side you feed that property with your ScriptControlDescriptor something like so:

// build up an array of items where each item is a dictionary
ArrayList data = new ArrayList();
Hashtable ht = new Hashtable();
ht["name"] = "name";
data.Add(ht);
// ... add more
ScriptControlDescriptor d = new ScriptControlDescriptor("MyType", this.ClientID);
d.AddProperty("data", data);
return new ScriptDescriptor[] { d };


Hello,

Thanks for reply.


Now when from server side any property is modified, does it reflect at client sie?

I mean on client side I am able to see the property vales, which are set when page is loaded.

now on some event i am modifying that property value, does it reflect at client side?

Currently this is not happening in my code.


If your component is in an update panel, yes it should be recreated and the initialize method called again. It should have the new server side values because the descriptor is recreated.

If you're not seeing that, sorry, you'll have to provide some more examples.


Hello,

Thanks for reply.

I have tested by putting alert in the javascript , it is showing that property vale is updating on event, but not refleting it at client side.

Initialise & despose methods are getting called , when I do button click first despose is called and then initialise is called.

Are there any sample applications or document availble on net for the same?

please let me know.

Dynamic created ModalPopup Window

Hi,

I am having a lot of modal popup windows on my page (20+).

When i click various buttons on my page, various modal popupwindows should apear. But I don't want to define all the windows in the aspx, because the windows are pretty large.

So I think it would be fine to place one Panel containing an UpdatePanel and one ModalPopupExtender on the page and on clicking a button on the page i create an composite control and place it inside the Updatepanel, update() and show the modal dialog from code behind. This works fine if the content of the modal popup doesn't contain any buttons. But when i use buttons inside the popup window, their events doesn't fire at all.

Here is some code:

The ASPX:

 <asp:panel id="pnlPopUp" runat="server" style="display: none">
<div style="background-color: LightGrey">
<asp:panel id="header" runat="server">
<asp:label id="lblHeader" runat="server" />
<asp:linkbutton id="lbClose" runat="server" text="X" onclientclick="$find('mpePopUp').hide(); return false;" />
</asp:panel>
<asp:updatepanel runat="server" id="updPopup" childrenastriggers="true" updatemode="conditional">
<contenttemplate>
<asp:panel id="pnlBody" runat="server" cssclass="body" />
</contenttemplate>
</asp:updatepanel>
</div>
</asp:panel>
<cc1:modalpopupextender id="mpePopUp" behaviorid="mpePopUp" popupcontrolid="pnlPopUp" runat="server" dropshadow="true"repositionmode="RepositionOnWindowResizeAndScroll" targetcontrolid="dummy" backgroundcssclass="modalBackground" />

CODE:

public partialclass _Default : System.Web.UI.Page
{
public MDMWindow2 w2 =null;

protected override void OnInit( EventArgs e )
{
base.OnInit( e );
w2 =new MDMWindow2( );
w2.Bubble +=new EventHandler( w2_Bubble );
}

void w2_Bubble(object sender, EventArgs e)
{
int x = 0;// This Point get NEVER hit}protected void ShowWindow2(object sender, EventArgs e )
{
w2.HeaderText ="WWW2";
updPopup.ContentTemplateContainer.Controls.Add( w2 );
updPopup.Update( );
mpePopUp.Show( );
}

and the code of the control:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for PopUpPanel
/// </summary>public class MDMWindow2 : CompositeControl
{
private Label headerLabel;
private Button button;

public String HeaderText
{
get{EnsureChildControls( );return headerLabel.Text;
}
set{EnsureChildControls( );headerLabel.Text =value;
}
}

public MDMWindow2( )
{
}

public event EventHandler Bubble;

protected override void OnLoad( EventArgs e )
{
base.OnLoad( e );
EnsureChildControls( );
}

protected override void CreateChildControls( )
{
EnsureChildControls( );
headerLabel =new Label( );
headerLabel.ForeColor = System.Drawing.Color.Red;
this.Controls.Add( headerLabel );

button =new Button( );
button.CommandName ="Click";
button.Text ="ClickMe";
Controls.Add( button );
button.Click +=new EventHandler( b_Click );

}

void b_Click(object sender, EventArgs e )
{
Bubble(this, e );// This Point get NEVER hit
}
}

Can anybody help? What is wrong with wiring the eventHandlers? Is the updatepanel the probl?em? Or can anybody show me an better way to create modal popups at serverside?

Thnx

I did something like this using user controls (.ascx files). The .aspx file has an UpdatePanel whose content is an asp:Panel with an asp:PlaceHolder in it and an asp:Button. The button is configured with an OnCommand handler and an initial CommandName of 'Inactive'. A LinkButton on the page triggers a partial postback which does 3 main things: a) does a LoadControl of a .ascx file into the Placeholder; b) changes the CommandName of the Button to "EntryForm" (or something logically associated with the .ascx); c) calls Show() on the modal popup.

After the partial rendering completes, the modal popup is shown. When the Button is pressed, the OnCommand is run, and it uses the CommandName to do the right thing for the particular .ascx that was loaded. It's important that in Page_Load, if it's a postback, that the loaded .ascx is re-loaded (using LoadControl) so that the viewstate is restored and the controls on the .ascx can get updated with the values entered on the modalpopup form. During OnCommand, if a different .ascx needs to be shown, it unloads the Placeholder's controls and uses LoadControl for the next .ascx. If the sequence is done, it sets the CommandName back to "Inactive" and hides the modalpopup.

Hope that helps,

Donnie

This sounds good. But in my Dialogs I will have more various controls like dropdownllist or textboxes wich will have to be bound to an eventhandler too. They have to be in the controls.

It would be perfect, if I can handle the events, which are triggered by my control, inside the page.



Sounds like, then, after you use LoadControl, the page just needs to add event handlers in its code-behind to the controls in the .ascx that was dynamically loaded.

Dynamic controls in Ajax UpdatePanel

I created a dynamic button and want to add the button click event as update panel trigger.
But does not work. Any idea ?
Thanks

String clientID;

protectedvoid Page_Init(object sender,EventArgs e)

{

Button btn =newButton();

btn.Text ="Write Hello";

btn.Click +=newEventHandler(Button1_Click);

Page.Form.Controls.Add(btn);

clientID = btn.ClientID;

}

protectedvoid Button1_Click(object sender,EventArgs e)

{

Label1.Text ="hello";

}

protectedvoid Page_PreRender(object sender,EventArgs e)

{

AsyncPostBackTrigger trigger =newAsyncPostBackTrigger();

trigger.ControlID = clientID;

trigger.EventName ="Click";

UpdatePanel1.Triggers.Add(trigger);

}

Try this instead of your code.

protected void Page_Load(object sender, EventArgs e)
{

Button btn = new Button();
btn.Text = "Write Hello";
btn.ID = "Button1";
btn.Click += new EventHandler(Button1_Click);
UpdatePanel1.ContentTemplateContainer.Controls.Add(btn);
//Page.Form.Controls.Add(btn);
// clientID = btn.ClientID;

AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
trigger.ControlID = "Button1";
trigger.EventName = "Click";
UpdatePanel1.Triggers.Add(trigger);

}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "hello";

}


This works. But actually what I want is : when click on the Button1, the the UpdatePanel1 will be hide and a UpdateProgress (with a loading image) will show until the loading complete. And the UpdatePanel1 will show again with some updated info.


Try this code. I dont think its a perfect way. I am using some hack mentioned in

http://dotnetslackers.com/community/blogs/simoneb/archive/2006/09/02/481.aspx

<%@. 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)
{

Button btn = new Button();
btn.Text = "Write Hello";
btn.ID = "Button1";
btn.Click += new EventHandler(Button1_Click);
UpdatePanel1.ContentTemplateContainer.Controls.Add(btn);
//Page.Form.Controls.Add(btn);
// clientID = btn.ClientID;

AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
trigger.ControlID = "Button1";
trigger.EventName = "Click";
UpdatePanel1.Triggers.Add(trigger);
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "hello";
System.Threading.Thread.Sleep(4000);
}
</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID=sc1 runat=server ScriptPath="ScriptLibrary"></asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server"Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgressrunat=server AssociatedUpdatePanelID=Updatepanel1 ID=up1DynamicLayout=true DisplayAfter=4 >
<ProgressTemplate>
<table>
<tr>
<td>
Loading......
</td>
</tr>
<tr>
<td>
<img src="http://pics.10026.com/?src=" alt="image" />
</td>
</tr>
</table>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</form>
</body>
</html>
<script language=javascript>
Sys.Application.add_load(ApplicationLoadHandler)
function ApplicationLoadHandler(sender, args)
{
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(HidePanel);
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(ShowPanel);
}
function HidePanel(sender, args)
{
for (var j = sender._updatePanelIDs.length - 1; j >= 0; j--)
{
varupdatePanel =document.getElementById(sender._uniqueIDToClientID(sender._updatePanelIDs[j]));
var postbackElement = args.get_postBackElement();
if(updatePanel && updatePanel.contains(postbackElement)) {
updatePanel.style.visibility='hidden';
}
}
}
function ShowPanel(sender, args)
{
var updatedPanels = args.get_panelsUpdating();
for (var j = updatedPanels.length - 1; j >= 0; j--)
{
updatedPanels[j].style.visibility='visible';
}
}
</script>


Is it posible to put the button outside the UpdatePanel ?

UpdatePanel1.ContentTemplateContainer.Controls.Add(btn);

Because I would not want the button to be hide while 'Ajax'.

Thanks

Dynamic Content events needed as Trigger events

Is there a way to add triggers at runtime? I have a bunch of dynamic images that show that I want to add the click events as triggers to update a larger image. Thanks.

I don't think you can add triggers dynamically (maybe it's possible, I don't see a way however).

The best way to procede depends on your needs. If *all* you need is your UpdatePanel to update() when some image is clicked and you don't know what / how many images at runtime, you could just dynamically add the image controls to the UpdatePanel's container controls, and give each image an onclick attribute with a postback reference. Something like this:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableEventValidation="false" %><!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>Untitled Page</title></head><script runat="server"> protected void Page_Load(object sender, EventArgs e) { Image Image1 = new Image(); UpdatePanel1.ContentTemplateContainer.Controls.Add(Image1); Image1.ID = "Image1"; Image1.ImageUrl = "img.png"; Image1.Attributes.Add("onclick", ClientScript.GetPostBackClientHyperlink(Image1, "Image1PostBack")); }</script><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server" > <ContentTemplate> asdf </ContentTemplate> </asp:UpdatePanel> </form></body></html>
 

If the dynamic images need to be outside the UpdatePanel you want to trigger - does it matter to your update which dynamic image was clicked? Depending on that, there are other possibillities.

Ben


Ben,

Thanks for the post. I figured it out. You can add triggers to the updatepanel.

Dim x As New AsyncPostBackTriggerx.ControlID = <name of control that will be doing the update>x.EventName = "Click"update.Triggers.Add(x)

Just make sure this runs even after a post back.

Monday, March 26, 2012

Dummie question about UpdatePanel

I have a problem which can be sumarized in the following:

- UpdatePanel with a button

- Text box outside update panel

- Want button "click" method to update the text in the textbox.

How is this possible? I have read some suggestions (Luis Abreu suggests a "dummie button" with _DoPostBack. The problem is I am very new to asp so have no idea about where and how to place the code and have no idea about how javascript works in the page, so I did not underestand that solution nor how to implement it...

Any help is appreciated!

I've say you should put the things that you want updated inside the UpdatePanel, with a Trigger on the button click event. The button does not have to reside inside the UpdatePanel. So, your example should be reversed, with the UpdatePanel with a textbox and a button outside the UpdatePanel.
Hi,

quick example that illustrates what senyl said above:

<%@. 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 btnUpdate_Click(object sender, EventArgs e) { txtDate.Text = DateTime.Now.ToString(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="scriptManager" runat="server" EnablePartialRendering="true"></atlas:ScriptManager> <atlas:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <atlas:ControlEventTrigger ControlID="btnUpdate" EventName="Click" /> </Triggers> <ContentTemplate> <asp:TextBox ID="txtDate" runat="server"></asp:TextBox> </ContentTemplate> </atlas:UpdatePanel> <asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" /> </form></body></html>

senyl:

I've say you should put the things that you want updated inside the UpdatePanel, with a Trigger on the button click event.  The button does not have to reside inside the UpdatePanel.  So, your example should be reversed, with the UpdatePanel with a textbox and a button outside the UpdatePanel.

The problem is that my real scenario is slightly more complicated:

One of the UpdatePanels is a GridView with a column which is a button for "add new row". As it is embedded in the gridview, I can't take it out.

The other updatePanel is a FormView that becomes visible when the former button is clicked. It then shows insert boxes and it has a "insert" button that also needs to be in the formview...to insert the record.

Well, my best advice is to watch that video by Scott Gutherie on the Atlas homepage, where he uses a gridview and a formview with atlas. You could also make the updatepanels render always, and code the triggers properly.

Hope this helps (it probably won't, but it is my best guess)

DropshadowExtender disappear on gridview selected index changes

Hello,

I have a gridview inside a panel wich is inside an updatepanel. My problem is when I click on my gridview and I select a row the shado and the rounded corners of the panel around the gridview disappear.

I can see the dropshadowextender, only on the first page load, after it disappears. I can't find any solution to keep the rounded corner and the shadow

Please try your scenario with the recently available61121 release of the Toolkit (and ASP.NET AJAX Beta 2). If the problem persists, then please reply with acomplete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

Saturday, March 24, 2012

DropShadow hides my menu items on back

I used dropshadow and when I pull down menut item to navigate to other page I cannot click on it as it's hide behind dropshadowextender?

On the menu element, try setting:

<asp:Menu id="Menu1" style="position:relative:z-index:5" ... >


I tried this and this does not work! The shadow override the menus.

This worked when I removed this tag:

<

atlasToolkit:DropShadowExtenderID="dse"runat="server"><atlasToolkit:DropShadowPropertiesTargetControlID="Panel1"Width="5"Rounded='true'Opacity=".75"TrackPosition="true"ID="dsBehavior"/>

</

atlasToolkit:DropShadowExtender>

Yes I had to remove the shadow to get this going even though my menu has:

<asp:MenuID="Menu1"runat="server"DataSourceID="SiteMapDataSource1"Font-Bold="true"style="position:relative; z-index:5">

It's the 2nd level menus that are hidden underneath the shadow. I think it completely ignores the Z-index of the menu


That worked for me but I have more question,

1) how to make size of both panel and table look same so that I have good effect of drop shadow, as with the below code my panel is too big and table is inside the panel. I tried to make size of both table and panel same still does not work.

2)How to use different color besides black for shadow?

<

asp:PanelID="pnlTable"runat="server">
<tableclass="table">
<tr>
|<tdcolspan="2"class="heading">Search Parts By Supplier or Return Parts</td>
</tr>
<tr>
<tdclass="tdheading">Supplier ID</td>
<td><asp:TextBoxID="txtsearchsuppID"runat="server"Width="208px"></asp:TextBox></td>
</tr>
<tr>
<tdclass="tdheading">From Date<asp:TextBoxID="txtfromdate"runat="server"></asp:TextBox>
<asp:PanelID="pnlFrom"runat="server">
<asp:CalendarID="fromClnd"runat="server"OnSelectionChanged="fromClnd_SelectionChanged">
</asp:Calendar>
</asp:Panel><cc1:CollapsiblePanelExtenderID="CPEfromClnd"runat="server"><cc1:CollapsiblePanelPropertiesCollapseControlID="txtfromdate"Collapsed="True"AutoCollapse="True"AutoExpand="True"CollapsedSize="0"ExpandControlID="txtfromdate"ExpandedSize="180"TargetControlID="pnlFrom"/></cc1:CollapsiblePanelExtender></td></tr>
<tr>
<tdcolspan="2"><asp:ButtonID="btnSearch"runat="server"Text="Search"OnClick="btnSearch_Click"/>
</td></tr>
</table></asp:Panel>

The DropShadow isn't ignoring the zIndex of the menu - it has no knowledge of it. I suspect that the sub-menu items created by the ASP.NET menu control don't have zIndexes on them, so they default to 0 which causes them to show up beneath the dropshadow items.


The Sub Menus don't have a style property to adjust unlike the asp:Menu. They have a CssClass which is what I'm assuming you mean.

I removed the following off the panel to show the underlying shadow.

CssClass="dropShadowPanel"

Then I placed z-index: 155 everywhere for the menu.

<asp:MenuID="Menu1"runat="server"DataSourceID="SiteMapDataSource1"StaticDisplayLevels="1"Font-Bold="true"Style="z-index:115"><StaticMenuItemStyleCssClass="MenuStyle"VerticalPadding="2px"/><DynamicHoverStyleCssClass="MenuStyle"BackColor="#e1ecfc"/><DynamicMenuItemStyleCssClass="MenuStyle"BackColor="#e1ecfc"/></asp:Menu>

.MenuStyle

{FONT-SIZE:8pt;VERTICAL-ALIGN:top;FONT-FAMILY:verdana;PADDING-BOTTOM:5px;z-index:115}

The menu appears beneath the shadow regardless of all the combinations I have tried.

A quick fix but I lose screen space is:

StaticDisplayLevels

="2"


Oh - ok. Yeah, the dropshadow is absolutely positioned. Since your items are statically positioned, they have a different zIndex stack. Sorry, I didn't think of that. Try adding "position:relative" to your MenuStyle class (and specify that on your Menu control's CssClass property too).


No you're not slipping. You mentioned that before. :)

It's beyond me. I've gone throught the 2 stylesheets I have and I can't figure it out.

I'm down to:

<asp:MenuID="Menu1"runat="server"DataSourceID="SiteMapDataSource1"StaticDisplayLevels="1"Font-Bold="true"Style="position:relative; z-index:30"><StaticMenuItemStyleCssClass="MenuStyle"VerticalPadding="2px"/><DynamicHoverStyleCssClass="MenuStyle"BackColor="#e1ecfc"/><DynamicMenuItemStyleCssClass="MenuStyle"BackColor="#e1ecfc"/></asp:Menu>

.MenuStyle

{FONT-SIZE:8pt;VERTICAL-ALIGN:top;FONT-FAMILY:verdana;PADDING-BOTTOM:5px;position:relative;z-index:30}

On load up it flashes ontop then quickly reverts underneath. I'musing IE6.0 SP2. I'll send the source if you are really keen! :)


I have same issue like Glyder, on load up it flashes for a second for many Atlast control like dropshadow, collapsible Panel etc.
second issue is I loose my css style sheet setting any where I use atlas control. when it post back it settings are applied.
Example:

Suppose I applied css="table" for table it does not take affect until first post back, how to take care of this both problem.This will be really helpful if we can figure this out.


Hmm - yeah I'd like to take a look at this. If you could send me a repro, I'd appreciate it.
what is repro? my code?
<atlas:ScriptManagerID="SM"EnablePartialRendering="true"runat="server"></atlas:ScriptManager><atlas:UpdateProgressID="Progress"runat="server"><ProgressTemplate>

Updating Please Wait...

<imgalt="Wait"id="ImgWait"src="Images/Wait_indicator_flower.gif"/></ProgressTemplate></atlas:UpdateProgress>
<atlas:UpdatePanelID="Up1"runat="server"><ContentTemplate><asp:PanelID="pnlParent"DefaultButton="btnaddparSupp"runat="server"Visible="False"><tableclass="table"><tr><tdcolspan="2"class="heading1">

Supplier Maintenance - Setting up New Supplier Information

</td></tr><tr><tdstyle="width: 153px"align="left">

Supplier Name

</td><tdstyle="width: 334px"align="left"><asp:TextBoxID="txtparSuppName"runat="server"></asp:TextBox><asp:RequiredFieldValidatorID="ReqParSuppName"runat="server"ControlToValidate="txtparsuppName"ErrorMessage="Req"></asp:RequiredFieldValidator></td></tr>

<

tr><tdalign="center"colspan="2"class="tdheading"><asp:ButtonID="btnaddparSupp"runat="server"Text="Add"/><asp:ButtonID="btncancelparSupp"runat="server"CausesValidation="False"EnableViewState="False"Text="Cancel"/></td></tr></table></asp:Panel></ContentTemplate><Triggers><atlas:ControlEventTriggerControlID="btnParent"EventName="Click"/></Triggers></atlas:UpdatePanel>

The XHTML you're using including the menu, the DropShadowExtender, and the panel it's targeting please.

Also, please use a smaller font size when pasting in code. Thanks.


Hi, I've the same problem as you, and I found a workaround:
I have a panel where my menu is:
<asp:Panel ID="menuPanel" runat="server" CssClass="menuDiv" Style="z-index:115">
<asp:Menu ID="Menu1" runat="server">
<Items>
... (items)
</Items>
<StaticHoverStyle BackColor="#990000" ForeColor="White" />
</asp:Menu>
</asp:Panel>
then other panel for the content of the page:
<asp:Panel ID="mainPanel" runat="server" CssClass="mainDiv">
...
</asp:Panel>
then I apply the shadow to the mainPanel, but also I have to apply shadows to menuPanel (otherwise doesn't work):
<cc1:DropShadowExtender ID="DropShadowExtender1" runat="server">
<cc1:DropShadowProperties TargetControlID="mainPanel" />
</cc1:DropShadowExtender
<cc1:DropShadowExtender ID="DropShadowExtender2" runat="server">
<cc1:DropShadowProperties TargetControlID="menuPanel" />
</cc1:DropShadowExtender>
And it works!!! but that's not the perfect way. As you can see I have to apply shadow on both panels, and in the menuPanel I have to put  Style="z-index:115", and the most strange is that if a put z-index in a CssClass (menuDiv in my case) i doesn't work, I have to put it in the control itself.

Haha, thanks Matias I was able to get around a similar issue by using your method.

Wednesday, March 21, 2012

DropDownList flicker problem

Environment: VS 2005 with Atlas

Problem: I have some textboxes and dropdownlists on a page. When I click on any link to do a postback; all the dropdownlists disappear for few milliseconds and then reappear.

Note: I am not populating the dropdownlist again.

I want to avoid this flicker of dropdownlists.

If anyone has some across suck an issue, please help.

-Jagdish Yadav

Hi there,

Just wonder if you have a code snippet showing this problem.

Regards


Hi,

This is not related to any code. It happens on anyone's page.

If you have a dropdownlist on a page. And to avoid flicker of the page during postback you have applied atlas solution. Then if you do a postback, all the controls on the page remain as they are. But the dropdownlist will flicker (i.e.: it will disappear for a second and come back again). Even though we are not repopulating the dropdownlist on postback.

Please help...


Hi,

does it happen on any browsers?

Hi!

I have just tried this and it flickers in internet explorer but not in mozilla.
Can anybody tell me why this is′nt working?


I am experiencing the same problem. My scenario uses a drop down list in a usercontrol, which is in an update panel.

Anotherthread with the same issuehas not been resolved, however the individual noticed that using Internet Explorer 7 Beta 2 eliminates the problem. Of course this doesn't help those who would like to fix this problem for IE 6.

Has anyone found a fix yet?

Billy


Hi there,

I can confirm the issue even with the June CTP. The flicker happens for dropdownlists in IE6, not in IE7 Beta nor FireFox.

BTW: FireFox is in almost all cases more "ATLAS" aware and enabled, as the IE is... Very strange.

Regards


Hi,

this is not an issue of the Atlas framework. It is an issue in the way IE6 renders this type of boxed list.

DropDownList & UpdatePanel

Ok,

I have an UpdatePanel and some DropDownList inside.

When I click on the button that do the callback, the dropdownlist disappear for few seconds and then reappear ?

I tried to see the same webpage with IE7 beta 2, and this not occour.

This is the ScriptManager instance:

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True">

<ErrorTemplate>

<divstyle="padding: 12px; width: 400px; height: 140px; border: #000000 1px solid;

background-color: white; text-align: left">

An error has occurred:<br/>

<spanid="errorMessageLabel"></span>

<br/>

<br/>

<inputid="okButton"type="button"value="OK"/>

</div>

</ErrorTemplate>

<Services>

<atlas:ServiceReferencePath="~/WebService.asmx"/>

</Services>

</atlas:ScriptManager>

Showing your code with UpdatePanel and DropDownList may help.

Waiting your code..

A.


This is the code, I hope somebody can help me.

<%@. Page Language="VB" MasterPageFile="~/AppMaster.master" Title="Section 2 -- Page 1" %>

<script runat="server">

Protected Sub LinkButton1_Click1(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.DetailsView1.Visible = True Then
Me.DetailsView1.Visible = False
Me.Panel1.Visible = False
Me.LinkButton1.Text = "Visualizza testata"
Me.DropDownList4.Enabled = False
Me.DropDownList1.Enabled = False
Else
Me.DetailsView1.Visible = True
Me.Panel1.Visible = True
Me.LinkButton1.Text = "Nascondi testata"
Me.DropDownList4.Enabled = True
Me.DropDownList1.Enabled = True
End If
End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.Panel3.Visible = True
Dim focusJS As String = "setTimeout(""$('ctl00$mainCopy$Text1').focus(); "", 100);"
ClientScript.RegisterStartupScript(Me.GetType, "focusJS", focusJS, True)

Dim ObjArticolo As New InfoArticolo
Dim infArt As InfoArticolo.TipoInfoArticolo = ObjArticolo.InfArticolo(Me.DropDownList5.SelectedValue)

Dim qtDisp As Integer = infArt.disponibilita
If IsNumeric(Me.Text1.Value) Then
If qtDisp < CInt(Me.Text1.Value) Then
Me.LblQtMax.Visible = True
Me.LblQtMax.Text = "Quantita massima " & qtDisp & " pezzi"
Exit Sub
End If
Else
Exit Sub
End If

Me.LblQtMax.Visible = False
Me.LblQtMax.Text = String.Empty

Dim cc As Data.DataView = Me.ObjectDataSource1.Select()
cc.Sort = "IDArticolo"
Dim valore As Integer = cc.Find(Me.DropDownList5.SelectedValue)
If valore >= 0 Then
Exit Sub
End If


Me.ObjectDataSource1.InsertParameters(0).DefaultValue = Me.DropDownList5.SelectedValue
Me.ObjectDataSource1.InsertParameters(1).DefaultValue = Me.Text1.Value
Me.ObjectDataSource1.InsertParameters(2).DefaultValue = infArt.NumColli
Me.ObjectDataSource1.InsertParameters(3).DefaultValue = infArt.prezzo
Me.ObjectDataSource1.InsertParameters(4).DefaultValue = infArt.sconto

Me.ObjectDataSource1.Insert()
Me.GridView1.DataSourceID = "ObjectDataSource1"
Me.GridView1.DataBind()
Me.lblTotale.Visible = True
Me.Label14.Visible = True

Me.Text1.Value = ""

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsPostBack Then
Me.LblDataOrdine.Text = DateTime.Now.ToString("dd/MM/yyyy")
Me.LblDataConsegna.Text = Now.AddDays(3).ToString("dd/MM/yyyy")
Dim ccc As New Samples.AspNet.ObjectDataSource.NorthwindData()
ccc.DeleteEmployee()
ScriptPerBottone()
Dim ContentPlaceHolder2 As Web.UI.WebControls.ContentPlaceHolder = Me.Master.FindControl("ContentPlaceHolder2")
ContentPlaceHolder2.Visible = False
End If

End Sub
Public Sub ScriptPerBottone()
Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder()
sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")
sb.Append("if (Page_ClientValidate() == false) { return false; }} ")
sb.Append("this.value = 'Attendere prego';")
sb.Append("this.disabled = true;")
sb.Append(Me.ClientScript.GetPostBackEventReference(Me.Button2, ""))
sb.Append(";")
Me.Button2.Attributes.Add("onclick", sb.ToString())
End Sub



Protected Sub DropDownList5_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.Panel2.Visible = False Then Panel2.Visible = True
Me.AggiornaDettagliArticolo()
End Sub


Private Sub AggiornaDettagliArticolo()
Dim ObjArticolo As New InfoArticolo
Dim infArt As InfoArticolo.TipoInfoArticolo = ObjArticolo.InfArticolo(Me.DropDownList5.SelectedValue)
Me.Label7.Text = infArt.CodiceArticolo
Me.Label8.Text = infArt.NumColli
Me.Label9.Text = infArt.disponibilita
Me.Label10.Text = infArt.prezzo
Me.Label11.Text = infArt.promozione
Me.Label12.Text = infArt.sconto
Me.Button1.Enabled = True

End Sub

Dim ObjArticolo As New InfoArticolo
Dim totale As Double = 0
Dim sconto As Double = 0

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim myrow As WSUniprof.DSOrdine.DettaglioRow = CType(e.Row.DataItem, Data.DataRowView).Row
Dim infArt As InfoArticolo.TipoInfoArticolo = ObjArticolo.InfArticolo(myrow.IDArticolo)

Dim maxvalue As Integer = infArt.disponibilita \ myrow.NumColli

CType(e.Row.FindControl("LblArticolo"), Label).Text = infArt.Articolo
'CType(e.Row.FindControl("LabelArticolo"), Label).Text = infArt.Articolo
'CType(e.Row.FindControl("Webnumericedit1"), Infragistics.WebUI.WebDataInput.WebNumericEdit).MinValue = 1
'CType(e.Row.FindControl("Webnumericedit1"), Infragistics.WebUI.WebDataInput.WebNumericEdit).MaxValue = maxvalue
'CType(e.Row.FindControl("Label1"), Label).Text = maxvalue
'CType(e.Row.FindControl("LTotPezzi"), Label).Text = myrow.Quantita * myrow.NumColli
'CType(e.Row.FindControl("Lpromozione"), Label).Text = infArt.promozione

Dim totriga As Double = myrow.Prezzo * myrow.Quantita * myrow.NumColli
CType(e.Row.FindControl("Ltotale"), Label).Text = String.Format("{0:C2}", totriga)
totale += totriga
If totale > 5000 Then Me.LblOrdinePiccolo.Visible = False


' If e.Row.RowType = DataControlRowType.Footer Then
If Me.DropDownList2.SelectedValue = 72 Then sconto += totale * (0.015)

If sconto > 0 Then
' CType(e.Row.FindControl("LSconti"), Label).Text = "Sconti :" & String.Format("{0:C2}", sconto)
End If

Me.lblTotale.Text = String.Format("{0:C2}", totale - sconto)
'End If
End If


End Sub

Protected Sub GridView1_RowDeleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeletedEventArgs)
Me.lblTotale.Text = String.Format("{0:C2}", totale - sconto)
End Sub

Protected Sub CBForzatura_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.CBForzatura.Checked = True Then
Me.LblOrdinePiccolo.Visible = False
Else
Me.LblOrdinePiccolo.Visible = False
End If
End Sub


Protected Sub Button2_Click1(ByVal sender As Object, ByVal e As System.EventArgs)
If CInt(Me.lblTotale.Text.Replace("€", "")) < 5000 AndAlso Me.CBForzatura.Checked = False Then
Me.LblOrdinePiccolo.Visible = True
Me.CBForzatura.Visible = True
CType(Me.SqlDataSource2.Select(DataSourceSelectArguments.Empty), Data.DataView)(0)(0).ToString()
Else
System.Threading.Thread.Sleep(4000)
Me.InserisciOrdine()
End If


End Sub

#Region "Inserimento Ordine"
Private Function InserisciOrdine() As Integer
Page.Validate()
If Page.IsValid Then
Dim DsOrdine1 As WSUniprof.DSOrdine
Dim mm As New Samples.AspNet.ObjectDataSource.NorthwindData

DsOrdine1 = mm.GetAllEmployees

Dim rowTestata As WSUniprof.DSOrdine.TestataRow = DsOrdine1.Testata.NewTestataRow
rowTestata.IDAgente = Profile.IDAnagrafica
rowTestata.IDCliente = Me.DropDownList1.SelectedValue
rowTestata.DataDocumento = Me.LblDataOrdine.Text
rowTestata.DataConsegna = Me.LblDataConsegna.Text
rowTestata.IDPriorita = Me.DropDownList2.SelectedValue
rowTestata.IndirizzoSpedizione = Me.DropDownList4.SelectedItem.Text
rowTestata.CapSpedizione = CType(Me.SqlDataSource2.Select(DataSourceSelectArguments.Empty), Data.DataView)(0)(1).ToString()
rowTestata.ComuneSpedizione = CType(Me.SqlDataSource2.Select(DataSourceSelectArguments.Empty), Data.DataView)(0)(2).ToString()
rowTestata.ProvSpedizione = CType(Me.SqlDataSource2.Select(DataSourceSelectArguments.Empty), Data.DataView)(0)(3).ToString()
rowTestata.IDPagamento = Me.DropDownList3.SelectedValue
rowTestata.note = Me.TextBoxNote.Text

DsOrdine1.Testata.AddTestataRow(rowTestata)

Dim WEBserv As New WSUniprof.ClassCliente
Dim numOrd As Integer = WEBserv.IserimentoOrdine(DsOrdine1, "Cervellione Giovanni", "malbec10")
If numOrd > 0 Then
' InviaOrdinePerEmail(numOrd)
' Session("LastMessage") = lingue.rm("msg4") & " " & numOrd
Else
' Session("LastMessage") = lingue.rm("msg3")
End If
Response.Redirect("default.aspx", False)
End If
End Function
#End Region
</script>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="mainCopy">

<script language="javascript" type="text/javascript">
// <!CDATA[

function ControllaValore(textbox) {
if (!IsNumeric(textbox.value)){textbox.value='';}
}

function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;


for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;

}


function pickDate(Src){
window.open("CalendarPopUp_child.aspx?src=" + Src, "_blank", "height=255, width=240, left=100, top=100, " +
"location=no, menubar=no, resizable=no, " +
"scrollbars=no, titlebar=no, toolbar=no", true) ;
}

// ]]>
</script>

<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True">
<ErrorTemplate>
<div style="padding: 12px; width: 400px; height: 140px; border: #000000 1px solid;
background-color: white; text-align: left">
An error has occurred:<br />
<span id="errorMessageLabel"></span>
<br />
<br />
<input id="okButton" type="button" value="OK" />
</div>
</ErrorTemplate>
<Services>
<atlas:ServiceReference Path="~/WebService.asmx" />
</Services>
</atlas:ScriptManager>
<div class="container" id="DIV1" runat="server" style="width: 550px">
<p>
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" style="width: 550px">
<tr>
<td colspan="4" style="width: 550px">
<asp:Panel ID="Panel1" runat="server" Width="550px">
<h1>
Testata ordine</h1>
<p>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border-right: gainsboro 1px solid;
border-top: gainsboro 1px solid; border-left: gainsboro 1px solid; border-bottom: gainsboro 1px solid;">
<tr>
<td style="width: 100px; height: 17px; background-color: lavender;">
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" Text="Ordine"></asp:Label></td>
<td style="width: 100px">
<asp:Label ID="LblDataOrdine" runat="server" Text="Label"></asp:Label></td>
<td style="width: 100px; background-color: lavender;">
<asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" Text="Priorità"></asp:Label></td>
<td style="width: 100px">
<asp:DropDownList ID="DropDownList2" runat="server" Font-Size="10px">
<asp:ListItem Selected="True" Value="1">Contanti</asp:ListItem>
<asp:ListItem Value="74">Assegno circolare allo scarico</asp:ListItem>
<asp:ListItem Value="52">Assegno C/C allo scarico</asp:ListItem>
<asp:ListItem Value="72">Anticipato (sconto 1,5%)</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td style="width: 100px; height: 17px; background-color: lavender;">
<asp:LinkButton ID="LinkButton2" runat="server" Font-Bold="True" ForeColor="Black"
OnClientClick="pickDate('ctl00_mainCopy_LblDataConsegna')">Consegna</asp:LinkButton></td>
<td style="width: 100px">
<asp:TextBox ID="LblDataConsegna" runat="server" Font-Size="10px" Width="72px" ReadOnly="True"></asp:TextBox></td>
<td style="width: 100px; background-color: lavender;">
<asp:Label ID="Label5" runat="server" Font-Bold="True" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" Text="Pagamento"></asp:Label></td>
<td style="width: 100px">
<asp:DropDownList ID="DropDownList3" runat="server" Font-Size="10px" Width="166px">
<asp:ListItem Selected="True" Value="2">Normale</asp:ListItem>
<asp:ListItem Value="4">Urgente</asp:ListItem>
<asp:ListItem Value="1">Sospeso</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td style="width: 100px; height: 17px; background-color: lavender;">
<asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" Text="Cliente"></asp:Label></td>
<td colspan="3">
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
DataTextField="Cliente" DataValueField="IDAnagraficaCliente" Font-Size="10px"
Width="97%">
</asp:DropDownList></td>
</tr>
<tr>
<td style="width: 100px; height: 17px; background-color: lavender;">
<asp:Label ID="Label6" runat="server" Font-Bold="True" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" Text="Indirizzo"></asp:Label></td>
<td colspan="3">
<asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Indirizzo" DataValueField="Indirizzo" Font-Size="10px" AutoPostBack="True"
Width="328px">
</asp:DropDownList></td>
</tr>
</table>
</p>
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="4" rowspan="3" id="TDDettagliIndirizzo" style="visibility: visible;
width: 550px;">
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource2"
Height="50px" Width="550px" BorderColor="ActiveBorder" BorderWidth="1px" CellPadding="4"
ForeColor="#333333" GridLines="None">
<Fields>
<asp:TemplateField HeaderText="Indirizzo" SortExpression="Indirizzo">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Indirizzo") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Indirizzo") %>'></asp:TextBox>
</InsertItemTemplate>
<ControlStyle Width="300px" />
<ItemStyle Width="300px" />
<HeaderStyle Width="300px" />
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Indirizzo") %>'></asp:Label>
</ItemTemplate>
<FooterStyle Width="300px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cap" SortExpression="Cap">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Cap") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Cap") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Cap") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comune" SortExpression="Comune">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Comune") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Comune") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Comune") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Provincia" SortExpression="Provincia">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Provincia") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Provincia") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("Provincia") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Fields>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
<EditRowStyle BackColor="#999999" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:DetailsView>
</td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td align="right" colspan="4" rowspan="1" style="visibility: visible; padding-right: 10px;
width: 550px;">
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click1">Nascondi testata</asp:LinkButton></td>
</tr>
<tr>
<td class=" " colspan="4" rowspan="1" style="visibility: visible; width: 550px;">
<h1>
Dettaglio ordine</h1>
<br />
<asp:DropDownList ID="DropDownList5" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3"
DataTextField="DescrizioneArticoloRidotta" DataValueField="IDArticolo" Font-Size="10px"
OnSelectedIndexChanged="DropDownList5_SelectedIndexChanged">
</asp:DropDownList>
<input onkeyup="ControllaValore(this)" id="Text1" style="width: 32px; font-size: 10px;"
type="text" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Inserisci" OnClick="Button1_Click"
Enabled="False" />
<br />
<asp:Label ID="LblQtMax" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label></td>
</tr>
<tr>
<td class=" " colspan="4" rowspan="1" style="visibility: visible; width: 550px; height: 82px;">
<asp:Panel ID="Panel2" runat="server" Visible="False" Width="550px" BorderColor="Silver"
BorderStyle="Solid" BorderWidth="1px">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border-top-width: 1px;
border-left-width: 1px; border-left-color: black; border-bottom-width: 1px; border-bottom-color: black;
border-top-color: black; border-right-width: 1px; border-right-color: black;">
<tr>
<td style="width: 100px; height: 16px; background-color: lavender;">
<strong>Codice</strong></td>
<td style="width: 100px; height: 16px;">
<asp:Label ID="Label7" runat="server" Text="Label" Font-Overline="False"></asp:Label></td>
<td style="width: 100px; height: 16px; background-color: lavender;">
<strong>Prezzo</strong></td>
<td style="width: 100px; height: 16px;">
<asp:Label ID="Label10" runat="server" Text="Label"></asp:Label></td>
</tr>
<tr>
<td style="width: 100px; background-color: lavender; height: 16px;">
<strong>Pezzi per cassa</strong></td>
<td style="width: 100px; height: 16px;">
<asp:Label ID="Label8" runat="server" Text="Label"></asp:Label></td>
<td style="width: 100px; background-color: lavender; height: 16px;">
<strong>Promozione</strong></td>
<td style="width: 100px; height: 16px;">
<asp:Label ID="Label11" runat="server" Text="Label"></asp:Label></td>
</tr>
<tr>
<td style="width: 100px; background-color: lavender; height: 20px;">
<strong>Disponibilita'</strong></td>
<td style="width: 100px; height: 20px;">
<asp:Label ID="Label9" runat="server" Text="Label"></asp:Label></td>
<td style="width: 100px; background-color: lavender; height: 20px;">
<strong>Sconto</strong></td>
<td style="width: 100px; height: 20px;">
<asp:Label ID="Label12" runat="server" Text="Label"></asp:Label></td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
<td class=" " colspan="4" rowspan="1" style="visibility: visible; width: 550px;"
valign="top">
<asp:GridView ID="GridView1" runat="server" SkinID="booksSkin" AutoGenerateColumns="False"
DataKeyNames="IDArticolo" DataSourceID="ObjectDataSource1" Width="550px" OnRowDataBound="GridView1_RowDataBound"
OnRowDeleted="GridView1_RowDeleted" Font-Size="10px">
<Columns>
<asp:TemplateField HeaderText="Articolo" SortExpression="IDArticolo">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("IDArticolo") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="LblArticolo" runat="server" Text='<%# Bind("IDArticolo") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Qt" SortExpression="Quantita">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Quantita") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Quantita") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="PzxCs" SortExpression="NumColli">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("NumColli") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("NumColli") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Prezzo" SortExpression="Prezzo">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Prezzo") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("Prezzo") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Totale">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:Label ID="LblTotale" runat="server" Text="Label"></asp:Label>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Ltotale" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
<FooterStyle HorizontalAlign="Right" />
<FooterTemplate>
<asp:Label ID="LTotOrdine" runat="server" EnableViewState="False" Font-Bold="True"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

</td>
</tr>
<tr>
<td align="right" class=" " colspan="4" rowspan="1" style="visibility: visible; width: 550px;">
<asp:Label ID="Label14" runat="server" Text="Totale ordine : " Visible="False"></asp:Label>
<asp:Label ID="lblTotale" runat="server" Text="Label" Visible="False"></asp:Label></td>
</tr>
<tr>
<td align="left" class=" " colspan="4" rowspan="1" style="width: 550px; height: 82px;">
<br />
<asp:Panel ID="Panel3" runat="server" Visible="False" Width="550px">
inserire qui le note
<br />
<asp:TextBox ID="TextBoxNote" runat="server" Width="100%" TextMode="MultiLine"></asp:TextBox>
<br />
<asp:Button ID="Button2" runat="server" Text="Inserisci Ordine" OnClick="Button2_Click1" />
<asp:Label ID="LblOrdinePiccolo" runat="server" Text="Ordine inferiore a 5.000 euro"
ForeColor="Red" Visible="False"></asp:Label>
<asp:CheckBox ID="CBForzatura" runat="server" Text="Forza ordine" Visible="False"
AutoPostBack="True" OnCheckedChanged="CBForzatura_CheckedChanged" /></asp:Panel>
</td>
</tr>
</table>

</ContentTemplate>
</atlas:UpdatePanel>
</p>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DiamanteConnectionString %>"
SelectCommand="SELECT DISTINCT Cliente, IDAnagraficaCliente FROM RVClientiPerAgente WHERE (IDAnagraficaAgente = @.IDAnagrafica) ORDER BY Cliente">
<SelectParameters>
<asp:ProfileParameter Name="IDAnagrafica" PropertyName="IDAnagrafica" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DiamanteConnectionString %>"
SelectCommand="SELECT DISTINCT Indirizzo, Cap, Comune, Provincia FROM RVClientiPerAgente WHERE (IDAnagraficaCliente = @.IDAnagraficaCliente)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="IDAnagraficaCliente" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:DiamanteConnectionString %>"
SelectCommand="SELECT [IDArticolo], [DescrizioneArticoloRidotta] FROM [RVRepArticolo] WHERE ([disponibilita2] > @.disponibilita2) ORDER BY [DescrizioneArticoloRidotta]">
<SelectParameters>
<asp:Parameter DefaultValue="0" Name="disponibilita2" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:DiamanteConnectionString %>"
SelectCommand="SELECT IDArticolo, CodiceArticolo,Numcolli, prezzoAgente, DescrizioneArticoloRidotta, disponibilita2, PrezzoPromozione, prezzo FROM RVRepArticolo WHERE (IDArticolo = @.IDArticolo) ORDER BY DescrizioneArticoloRidotta">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList5" DefaultValue="0" Name="IDArticolo"
PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetAllEmployees" TypeName="Samples.AspNet.ObjectDataSource.NorthwindData"
InsertMethod="InsertEmployee" DeleteMethod="DeleteEmployee">
<InsertParameters>
<asp:Parameter Name="id" Type="Int32" />
<asp:Parameter Name="dd" Type="Int32" />
<asp:Parameter Name="ss" Type="Int32" />
<asp:Parameter Name="vv" Type="Decimal" />
<asp:Parameter Name="ll" Type="Int32" />
</InsertParameters>
<DeleteParameters>
<asp:Parameter Name="id" Type="Int32" />
<asp:Parameter Name="dd" Type="Int32" />
<asp:Parameter Name="ss" Type="Int32" />
<asp:Parameter Name="vv" Type="Decimal" />
<asp:Parameter Name="ll" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
</asp:Content>