Showing posts with label toolkit. Show all posts
Showing posts with label toolkit. Show all posts

Monday, March 26, 2012

ListSearch does not preserve ViewState

I just downloaded the latest version of the Toolkit today hoping that the 3 or so issue requests for the ListSearch would have corrected everything.

My problem is that after a item is selected in a DropDownList the and I either hit the tab key or press enter (with the autopostback set on the ddl) the postback occurs (that part was fixed from the last version) but when the page comes back the ddl is reset. It does not contain the item I selected even though enableviewstate is set to true. Does anyone else have this problem or know how to correct it?

Thanks

I've just run a small test and it worked fine for me -- if you change the item simply by clicking, does the selected item remain?

Thanks,

Damian


FWIW if you try enabling the AutoPostBack on the example in the toolkit, then it won't work because the control's contents are always rebound on page load, instead of just once when the page is initially loaded.

Regards,

Damian (ListSearch author)


No it does not, I have tried it both in a update panel and with the controls by themselves (not that that should matter). For my testing I took the listsearch page from the new sample website and just added a label to it. Then in the selectedindexchanged event of the ddl I set the label text to the current datetime just to test the postback funtionality I want to use. As far as I know I have left the ddl and the extender alone with the exception of setting the autopostback.


Hmmm. So is there a way then to cancel the binding of the controls contents on the postback? I'm guessing check the Page.IsPostBack and Page.IsCallBack properties, but where would I do that?

Thanks,

BTW. Below are the pieces of code I am working with.

<script runat="server"> protected override void OnLoad(EventArgs e) { base.OnLoad(e); ListBox1.DataSource = GetWordListText(); ListBox1.DataBind(); DropDownList1.DataSource = GetWordListText(); DropDownList1.DataBind(); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToLongTimeString(); }</script><asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:DropDownList ID="DropDownList1" runat="server" Width="100px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True" /><asp:Label ID="Label1" runat="server" Text="Label" Width="125px"></asp:Label><ajaxToolkit:ListSearchExtender ID="ListSearchExtender2" runat="server" TargetControlID="DropDownList1" PromptCssClass="ListSearchExtenderPrompt"> </ajaxToolkit:ListSearchExtender> </ContentTemplate></asp:UpdatePanel>

If you do do something like this it should work:

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

if(!IsPostBack ) {
ListBox1.DataSource = GetWordListText();
ListBox1.DataBind();
DropDownList1.DataSource = GetWordListText();
DropDownList1.DataBind();

}
}


Thanks Damian, that did it. Also, thanks so much for you work with the toolkit.

Saturday, March 24, 2012

Load an aspx nto another aspx with ajax

HI

I have a aspx page with a table and 1 DIV tag. I have a another aspx page with table and 2 maskedit ajax control toolkit.

I want to load second page into DIV of first page when user load first page. I want to show progress bar and after load completed second page added into first page (DIVpart)

can anyone help me for writting this code?

best reagrds

Not sure about the divs but you can accomplish this with .Net and Masterpages and multiple contentplaceholders...


Thank you for replying my post.

But can you write a small example for me that I can insert a aspx page into another one with AJAX. I need second page has a maskedit control toolkit and I can insrt it into first aspx page.

Best regardsEmbarrassed


Really sorry I can not - as I stay away frm master pages where possible -- however you can take a look the AjaxControl ToolKIt sample website (which you can download) and play around with it for yourself...

Load Foreign Website into Tab

Hi,

I am using the tabpanel from the AJAX toolkit, and have created multiple tab panels...for each panel I want to load a new site into it...

For example:

Tab 1 -www.asp.net

Tab 2-www.google.com

etc etc...

Does anyone know how I can do this at all?

Thanks

Hi,

You can add iFrames to the different tabs.

More info:

http://www.w3schools.com/tags/tag_iframe.asp

http://msdn2.microsoft.com/en-us/library/ms535258.aspx

Regards


Thanks!

Wednesday, March 21, 2012

Loading AJAX ToolKit into Visual Web Developer 2008 Express Edition

I assume I can load the AJAX ToolKit into Visual Web Developer 2008 Express Edition's toolbar. If so, can someone kindly point me to (or provide me with) installation instructions? I would greatly appreciate it. Thanks in advance for any help/guidance.

1. Download and unzip AJAX toolkit from here:http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx
2. Right mouse click on your Toolbar -> Add Tab -> Enter name of new tab
3. Right mouse click inside new tab -> Choose Items...
4. In new window click on Browse... -> (folder where you unzipped AJAX toolkit)/SampleWebSite/Bin/AjaxControlToolkit.dll -> Open -> OK


kipo,

I was obviously looking in the wrong folder: (folder where I unzipped AJAX toolkit)/Binaries.

Thanks for your help!

BobZ

Loading external .aspx file into AJAX Toolkit TabPanel

Hello,

I'm new to ASP.NET AJAX. I want to create a default page, maybe a master page. then i want to add the AJAX Toolkit TabContainer with different TabPanels for each of my other .aspx files (home.aspx, about.aspx, etc.) I want to know how I would setup the TabContainer with a tabpanel for each page and load those pages when the appropriate Tab is clicked. a small snippet of example code would be greatly appreciated

Thanks to all in advance

GL

How about something like this?

<ajaxToolkit:TabContainer ID="tabs" runat="server" Width="600px" Height="400px">
<ajaxToolkit:TabPanel ID="tabHome" runat="server" HeaderText="Home">
<ContentTemplate>
<iframe src="http://pics.10026.com/?src=home.aspx" width="100%" height="100%">
</iframe>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabAbout" runat="server" HeaderText="About">
<ContentTemplate>
<iframe src="http://pics.10026.com/?src=about.aspx" width="100%" height="100%">
</iframe>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>


Thanksctafield, that did the trick. works like a charm but I wonder if there might be another way besides frames. I dont like to use frames plus i'm concerned about browsers that may not support frames. Thank you for the quick response

If there is another way I would greatly appreciate the guide

Thanks

GL


Ok, When I used the iframe my pages end up having 2 separate vertical scrollbars. one for the main window and one for the iframe region. i cna see that confusing my users when they need to scroll up or down. has anyone thought of another solution?

you can actually turn off the scrollbars for the iframe - just make sure you set its width and height to 100% so data doesn't get chopped and that would get rid of the scrollbar for the iframe...

<

iframeid="TargetPane"scrolling="no"


Hi,

You might also be interested in reading one of Scott Guthrie'sblog posts where he created a class called ViewManager to render ASP.NET controls to HTML and send it via a webservice to the page.

Thanks,
Ted


You can add WebControls (.ascx) to each panel you want by using following code-behind:

AjaxControlToolkit.TabPanel tpHome = new AjaxControlToolkit.TabPanel();
tpHome.HeaderText = "Home";
tpHome.ContentTemplate = Page.LoadTemplate("Home.ascx");
tcDefault.Tabs.Add(tpHome);

AjaxControlToolkit.TabPanel tpAbout = new AjaxControlToolkit.TabPanel();
tpAbout.HeaderText = "About";
tpAbout.ContentTemplate = Page.LoadTemplate("About.ascx");
tcDefault.Tabs.Add(tpAbout);

tcDefault is TabContainer control.


AjaxControlToolkit.TabPanel tab = new AjaxControlToolkit.TabPanel();
tab.HeaderText = "test_new_tab";
TabContainer1.Tabs.Add(tab);

??index error WHY?

Good piece of code to use the control on the code behind.
Even the control toolkit samples didn't have these in detail

However i couldn't load an external page onto the page.loadtemplate method
It throws the following error when trying with full path


Exception Details:System.Web.HttpException: 'http://localhost:8080/Documents/9245/bjk49000.PDF' is not a valid virtual path.

Any suggestions?

Rain Man


At the moment i'm using the following method by coding on the client end

<ajaxToolkit:TabPanel runat="server" ID="TabPanelAttachment" HeaderText="Attachments">
<ContentTemplate>
<iframe runat="server" id="iframePreview" width="850" height="800" frameborder ="0"> </iframe>
</ContentTemplate>
</ajaxToolkit:TabPanel
var urlPrefix = "http://localhost:8080/Documents/"
var urlSuffix = docId + "/" + fileName;
var url = urlPrefix + urlSuffix;

$find('TabContainerDocument').set_activeTabIndex(1);
document.getElementById('TabContainerDocument_TabPanelAttachment_iframePreview').src = url;

TabContainerDocument_TabPanelAttachment_iframePreview is the iframe id at run time
Hope that helps for someone who is trying on something similar

Happy coding

Rain Man


This reallyhas to be built into the TabPanel tool.


Haven't tried this but it might be another alternative to controls and iFrames...

Dynamic drive website has example of using Javascript to do page calls to a div, not too sure if will work in but might be good for a try?

http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

Dave

Loading the Ajax Toolkit Page with IFrame into Php-website: Access denied

How to load the Ajax Toolkit Page (my Chat) with IFrame into Php-website?

Code for an illustration:

1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">2<html xmlns="http://www.w3.org/1999/xhtml" >3<head>4<title>Untitled Page</title>5</head>6<body>7<iframe id="iframe1" width="100%" height="1000" frameborder="0" src="http://ajax.asp.net/ajaxtoolkit/Accordion/Accordion.aspx" marginwidth="0" marginheight="0" scrolling="no" />8</body>9</html>10

There is nothing elase that you have to do.

Since PHP is in-line with HTML, just close your PHP and specify the HTML iframe tage.

As long as the iframe page is a complete AJAX Toolkit page that works stand-alone, you should be fine.

Localisation not working

Hi Guys,

I have a problem with AJAX Control Toolkit.

I use a german system WIndows Vista Ultimate and Visual Studio 2005 SP1.
When I try to create a new AJAXEnabledWebsite putting a CalendarExtender on the page, it displays strings and dateformat in english.

When I start the AjaxControlToolkit Sample Website, it is german!

I checked already that the satelite assemblies are being copied, is there something else I have to configure that localisation works?
I cannot find any difference between my little test project and AjaxControlToolkit Sample Website.

Thanks for any help!

Mark

i think that you have to identify the page caltur arrtibute it self too, like below

Culture="auto:de-DE" UICulture="auto"
i hope this will solve your matter.