Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Monday, March 26, 2012

Atlas Update Panel Content Template

Hi All,

I want to generate update panel dynamically.

I am using the following code to do that

UpdatePanel

panel =newUpdatePanel();

panel.Mode =

UpdatePanelMode.Conditional;ControlEventTrigger obj =newControlEventTrigger();

obj.ControlID =

"Button1";

obj.EventName =

"Button1_Click";

panel .Triggers.Add(obj);

I want to know how shall we add the controls to the content Template dynamically for the update panel.

Regards,
Techwork

Hello,

myUpdatePanel.Controls.Add( myGridView );

I hope this will work.


Hi,

I had already tried that. It will not work.

We need to add the controls to the content Template of the update panel and not the update panel.

Regards,

Techwork


Hi All,

I am using the following code to do the dynamic update panel.

UpdatePanel panel =newUpdatePanel();

panel.ID =

"panel";

panel.Mode =

UpdatePanelMode.Conditional;

panel.ContentTemplate = Page.LoadTemplate(

"~/UpdateUserControl.ascx");UpdateUserControl user =new UpdateUserControl();ControlEventTrigger obj =newControlEventTrigger();

obj.ControlID =((Button)user.FindControl("Button1")).ID;

panel.Triggers.Add(obj);

I am not getting any error but when I run this page the usercontrol is not loading.

I have the scriptamanager in the page. I have written this code in the Page_Load() event of the page

Do I need to do soem more things other than this?

where exactly I am going wrong?

Regards,

Techwork


Firs you have make yourself a UpdatePanelContent class. Make it a inner class within the class holding the updatepanel.
Note, the only method you need to declare in this class, additional to the constructor, is the instantiateIn . Required by the ITemplate interface

publicclassUpdatePanelContent :ITemplate

{

publicControl m_Control;

public UpdatePanelContent(Control controlToAdd)

{

m_Control = controlToAdd;

}

publicvoid InstantiateIn(Control container)

{

container.Controls.Add(m_Control);

}

}

--Now you can instantiate your panelcontent as shown.
Add your hook, page or whatever controlcollection to the panelcontent trough the updatepanelcontent contructor.

UpdatePanelContent panelContent =newUpdatePanelContent(your_control_collection);

the_updatepanel_instance.ContentTemplate = panelContent;

Regards Knut Dullum

Atlas Update Panel

I have an Update panel and I want to Update it on th server code when an Event occure.

How can I do this?

when I use Update1.update();

my update panel dont Update;

please help me!!!!!

Make sure you have a script manager on the page

<atlas:ScriptManager runat="server" EnablePartialRendering="true" ID="updateManager">

You need to wire up a button to the update panel with the Triggers tag. Ex:

<atlas:UpdatePanel ID="atlasPanel" runat="server" RenderMode="Inline" Mode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="drpCountry" runat="server"
DataTextField="DESCRIPTION" DataValueField="PK" AutoPostBack="True">
</asp:DropDownList>

<asp:DropDownList ID="drpProvince" runat="server"
DataTextField="DESCRIPTION" DataValueField="PK" AutoPostBack="True">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="btnReload" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>


Check UpdateMode property, set it to "Conditional". Register your control in Page_Load method

ScriptManager1.RegisterAsyncPostBackControl(ControlName);

Let me know if this helps you


thanks for your help

but i want updating occur when a Event is occur

for example i want when sqlnotification event is occur my gridview will update Automatically

in my code i use SqlDependency and SqlDependency Rise an Event (onchangedataSource)

i want update my GridView in this time

excuse me i can't write english good


Hi,

Please note that UpdatePanel is used for events that originates from a page. If the events isn't from a specific page, then the updatePanel isn't able to update the contents on a page.

You may add a timer on the page and use it to fire events continuously on current page. And in the tick event handler of the timer, update the Gridview if necessary.

Hope this helps.


Thanks for your help.

and one more questuin:

i want emplement a web chat like Gmail web Chat what is the best Course of implemention for this kind of web chating?


I think it can be done in this way:

1. add a hiddenField on the page to keep the latest time of messages on current page

2. use window.setInterval to call a web service periodically and pass the latest time as the parameter

3. the web service returns all messages that is created later then the parameter

4. use javascript to display those results on the page



Thanks for Yor help

Saturday, March 24, 2012

Atlas to AJAX migration woes

I have quite a bit of client side code that uses the Sys.UI namespace. Where is Sys.UI.TextBox and Sys.UI.Select? I read a document a few months ago about these being moved, but for the life of me I can not lacate them.

this.orgTextEditBox =new Sys.UI.TextBox( $('<%= this.orgInfoValue.ClientID %>' ) );
this.orgTextEditBox.initialize();

Now this code will not work, what do I need to do to get back ontrack?

Thanks, Bill

I realized that I had not installed the Jan Features CTP, so with that and a change to the following, I have it working

this.orgTextEditBox =new Sys.Preview.UI.TextBox( $get('<%= this.orgInfoValue.ClientID %>' ) );
this.orgTextEditBox.initialize();

Now for a Select option box aka dropdown, it is working, however, the set_enabled() isn't working.I have
the following dataLst.set_enabled(bOption), so it looks like I need to do something else.

Any ideas?

Atlas TextBox with 2 column ListView as Completion suggestions

Anybody know how to implement this? When implementing autocompletion I need to display more info on the code that the enduser is typing. So instead of the list I get out of the box when trying autocompletion, I was thinking of implementing a mulicolumn listview ( or something similar).
Anybody know how to do this?
Borge3000

For now, you would have to write your own AutoComplete behavior, orperhaps extend the current one. Perhaps if lots of people areinterested in such a behavior, I could put it together sometime for you.

I would very much like this. Maybe you could outline what to to to make this myself?

Atlas tags in VS2005

Hello,

While reading the followingpost and trying ot test a code in my VS2005 Atlas WebSite , I found that some atlas tags were not recognised in my application to the extend that, the intellisense complete word doesn't propose tas such as: <atlas:ListView>, <atlas:label>, <atlas:itemView>,<atlas:DragDropList>, <atlasDraggableListItem>, etc.

Could some one explain me why my VS2005, dosen't recognise these tags and how can I do to enable that?

Thanks

same problem for me too. I can only see following 10 atlas controls:

<

atlas:AutoCompleteExtender></atlas:AutoCompleteExtender><atlas:DragOverlayExtender></atlas:DragOverlayExtender><atlas:Gadget></atlas:Gadget><atlas:InitialData></atlas:InitialData><atlas:ProfileScriptService></atlas:ProfileScriptService><atlas:ScriptManager></atlas:ScriptManager><atlas:ScriptManagerProxy></atlas:ScriptManagerProxy><atlas:TimerControl></atlas:TimerControl><atlas:UpdatePanel></atlas:UpdatePanel><atlas:UpdateProgress></atlas:UpdateProgress>I'm using the March CTP release. Also I'm wondering why these tags do not appear in the toolbox list??

Wednesday, March 21, 2012

Atlas Server Controls

Will there be drag and drop server controls for Atlas once it ships? Drag Atlas (AJAX) control from toolbox to web form, write C# code, done! Dart has a great set off LiveControls that are very easy to use but also pretty expensive. Does anybody know?
PatrickYou can already do that with the Atlas server controls if you add them to the toolbox.

Thanks for your reply. I downloaded the following from atlas.asp.net

Atlas Blank Project VSI

Use this project add-in to Visual Studio 2005 Beta 2 to create your own Atlas web project. Includes Atlas binaries and everything you'll need.
When I open a New Atlas Project and right click on the Toolbox - Choose Items - I can't find the atlas controls under the .Net Framework Components or the COM Components. Is there something else I need to install? Please let me know. Thanks, Patrick


Yes, if you want the controls in the toolbox, you'll have to add them. You do this from the context menu of the toolbox itself, which will enable you to add the controls from the atlas dll.
I'm sorry to bother you again. I have added a new tab to the toolbox and called it Atlas. Now I have four different places where the Microcoft.Web.Atlas.dll is located on my machine. Am I right to assume that I should find the atlas controls when I right click in the Toolbox and click Choose Items under the tab .Net Framework Components?
What do you mean when you write "which will enable you to add the controls from the atlas.dll?
Do I have to browse to one of the Microsoft.Web.Atlas.dll's on my computer? Will that add the controls.
Lost sorry.............
Thanks, Patrick
Thanks Bertrand, I figured it out. I browsed to the Microsoft.Web.Atlas.dll double clicked on it. This added all the Microsoft.Web.UI controls to the .Net Framework Components tab and I was able to add the controls to the Toolbox. Pretty easy really. Thanks for your help once again. Happy coding, Patrick
I've done this too, thank you. But should I still be getting manyerrors such as "The active schema does not support the element Binding"? In my code browser?
I can't even switch to design view because it complains of the Atlas tags.

That's an issue in the PDC build that has been fixed in the next build we'll release.

Hi,

I've just installed the January release and trying to add the controls to my Toolbox. Whenever I try to add Microsoft.Web.Atlas.dll by browsing it in the "Choose Toolbox Items", I received an error message:

There was an error loading types from assembly C:\Microsoft.Web.Atlas.dll
Request for permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c5656565' failed.

I am unable to add it to my toolbar... Any idea what I am missing?

Thanks!

Janh

Atlas pulling back DataGrid

I'm pretty sure I can sell my boss on ASP 2.0 and ATLAS because of the non-post back. Pulling data from a DB.

Only, I don't know how to code Atlas to pull back say a datasource and put it into a datagrid without post back.

Any sample code anyon has done that they can share? I want to get something up quick, something small.

Click button and show data from a table.

I'm still reading through the tutorials.

I try the code at

http://atlas.asp.net/quickstart/atlas/doc/data/default.aspx#datatable
http://atlas.asp.net/quickstart/util/srcview.aspx?path=~/atlas/samples/data/datatable.src

Even their example comes up blank.

I copied the code and change the SQL connection and select statement, also changed the <label targetElements>'s to match table field names.

I get no data returned either like their example.

Secondly, how do you add a button to initate the data pull instead of just loading it.


I guess no takers. Or even point me in the right direction as in what to search on.

Mastro,

The Atlas UpdatePanel server control actually makes it super easy to turn any ASP.NET 2.0 GridView or other control into an AJAX-style UI with efficient postbacks.

If you have a GridView that is bound to a data source control, you can make it update without postbacks by doing the following:

1) Add an Atlas:ScriptManager control to the page, and setting the EnablePartialRendering property on it to true.

2) Enclose the GridView in an Atlas:UpdatePanel control, putting the GridView inside the UpdatePanel's ContentTemplate.

3) If you want to be able to add items, you can also add a DetailsView or FormView control to the page, and set up a trigger to update the GridView automatically.

Scott's weblog has a great post, with full sample code, that walks you through setting up a GridView bound to a datasource, and then enabling it for Atlas postbacks. You can find it athttp://weblogs.asp.net/scottgu/archive/2005/12/26/433997.aspx.